From ab91d71170b29f363899a058ed16d96717a01c85 Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Wed, 5 Jun 2024 20:02:47 -0400 Subject: [PATCH] Support [] interpolation in new parser --- src/parser2.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/parser2.ts b/src/parser2.ts index 513f563..92c7233 100644 --- a/src/parser2.ts +++ b/src/parser2.ts @@ -147,6 +147,14 @@ class Parser { wip.addWordPiece({ bare: chars }, pos); break; + case "[": { + this.advance(); + const script = this.parseScript(); + wip.addWordPiece({ script }); + this.expect("]"); + break; + } + case "whitespace": wip.finishWord(); break; @@ -162,7 +170,6 @@ class Parser { case "{": case "}": - case "[": case "quote": case "backslash": case "comment":