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:
@@ -0,0 +1,11 @@
|
||||
enum Color { Red, Green, Blue }
|
||||
|
||||
fn main() -> i64 {
|
||||
let c = Color::Red;
|
||||
match c {
|
||||
Color::Red => { print_i64(100); }
|
||||
Color::Green => { print_i64(200); }
|
||||
_ => { print_i64(0); }
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user