diff options
Diffstat (limited to 'tnslc/parse')
-rw-r--r-- | tnslc/parse/token.tnsl | 7 | ||||
-rw-r--r-- | tnslc/parse/tokenizer.tnsl | 2 |
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++ |