From d22099323675f3a3dff8e3e4c8ac8dcf55861f6a Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Sat, 8 Jun 2024 14:03:31 -0400 Subject: [PATCH] All original parser tests pass --- src/parser2.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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") {