Beispiel #1
0
 public object VisitWhileStmt(While stmt)
 {
     try
     {
         while (IsTruthy(Evaluate(stmt.Condition)))
         {
             try
             {
                 Execute(stmt.Body);
             }
             catch (ContinueException e) { }
         }
     }
     catch (BreakException e) { }
     return(null);
 }
Beispiel #2
0
 public string VisitWhileStmt(While stmt)
 {
     return(Parenthesize2("while", stmt.Condition, stmt.Body));
 }