Functions 10
This commit is contained in:
parent
7f4946f1e9
commit
e9e3c992cb
4 changed files with 20 additions and 2 deletions
|
|
@ -106,7 +106,7 @@ class Interpreter : Stmt.Visitor!void, Expr.Visitor!TValue {
|
|||
evaluate(stmt.expression);
|
||||
}
|
||||
void visit(Stmt.Function stmt){
|
||||
LoxFunction func = new LoxFunction(stmt);
|
||||
LoxFunction func = new LoxFunction(stmt, environment);
|
||||
environment.define(stmt.name.lexeme, TValue.cal(func));
|
||||
}
|
||||
void visit(Stmt.If stmt){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue