visitConditionalExpr method
Implementation
@override
Object? visitConditionalExpr(Expr.Conditional expr) {
if (isTruthy(evaluate(expr.condition))) {
return evaluate(expr.thenBranch);
} else {
return evaluate(expr.elseBranch);
}
}
@override
Object? visitConditionalExpr(Expr.Conditional expr) {
if (isTruthy(evaluate(expr.condition))) {
return evaluate(expr.thenBranch);
} else {
return evaluate(expr.elseBranch);
}
}