Esempio n. 1
0
 public object visitIfStmt(Stmt.If stmt)
 {
     resolve(stmt.condition);
     resolve(stmt.thenBranch);
     if (stmt.elseBranch != null)
     {
         resolve(stmt.elseBranch);
     }
     return(null);
 }
Esempio n. 2
0
 public object visitIfStmt(Stmt.If stmt)
 {
     if (isTruthy(evaluate(stmt.condition)))
     {
         execute(stmt.thenBranch);
     }
     else if (stmt.elseBranch != null)
     {
         execute(stmt.elseBranch);
     }
     return(null);
 }