From 1714629492dd137ece2b215f365a8e6e229da770 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 f84c47a..3fede85 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 7318056..888b314 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.