public Void VisitVarStmt(Stmt.Var stmt) { Declare(stmt.name); if (stmt.initializer != null) { Resolve(stmt.initializer); } Define(stmt.name); return(null); }
public Void VisitVarStmt(Stmt.Var stmt) { object value = null; if (stmt.initializer != null) { value = Evaluate(stmt.initializer); } environment.Define(stmt.name.Lexeme, value); return(null); }