Files
hakorune/apps/tests/peek_expr_block.nyash
Selfhosting Dev a6f28a8980 parser(match): introduce expression (replaces syntax); keep AST PeekExpr lowering
- 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.
2025-09-19 07:58:01 +09:00

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
}
}