feat: 新增对象字面量和属性访问表达式

This commit is contained in:
0264408
2026-02-10 17:13:40 +08:00
parent 5c5ca8600a
commit 521c7006d9
11 changed files with 188 additions and 66 deletions
+18
View File
@@ -14,6 +14,24 @@ pub enum Expr {
value: Box<Expr>,
},
/// 属性访问表达式:object.name
Get {
object: Box<Expr>,
name: String,
},
/// 属性赋值表达式:object.name = value
Set {
object: Box<Expr>,
name: String,
value: Box<Expr>,
},
/// 对象字面量:{ key: value, ... }
ObjectLiteral {
properties: Vec<(String, Expr)>,
},
/// 一元运算:!expr / -expr
Unary {
op: UnaryOp,