feat: 复合赋值 += -= *= /= + CHANGELOG 更新

- lexer: 4 个复合赋值 Token (解析时优先于单字符)
- parser: desugar x+=expr → x=x+expr(零 sema/codegen 改动)
- 新增集成测试 09_compound_assign.l (15 12 24 6)
- CHANGELOG 新增 v0.2.0 条目
This commit is contained in:
2026-06-05 02:40:05 +08:00
parent 9e41b09318
commit d5a94d45cb
6 changed files with 71 additions and 2 deletions
+12
View File
@@ -0,0 +1,12 @@
fn main() -> i64 {
let mut x: i64 = 10;
x += 5;
print_i64(x); // 15
x -= 3;
print_i64(x); // 12
x *= 2;
print_i64(x); // 24
x /= 4;
print_i64(x); // 6
return 0;
}