doc: sample: add match-statement syntax and ir samples

This commit is contained in:
2025-11-04 10:38:34 +00:00
parent 02b21126b5
commit 8bb734d882
2 changed files with 65 additions and 0 deletions

18
doc/sample/Match.im Normal file
View File

@@ -0,0 +1,18 @@
age = 65.
yz = 32.
p3 = 3.
q = match yz in
1 => do
wq = 32.
wq * 2
end,
2 => age / 12,
p3 => age / 365,
5 | 6 => age = 32,
10..=15 => age = 64,
_ => 0
end