示例#1
0
 object Stmt.IVisitor <object> .visitIfStmt(Stmt.If stmt)
 {
     Resolve(stmt.condition);
     Resolve(stmt.ifBody);
     if (stmt.elseBody != null)
     {
         Resolve(stmt.elseBody);
     }
     return(null);
 }
示例#2
0
 public object visitIfStmt(Stmt.If stmt)
 {
     if (GetTruthValue(Evaluate(stmt.condition)))
     {
         Execute(stmt.ifBody);
     }
     else if (stmt.elseBody != null)
     {
         Execute(stmt.elseBody);
     }
     return(null);
 }