summaryrefslogtreecommitdiffstats
path: root/tests/008
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-08-11 22:05:14 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-08-11 22:05:14 -0700
commitffc21e3b5ea6218fb3a13d25f73261f28aef0479 (patch)
tree78b51317052566797c4a8e4f61b425cdc66dcd59 /tests/008
parent14ef1bd3f5a544a197c5404ca8cde6f8fa216c42 (diff)
downloadtxr-ffc21e3b5ea6218fb3a13d25f73261f28aef0479.tar.gz
txr-ffc21e3b5ea6218fb3a13d25f73261f28aef0479.tar.bz2
txr-ffc21e3b5ea6218fb3a13d25f73261f28aef0479.zip
parser: @(mdo) must not be subject to expand-meta.
* parser.y (elem): When the elem is a list, if it starts with mdo, then we evaluate it immediately and substitute (do) as the semantic value. We no longer not allow mdo to precipitate into match_expand_elem, where expand_meta will be unleashed on it. Doing so causes the bug that expessions like @1, denoting the form (sys:var 1), are rewritten to (sys:expr 1), which op syntax. So two bugs are fixed: the incorrect treatment of meta-syntax, and the neglect to perform mdo in nested contexts. (check_parse_time_action): We need not handle mdo here any more; it will never make it into this function. Only actions done in the main clause list belong here, not parse time actions done at any nesting level. * tests/008/mdo.txr: New file. * y.tab.c.shipped: Updated.
Diffstat (limited to 'tests/008')
-rw-r--r--tests/008/mdo.txr7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/008/mdo.txr b/tests/008/mdo.txr
new file mode 100644
index 00000000..dbc8b50c
--- /dev/null
+++ b/tests/008/mdo.txr
@@ -0,0 +1,7 @@
+@(mdo (defvar a))
+@(mdo (push 1 a))
+@(define foo)
+@ (mdo (push 2 a))
+@(end)
+@(foo)
+@(do (assert (equal a '(2 1))))