pseudo-states appear to be working + variables only exist within the scope where they are created

This commit is contained in:
Joeri Exelmans 2025-10-16 17:10:37 +02:00
parent db1479bfc4
commit d4930eb13d
22 changed files with 742 additions and 569 deletions

View file

@ -42,5 +42,10 @@ export function evalExpr(expr: Expression, environment: Environment): any {
const rhs = evalExpr(expr.rhs, environment);
return BINARY_OPERATOR_MAP.get(expr.operator)!(lhs, rhs);
}
else if (expr.kind === "call") {
const fn = evalExpr(expr.fn, environment);
const param = evalExpr(expr.param, environment);
return fn(param);
}
throw new Error("should never reach here");
}