add sourcemaps 2

This commit is contained in:
SimonFJ20 2024-12-13 10:33:51 +01:00
parent c5ec4a9970
commit f2163901d8

View File

@ -50,7 +50,6 @@ export class Lowerer {
}
private lowerStaticStmt(stmt: Stmt) {
this.addSourceMap(stmt.pos);
switch (stmt.kind.type) {
case "fn":
return this.lowerFnStmt(stmt);
@ -387,8 +386,8 @@ export class Lowerer {
this.program.setLabel(falseLabel);
if (expr.kind.falsy) {
this.addSourceMap(expr.kind.truthy.pos);
this.lowerExpr(expr.kind.falsy!);
this.addSourceMap(expr.kind.falsy.pos);
this.lowerExpr(expr.kind.falsy);
} else {
this.program.add(Ops.PushNull);
}
@ -430,6 +429,7 @@ export class Lowerer {
this.lowerStmt(stmt);
}
if (expr.kind.expr) {
this.addSourceMap(expr.kind.expr.pos);
this.lowerExpr(expr.kind.expr);
} else {
this.program.add(Ops.PushNull);