From bc69e7efa4777f8ebed37d032554b3f3df888744 Mon Sep 17 00:00:00 2001 From: Linus Lee Date: Thu, 24 Sep 2020 09:07:24 -0400 Subject: [PATCH] Add ability to use escaped strings, at least for quotes --- static/js/lang.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/lang.js b/static/js/lang.js index 6ecc102..954b44d 100644 --- a/static/js/lang.js +++ b/static/js/lang.js @@ -89,7 +89,9 @@ class Wordifier { let acc = ''; acc += this.reader.readUntil(c => c == endChar); while (acc.endsWith('\\') || !this.reader.hasNext()) { - acc += this.reader.readUntil(c => c != endChar); + acc = acc.substr(0, acc.length - 1); + this.reader.next(); // endChar + acc += endChar + this.reader.readUntil(c => c == endChar); } this.reader.next(); // throw away closing char this.tokens.push('"' + acc);