public void Visit(Stmt.If stmt) { Resolve(stmt.condition); Resolve(stmt.thenBranch); if (stmt.elseBranch != null) { Resolve(stmt.elseBranch); } }
public void Visit(Stmt.If stmt) { if (IsTruthy(Evaluate(stmt.condition))) { Execute(stmt.thenBranch); } else if (stmt.elseBranch != null) { Execute(stmt.elseBranch); } }