feat: 新增对象字面量和属性访问表达式
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user