diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-10-06 07:07:08 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-10-06 07:07:08 -0400 |
commit | 0c9a53567cf6e43c89446d1809c89223374f048a (patch) | |
tree | 0ad7935fddb71dd019cc738a06802c63a81c1a26 /tnslc/parse | |
parent | 7824a4709a306d48893f88ec586b6f50bfdde875 (diff) |
[tnslc] escape from inside parens
Diffstat (limited to 'tnslc/parse')
-rw-r--r-- | tnslc/parse/ast.tnsl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tnslc/parse/ast.tnsl b/tnslc/parse/ast.tnsl index d70d755..71185f4 100644 --- a/tnslc/parse/ast.tnsl +++ b/tnslc/parse/ast.tnsl @@ -1336,7 +1336,26 @@ struct Node { ;/ /; _mhf_escape (~utils.File fin, ~Node mod, ~Token first, ~Node cur) + int deep = 0 + /; loop (bool run = true; run == true && first`._type !== TTYPE_ERR) + /; if (first`.eq(")\0") == true) + /; if (deep > 0) + deep = deep - 1 + ;; else if (cur`.eq("(\0") == false) + cur = cur`.parent + ;/ + + /; if (cur`.eq("(\0") == false) + run = false; + ;/ + ;; else if (first`.eq("(\0") == true) + deep = deep + 1 + ;/ + Token tmp = produce_next_token(fin, first`) + first`.end() + first` = tmp + ;/ ;/ /; _mhf_finish_value (~utils.File fin, ~Node mod, ~Token first, ~Node cur) |