From cdf4c5a3088067b15b149526133eea420077b03a Mon Sep 17 00:00:00 2001 From: Erin Date: Tue, 12 Oct 2021 22:22:33 +0200 Subject: [PATCH] improvement --- ablescript/src/interpret.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ablescript/src/interpret.rs b/ablescript/src/interpret.rs index f9b10e72..d7784642 100644 --- a/ablescript/src/interpret.rs +++ b/ablescript/src/interpret.rs @@ -245,9 +245,14 @@ impl ExecEnv { } }, StmtKind::Assign { assignable, value } => { - // TODO: Assigning to carts let value = self.eval_expr(value)?; - self.get_var_mut(&assignable.ident)?.value.replace(value); + match &assignable.kind { + crate::ast::AssignableKind::Variable => { + &self.get_var_mut(&assignable.ident)?.value + } + crate::ast::AssignableKind::Cart { indices } => todo!("assigning to carts"), + } + .replace(value); } StmtKind::Break => { return Ok(HaltStatus::Break(stmt.span.clone()));