summaryrefslogtreecommitdiffstats
path: root/tests/012/op.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-07-19 07:26:56 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-07-19 07:26:56 -0700
commited7185e3fd6307d9c4bc97be606a08bd9ed3502f (patch)
tree297c49b83b401c7415288d1adf16a17360203d56 /tests/012/op.tl
parent39b94456cc8e70407641335184fbd8d46c2eadba (diff)
downloadtxr-ed7185e3fd6307d9c4bc97be606a08bd9ed3502f.tar.gz
txr-ed7185e3fd6307d9c4bc97be606a08bd9ed3502f.tar.bz2
txr-ed7185e3fd6307d9c4bc97be606a08bd9ed3502f.zip
op: set nested flag in correct context.
* stdlib/op.tl (sys:op-meta-p): Return an extended Boolean value: a true result is an integer indicating the depth of the variable. For instance @1 is depth 0, @@1 is depth 1 and so on. (sys:find-parent): New function. (sys:op-alpha-rename): When processing a nested meta, do not set the nested flag in the immediate parent. Use find-parent to go up to the correct level to which the meta belongs and set the flag there. * tests/012/op.tl: New test cases which depend on this.
Diffstat (limited to 'tests/012/op.tl')
-rw-r--r--tests/012/op.tl11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/012/op.tl b/tests/012/op.tl
index 0cdc3e7b..5a789219 100644
--- a/tests/012/op.tl
+++ b/tests/012/op.tl
@@ -82,3 +82,14 @@
[[(do op list @1)] 2] :error
[[(do op list @1) 1] 2] (2 1)
[[(do op list @@1 @1) 1] 2] (1 2))
+
+(mtest
+ [[[[(do do do op list @1) 1] 2] 3] 4] (4 1 2 3)
+ [[[[(do do do op list @@1) 1] 2] 3] 4] (3 1 2 4)
+ [[[[(do do do op list @@@1) 1] 2] 3] 4] (2 1 3 4)
+ [[[[(do do do op list @@@@1) 1] 2] 3] 4] (1 2 3 4))
+
+(mtest
+ [[[[(do do do op list) 1] 2] 3] 4] (1 2 3 4)
+ [[[[(do do do op list @1 @@1 @@@1 @@@@1) 1] 2] 3] 4] (4 3 2 1)
+ [[[[(do do do op list @@@@1 @@@1 @@1 @1) 1] 2] 3] 4] (1 2 3 4))