- Tokenizer: add MATCH keyword; remove PEEK - Parser: parse (MVP: literal patterns, block/expr arms); build PeekExpr AST for existing lowering - Tests/Smokes: update peek samples to match; skip one return-value case pending richer arm parsing Notes: MIR unchanged; existing PeekExpr lowerers continue to work.
12 lines
211 B
Plaintext
12 lines
211 B
Plaintext
static box Main {
|
|
main(args) {
|
|
local d = "1"
|
|
local dv = match d {
|
|
"0" => { print("found zero") 0 }
|
|
"1" => { print("found one") 1 }
|
|
_ => { print("other") 0 }
|
|
}
|
|
return dv
|
|
}
|
|
}
|