diff --git a/compiler/lowerer.ts b/compiler/lowerer.ts index 62fe2e7..ac7e7af 100644 --- a/compiler/lowerer.ts +++ b/compiler/lowerer.ts @@ -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);