Пример #1
0
 public object Visit(Stmt.Var stmt)
 {
     Declare(stmt.name);
     if (stmt.initializer != null)
     {
         Resolve(stmt.initializer);
     }
     Define(stmt.name);
     return(null);
 }
Пример #2
0
        public object Visit(Stmt.Var _var)
        {
            object value = null;

            if (_var.initializer != null)
            {
                value = Evaluate(_var.initializer);
            }

            m_Enviroment.Define(_var.name.lexeme, value);
            return(null);
        }