about summary refs log tree commit diff
path: root/boot/tests/parse/loops.cskt
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2026-05-28 00:29:53 +0200
committerMel <mel@rnrd.eu>2026-05-28 00:29:53 +0200
commit7db79f43b431b94d525308699a87a3daeff31d92 (patch)
tree7b6a6d10dc064c5ae54791dc1b65c8d42233b97a /boot/tests/parse/loops.cskt
parentec2029cba68b1d25e1e1119d37318c1b0c581a83 (diff)
downloadcatskill-7db79f43b431b94d525308699a87a3daeff31d92.tar.zst
catskill-7db79f43b431b94d525308699a87a3daeff31d92.zip
Split endless and while loops into `loop` and `while`
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/tests/parse/loops.cskt')
-rw-r--r--boot/tests/parse/loops.cskt9
1 files changed, 9 insertions, 0 deletions
diff --git a/boot/tests/parse/loops.cskt b/boot/tests/parse/loops.cskt
index 45b1040..8e5feba 100644
--- a/boot/tests/parse/loops.cskt
+++ b/boot/tests/parse/loops.cskt
@@ -16,6 +16,11 @@ while y < 10 {
   y++
 }
 
+loop {
+  print(0)
+  break
+}
+
 >>>
 
 (loop for-each (declaration i (type name uint) (initializer (expr (binary .. (expr 0) (expr 10))))) (block
@@ -28,4 +33,8 @@ while y < 10 {
 (loop while (condition (expr (binary < (expr (name y)) (expr 10)))) (block
 	(expr (call (expr (name print)) (arg (expr (name y)))))
 	(expr (increment/decrement ++ postfix (expr (name y))))
+))
+(loop endless (block
+	(expr (call (expr (name print)) (arg (expr 0))))
+	(break)
 ))
\ No newline at end of file