From e847a76c6d746ba88421cbdc8978ea4ba3bb951a Mon Sep 17 00:00:00 2001 From: Erin Date: Tue, 27 Jul 2021 11:51:05 +0200 Subject: [PATCH] Added cart support into AST --- src/ast.rs | 5 +++++ src/interpret.rs | 1 + 2 files changed, 6 insertions(+) diff --git a/src/ast.rs b/src/ast.rs index f84c47af..3fede855 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -102,6 +102,11 @@ pub enum ExprKind { }, Not(Box), Literal(Value), + Cart(Vec<(Expr, Expr)>), + Index { + cart: Box, + index: Box, + }, Variable(String), } diff --git a/src/interpret.rs b/src/interpret.rs index 73180564..888b314e 100644 --- a/src/interpret.rs +++ b/src/interpret.rs @@ -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.