Added cart support into AST

This commit is contained in:
Erin 2021-07-27 11:51:05 +02:00 committed by ondra05
parent 003d800d6e
commit 1714629492
2 changed files with 6 additions and 0 deletions

View file

@ -102,6 +102,11 @@ pub enum ExprKind {
},
Not(Box<Expr>),
Literal(Value),
Cart(Vec<(Expr, Expr)>),
Index {
cart: Box<Expr>,
index: Box<Expr>,
},
Variable(String),
}

View file

@ -195,6 +195,7 @@ impl ExecEnv {
}
Not(expr) => Bool(!self.eval_expr(&expr)?.into_bool()),
Literal(value) => value.clone(),
Cart(_) | Index { .. } => todo!("cart support"),
// TODO: not too happy with constructing an artificial
// Iden here.