Beispiel #1
0
 public object visitIfStmt(Stmt.If stmt)
 {
     resolve(stmt.Cond);
     resolve(stmt.ThenBranch);
     if (stmt.ElseBranch != null)
     {
         resolve(stmt.ElseBranch);
     }
     return(null);
 }
 public object visitIfStmt(Stmt.If stmt)
 {
     if (isTruthy(evaluate(stmt.Cond)))
     {
         execute(stmt.ThenBranch);
     }
     else if (stmt.ElseBranch != null)
     {
         execute(stmt.ElseBranch);
     }
     return(null);
 }