diff options
| author | Mel <mel@rnrd.eu> | 2025-07-22 05:16:06 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2025-07-22 05:16:06 +0200 |
| commit | 52a6c142d7c85520b09e300283154b7ec9c6b9f3 (patch) | |
| tree | 999da0d1f036731ffcbf6274d4961a19cf697ddd /boot/tests/parse | |
| parent | a37262c61fd577e0e620e024007e0139929e3926 (diff) | |
| download | catskill-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.cskt | 20 |
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)) +)) |
