public object VisitVarStmt(Stmt.Var stmt) { Declare(stmt.Name); if (stmt.Initializer != null) { Resolve(stmt.Initializer); } Define(stmt.Name); return(null); }
public object VisitVarStmt(Stmt.Var stmt) { object value = null; if (stmt.Initializer != null) { value = Evaluate(stmt.Initializer); } _environment.Define(stmt.Name.Lexeme, value); return(null); }