visitLogicalExpr method
Implementation
@override
Object? visitLogicalExpr(Expr.Logical expr) {
Object? left = evaluate(expr.left);
if (expr.operator.type == TokenType.OR) {
if (isTruthy(left)) {
return left;
}
} else {
if (!isTruthy(left)) {
return left;
}
}
return evaluate(expr.right);
}