From 351433f3f7dc3f1051a9875402502663fe8a0be8 Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 28 May 2026 01:06:31 +0200 Subject: Allow no arguments for calls and constructs Signed-off-by: Mel --- boot/tests/parse/empty_argument_groups.cskt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 boot/tests/parse/empty_argument_groups.cskt (limited to 'boot/tests/parse/empty_argument_groups.cskt') 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)))) -- cgit 1.4.1