Exemple #1
0
        public string VisitVarStmt(Stmt.VarStmt stmt)
        {
            if (stmt.Initializer == null)
            {
                return(Parenthesize2("var", stmt.Name));
            }

            return(Parenthesize2("var", stmt.Name, "=", stmt.Initializer));
        }
Exemple #2
0
 public object VisitVarStmt(Stmt.VarStmt stmt)
 {
     Declare(stmt.Name);
     if (stmt.Initializer != null)
     {
         Resolve(stmt.Initializer);
     }
     Define(stmt.Name);
     return(null);
 }