forked from AbleScript/ablescript
Added cart support into AST
This commit is contained in:
parent
003d800d6e
commit
1714629492
|
@ -102,6 +102,11 @@ pub enum ExprKind {
|
||||||
},
|
},
|
||||||
Not(Box<Expr>),
|
Not(Box<Expr>),
|
||||||
Literal(Value),
|
Literal(Value),
|
||||||
|
Cart(Vec<(Expr, Expr)>),
|
||||||
|
Index {
|
||||||
|
cart: Box<Expr>,
|
||||||
|
index: Box<Expr>,
|
||||||
|
},
|
||||||
Variable(String),
|
Variable(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,6 +195,7 @@ impl ExecEnv {
|
||||||
}
|
}
|
||||||
Not(expr) => Bool(!self.eval_expr(&expr)?.into_bool()),
|
Not(expr) => Bool(!self.eval_expr(&expr)?.into_bool()),
|
||||||
Literal(value) => value.clone(),
|
Literal(value) => value.clone(),
|
||||||
|
Cart(_) | Index { .. } => todo!("cart support"),
|
||||||
|
|
||||||
// TODO: not too happy with constructing an artificial
|
// TODO: not too happy with constructing an artificial
|
||||||
// Iden here.
|
// Iden here.
|
||||||
|
|
Loading…
Reference in a new issue