diff --git a/src/parser2.ts b/src/parser2.ts index 3fc959c..47f9e9f 100644 --- a/src/parser2.ts +++ b/src/parser2.ts @@ -234,7 +234,7 @@ class Parser { case "backslash": { this.advance(); - this.parseBackslashEscape(wip, "bare"); + this.parseBackslashEscape(wip, pos, "bare"); break; } @@ -280,7 +280,7 @@ class Parser { case "backslash": { this.advance(); - this.parseBackslashEscape(wip, "quote"); + this.parseBackslashEscape(wip, pos, "quote"); break; } @@ -298,8 +298,12 @@ class Parser { } } - parseBackslashEscape(wip: WipScript, wordType: "bare" | "quote") { - const [type, chars, pos] = this.next; + parseBackslashEscape( + wip: WipScript, + pos: number, + wordType: "bare" | "quote" + ) { + const [type, chars] = this.next; switch (type) { case "newline": if (wordType == "bare") {