summaryrefslogtreecommitdiff
path: root/tnslc/parse
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-07-05 23:51:09 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-07-05 23:51:09 -0400
commit37d1e9fa02b27d1a6c56b4c95d31e6d2b9eab9ee (patch)
treefdc41f331f35b1b0179a5e589a7c70855a61c586 /tnslc/parse
parent57ad7f1f8261374349af75cc2f48261f790abdd4 (diff)
[TNSLC] Fix issue with text literals
Diffstat (limited to 'tnslc/parse')
-rw-r--r--tnslc/parse/token.tnsl7
-rw-r--r--tnslc/parse/tokenizer.tnsl2
2 files changed, 8 insertions, 1 deletions
diff --git a/tnslc/parse/token.tnsl b/tnslc/parse/token.tnsl
index e7d64e7..bf4d470 100644
--- a/tnslc/parse/token.tnsl
+++ b/tnslc/parse/token.tnsl
@@ -250,6 +250,13 @@
;return true
;/
+/; is_text_literal(~{}charp dat) [bool]
+ /; if (len dat` < 1)
+ ;return false
+ ;/
+ ;return dat`{0} == '"' || dat`{0} == '\''
+;/
+
/; string_closed ({}charp dat, charp c) [bool]
/; if (len dat < 2)
;return false
diff --git a/tnslc/parse/tokenizer.tnsl b/tnslc/parse/tokenizer.tnsl
index 7a1f085..9021369 100644
--- a/tnslc/parse/tokenizer.tnsl
+++ b/tnslc/parse/tokenizer.tnsl
@@ -91,7 +91,7 @@
;/
;/
- /; if ( !is_whitespace(i) && !comment )
+ /; if ( (!is_whitespace(i) || is_text_literal(~tdat)) && !comment )
;tdat.append(i)
;; else if (i == '\n')
;line++