Last active
January 2, 2020 08:20
-
-
Save WimJongeneel/65712db9bf74932c9047809410f0e4a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const runExpr = (e: Expr, i: any): any => { | |
if (e.kind == 'acs') return i[e.id] | |
if (e.kind == '==') return runExpr(e.left, i) == runExpr(e.right, i) | |
if (e.kind == 'includes') return runExpr(e.left, i).contains(runExpr(e.right, i)) | |
if (e.kind == '&&') return runExpr(e.left, i) && runExpr(e.right, i) | |
if (e.kind == 'val') return e.value | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment