about summary refs log tree commit diff
path: root/users/tazjin/rlox/src/interpreter.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-12-22T14·44+0100
committertazjin <mail@tazj.in>2020-12-22T20·18+0000
commit0f9a7b3f86f56162cf1a694d98d82e4937d44a52 (patch)
treee0e092c0fcf9e34b1eddf39bf08423e5fe6e3e91 /users/tazjin/rlox/src/interpreter.rs
parent5010b7971806d30de0987d8e7706ca24a96fbef5 (diff)
feat(tazjin/rlox): Parse variable assignment & access r/2027
Change-Id: I9894d76716d739e85a4757d9e658f884228e7f52
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2290
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin/rlox/src/interpreter.rs')
-rw-r--r--users/tazjin/rlox/src/interpreter.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/users/tazjin/rlox/src/interpreter.rs b/users/tazjin/rlox/src/interpreter.rs
index 5e43e075b03c..99df23d725dd 100644
--- a/users/tazjin/rlox/src/interpreter.rs
+++ b/users/tazjin/rlox/src/interpreter.rs
@@ -101,6 +101,7 @@ fn eval<'a>(expr: &Expr<'a>) -> Result<Literal, Error> {
         Expr::Grouping(grouping) => eval(&*grouping.0),
         Expr::Unary(unary) => eval_unary(unary),
         Expr::Binary(binary) => eval_binary(binary),
+        Expr::Variable(_) => unimplemented!(),
     }
 }
 
@@ -122,6 +123,7 @@ fn run_program<'a>(program: &Program<'a>) -> Result<(), Error> {
     for decl in program {
         match decl {
             Declaration::Stmt(stmt) => run_stmt(stmt)?,
+            Declaration::Var(_var) => unimplemented!(),
         }
     }