From 2a428e84150430c7ddfcde2f0aec3d5eac7d7158 Mon Sep 17 00:00:00 2001 From: Alex Bethel Date: Fri, 11 Jun 2021 10:05:48 -0500 Subject: [PATCH] Re-enable assignment semantics --- src/interpret.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/interpret.rs b/src/interpret.rs index 9bdfcb0..3ae0e9d 100644 --- a/src/interpret.rs +++ b/src/interpret.rs @@ -203,7 +203,6 @@ impl ExecEnv { self.decl_var(&iden.iden, init); } - StmtKind::Assign { .. } => todo!(), StmtKind::Functio { iden: _, args: _, @@ -270,10 +269,9 @@ impl ExecEnv { HaltStatus::Hopback(_) => continue, } }, - // This is missing as well. ~~Alex - // StmtKind::VarAssignment { iden, value } => { - // self.get_var_mut(&iden.0)?.value = self.eval_expr(value)?; - // } + StmtKind::Assign { iden, value } => { + self.get_var_mut(&iden)?.value = self.eval_expr(value)?; + } StmtKind::Break => { return Ok(HaltStatus::Break(stmt.span.clone())); }