implement field accesses

This commit is contained in:
nora 2023-07-30 23:59:43 +02:00
parent 7f65dc0277
commit 2da011caf4
7 changed files with 224 additions and 96 deletions

View file

@ -140,6 +140,9 @@ function printExpr(expr: Expr, indent: number): string {
);
}
}
case "fieldAccess": {
return `${printExpr(expr.lhs, indent)}.${expr.field.value}`;
}
case "if": {
const elsePart = expr.else
? ` else ${printExpr(expr.else, indent + 1)}`