about summary refs log tree commit diff
path: root/boot/tests/parse
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2025-07-22 05:16:06 +0200
committerMel <mel@rnrd.eu>2025-07-22 05:16:06 +0200
commit52a6c142d7c85520b09e300283154b7ec9c6b9f3 (patch)
tree999da0d1f036731ffcbf6274d4961a19cf697ddd /boot/tests/parse
parenta37262c61fd577e0e620e024007e0139929e3926 (diff)
downloadcatskill-52a6c142d7c85520b09e300283154b7ec9c6b9f3.tar.zst
catskill-52a6c142d7c85520b09e300283154b7ec9c6b9f3.zip
Remove ambiguity from construct expressions and if/for/while blocks
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/tests/parse')
-rw-r--r--boot/tests/parse/conditionals.cskt20
1 files changed, 20 insertions, 0 deletions
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))
+))