about summary refs log tree commit diff
path: root/boot/tests/parse
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2026-05-28 01:06:31 +0200
committerMel <mel@rnrd.eu>2026-05-28 01:06:31 +0200
commit351433f3f7dc3f1051a9875402502663fe8a0be8 (patch)
tree95ddeb3cdc87746da195c558c20260bd92d7a865 /boot/tests/parse
parent7dda10e54ebf303509cb7dcf7a3c60ec2de399d2 (diff)
downloadcatskill-351433f3f7dc3f1051a9875402502663fe8a0be8.tar.zst
catskill-351433f3f7dc3f1051a9875402502663fe8a0be8.zip
Allow no arguments for calls and constructs
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/tests/parse')
-rw-r--r--boot/tests/parse/empty_argument_groups.cskt22
1 files changed, 22 insertions, 0 deletions
diff --git a/boot/tests/parse/empty_argument_groups.cskt b/boot/tests/parse/empty_argument_groups.cskt
new file mode 100644
index 0000000..d5ac18a
--- /dev/null
+++ b/boot/tests/parse/empty_argument_groups.cskt
@@ -0,0 +1,22 @@
+calls and constructs should accept empty argument lists,
+but also not fail on any other argument passing styles.
+
+<<<
+
+greet()
+make{}
+greet(1)
+greet(1, 2)
+greet(x = 5)
+make{x = 1, y = 2}
+greet(1, x = 5)
+
+>>>
+
+(expr (call (expr (name greet))))
+(expr (construct (expr (name make))))
+(expr (call (expr (name greet)) (arg (expr 1))))
+(expr (call (expr (name greet)) (arg (expr 1)) (arg (expr 2))))
+(expr (call (expr (name greet)) (named arg 'x' (expr 5))))
+(expr (construct (expr (name make)) (named arg 'x' (expr 1)) (named arg 'y' (expr 2))))
+(expr (call (expr (name greet)) (arg (expr 1)) (named arg 'x' (expr 5))))