Exemple #1
0
 public object visitVarStmt(Stmt.Var stmt)
 {
     declare(stmt.Name);
     if (stmt.Initilizer != null)
     {
         resolve(stmt.Initilizer);
     }
     define(stmt.Name);
     return(null);
 }
        public object visitVarStmt(Stmt.Var stmt)
        {
            object value = null;

            if (stmt.Initilizer != null)
            {
                value = evaluate(stmt.Initilizer);
            }
            env.define(stmt.Name.Lexeme, value);
            return(null);
        }