feat: match 表达式 (P1 #8 收官)

- lexer: TOK_MATCH, TOK_MATCH_ARROW, TOK_UNDERSCORE
- parser: parse_match_stmt() desugar → let+if-else链
- 零 sema/codegen 改动
- 4个集成测试: enum/int literal/wildcard match

P1 全部完成: type alias + enum + array + impl + match
This commit is contained in:
2026-06-05 14:41:52 +08:00
parent 9f6e695ba8
commit a15cd9d56e
8 changed files with 143 additions and 6 deletions
+10
View File
@@ -0,0 +1,10 @@
fn main() -> i64 {
let x = 5;
match x {
1 => { print_i64(10); }
2 => { print_i64(20); }
5 => { print_i64(50); }
_ => { print_i64(99); }
}
return 0;
}