summaryrefslogtreecommitdiff
path: root/tnslc/parse
diff options
context:
space:
mode:
Diffstat (limited to 'tnslc/parse')
-rw-r--r--tnslc/parse/ast.tnsl19
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)