diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2022-07-05 23:51:09 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2022-07-05 23:51:09 -0400 |
commit | 37d1e9fa02b27d1a6c56b4c95d31e6d2b9eab9ee (patch) | |
tree | fdc41f331f35b1b0179a5e589a7c70855a61c586 /tnslc/ast | |
parent | 57ad7f1f8261374349af75cc2f48261f790abdd4 (diff) |
[TNSLC] Fix issue with text literals
Diffstat (limited to 'tnslc/ast')
-rw-r--r-- | tnslc/ast/list.tnsl | 4 | ||||
-rw-r--r-- | tnslc/ast/value.tnsl | 14 |
2 files changed, 15 insertions, 3 deletions
diff --git a/tnslc/ast/list.tnsl b/tnslc/ast/list.tnsl index b9d8080..da6a682 100644 --- a/tnslc/ast/list.tnsl +++ b/tnslc/ast/list.tnsl @@ -29,7 +29,7 @@ /; loop (cur` < len tok`) [cur` = cur` + 1] ;Node stmt = tree_statement(tok, cur) - ;append(out, stmt) + ;out.append(stmt) ;Token tmp = tok`{cur`} /; if (string_equate(tmp.data, "]") || string_equate(tmp.data, ")")) @@ -58,7 +58,7 @@ ;Node tmp /; if (type_then_name(tok, cur)) ;tmp = tree_type(tok, cur) - ;append(out, tmp) + ;out.append(tmp) ;/ ;tmp = tree_value(tok, cur) diff --git a/tnslc/ast/value.tnsl b/tnslc/ast/value.tnsl index d90c00a..d4cef56 100644 --- a/tnslc/ast/value.tnsl +++ b/tnslc/ast/value.tnsl @@ -14,9 +14,21 @@ EXPRESS OR IMPLIED #/ -/; tree_type [Node] +/; tree_type (~{}Token tok, ~int cur) [Node] ;Token type_tok = {NODE_TYPE.TYPE, 0, 0, ~CNULL} ;{}Node type_sub = {} + + # Pre type keyword checks + /; loop (tok`{cur`}.token_type !== TOKEN_TYPE.DEFWORD && tok`{cur`}.token_type !== TOKEN_TYPE.KEYTYPE) + /; if (tok`{cur`}.token_type == TOKEN_TYPE.KEYWORD) + + ;/ + ;/ + + /; + + ;/ + ;return {type_tok, ~type_sub} ;/ |