Add assignments

This commit is contained in:
nora 2023-07-30 20:44:59 +02:00
parent 6d2a2fe474
commit 0bf9aed35e
6 changed files with 113 additions and 32 deletions

View file

@ -78,6 +78,9 @@ function printExpr(expr: Expr, indent: number): string {
indent + 1
)}`;
}
case "assign": {
return `${printExpr(expr.lhs, indent)} = ${printExpr(expr.rhs, indent)}`;
}
case "block": {
const exprs = expr.exprs.map((expr) => printExpr(expr, indent + 1));