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