From 52a6c142d7c85520b09e300283154b7ec9c6b9f3 Mon Sep 17 00:00:00 2001 From: Mel Date: Tue, 22 Jul 2025 05:16:06 +0200 Subject: Remove ambiguity from construct expressions and if/for/while blocks Signed-off-by: Mel --- boot/tests/parse/conditionals.cskt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 boot/tests/parse/conditionals.cskt (limited to 'boot/tests/parse/conditionals.cskt') diff --git a/boot/tests/parse/conditionals.cskt b/boot/tests/parse/conditionals.cskt new file mode 100644 index 0000000..bf314fa --- /dev/null +++ b/boot/tests/parse/conditionals.cskt @@ -0,0 +1,20 @@ + +<<< + +if x == 5 { + return 1 +} else if x == 4 { + return 2 +} else { + return 0 +} + +>>> + +(conditional (when (expr (binary == (expr (name x)) (expr 5)))) (block + (return (expr 1)) +) (when (expr (binary == (expr (name x)) (expr 4)))) (block + (return (expr 2)) +) (always) (block + (return (expr 0)) +)) -- cgit 1.4.1