aboutsummaryrefslogtreecommitdiff
path: root/src/interpreter.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/interpreter.rs')
-rw-r--r--src/interpreter.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/interpreter.rs b/src/interpreter.rs
index b548d9e..adf6755 100644
--- a/src/interpreter.rs
+++ b/src/interpreter.rs
@@ -69,6 +69,11 @@ impl AstVisitor<Value> for AstInterpreter {
self.memory.remove(binding);
}
+ Stmt::While { condition, body } => {
+ while self.visit_expr(condition) == Value::Bool(true) {
+ self.interpret(body);
+ }
+ }
Stmt::Return { value } => todo!(),
};