aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/craftinginterpreters/lox/Interpreter.java
diff options
context:
space:
mode:
authorGravatar Tom Willemse2021-04-18 17:25:03 -0700
committerGravatar Tom Willemse2021-04-18 17:25:03 -0700
commit21a58ffb202531d6ac74702648ad1c168f279a6d (patch)
treeed7f1b3e1b38242602ba08207d033dd485865d77 /src/com/craftinginterpreters/lox/Interpreter.java
parent591caeb216128675ce6b8ddafccb09df7f522145 (diff)
downloadcrafting-interpreters-21a58ffb202531d6ac74702648ad1c168f279a6d.tar.gz
crafting-interpreters-21a58ffb202531d6ac74702648ad1c168f279a6d.zip
12.5 This
Diffstat (limited to 'src/com/craftinginterpreters/lox/Interpreter.java')
-rw-r--r--src/com/craftinginterpreters/lox/Interpreter.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/craftinginterpreters/lox/Interpreter.java b/src/com/craftinginterpreters/lox/Interpreter.java
index fd13455..ac42369 100644
--- a/src/com/craftinginterpreters/lox/Interpreter.java
+++ b/src/com/craftinginterpreters/lox/Interpreter.java
@@ -63,6 +63,11 @@ class Interpreter implements Expr.Visitor<Object>, Stmt.Visitor<Void> {
}
@Override
+ public Object visitThisExpr(Expr.This expr) {
+ return lookUpVariable(expr.keyword, expr);
+ }
+
+ @Override
public Object visitUnaryExpr(Expr.Unary expr) {
Object right = evaluate(expr.right);