summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-11-06 23:07:35 -0800
committerOri Bernstein <ori@eigenstate.org>2015-11-06 23:07:35 -0800
commitc1c1c42c36717dea8dbca9e1bed8d794144ec6f1 (patch)
treeb19db09246b86fdc236d2f9771aea5f6294c9c53 /test
parenteac5baa8515b5e6fe46ecf609d2cac94ffed5dc6 (diff)
downloadmc-c1c1c42c36717dea8dbca9e1bed8d794144ec6f1.tar.gz
Add support for '$' operator.
Diffstat (limited to 'test')
-rw-r--r--test/idxlen.myr7
-rw-r--r--test/tests1
2 files changed, 8 insertions, 0 deletions
diff --git a/test/idxlen.myr b/test/idxlen.myr
new file mode 100644
index 0000000..842a2a2
--- /dev/null
+++ b/test/idxlen.myr
@@ -0,0 +1,7 @@
+use std
+
+const main = {
+ var a = [1,2,3,4]
+ std.put("{} ", a[$-1])
+ std.put("{}\n", a[$-2:])
+}
diff --git a/test/tests b/test/tests
index 9fb9246..819fcb3 100644
--- a/test/tests
+++ b/test/tests
@@ -58,6 +58,7 @@ B voidcall E 12
B callbig E 42
B nestfn E 42
B foldidx P 123,456
+B idxlen P "4 [3, 4]"
B closure P 111555333666
B fncast P ok
B loop P 0123401236789