From 0875b447e45c278db0f25bf2b3f6a6bb0390bdf9 Mon Sep 17 00:00:00 2001 From: SimonFJ20 Date: Fri, 13 Dec 2024 12:15:32 +0100 Subject: [PATCH] correct pos on error --- compiler/parser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/parser.ts b/compiler/parser.ts index 757b85e..0f62f85 100644 --- a/compiler/parser.ts +++ b/compiler/parser.ts @@ -133,7 +133,7 @@ export class Parser { return this.expr({ type: "block", stmts, expr }, pos); } else { this.report("expected ';' or '}'"); - return this.expr({ type: "error" }, pos); + return this.expr({ type: "error" }, this.pos()); } } }