Exemplo n.º 1
0
 public object visitIfStmt(Stmt.If stmt)
 {
     resolve(stmt.condition);
     resolve(stmt.thenBranch);
     if (stmt.elseBranch != null)
     {
         resolve(stmt.elseBranch);
     }
     return(null);
 }
Exemplo 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);
 }