Esempio n. 1
0
 public Void Visit_IfStmt(IfStmt stmt)
 {
     Resolve(stmt.condition);
     Resolve(stmt.thenBranch);
     if (stmt.elseBranch != null)
     {
         Resolve(stmt.elseBranch);
     }
     return(null);
 }
Esempio n. 2
0
        public object VisitIfStmt(IfStmt stmt)
        {
            Resolve(stmt.Condition);
            Resolve(stmt.ThenBranch);
            if (stmt.ElseBranch != null)
            {
                Resolve(stmt.ElseBranch);
            }

            return(null);
        }
Esempio n. 3
0
 public string Visit_IfStmt(IfStmt stmt)
 {
     if (stmt.elseBranch != null)
     {
         return(Parenthesize("If", stmt.thenBranch, stmt.elseBranch));
     }
     else
     {
         return(Parenthesize("If", stmt.thenBranch));
     }
 }
Esempio n. 4
0
 public Void Visit_IfStmt(IfStmt stmt)
 {
     if (IsTruthy(Evaluate(stmt.condition)))
     {
         Execute(stmt.thenBranch);
     }
     else if (stmt.elseBranch != null)
     {
         Execute(stmt.elseBranch);
     }
     return(null);
 }
Esempio n. 5
0
        public object VisitIfStmt(IfStmt stmt)
        {
            if (IsTruthy(Evaluate(stmt.Condition)))
            {
                Execute(stmt.ThenBranch);
            }
            else if (stmt.ElseBranch != null)
            {
                Execute(stmt.ElseBranch);
            }

            return(null);
        }