visitArrayifExpr method

  1. @override
Object? visitArrayifExpr(
  1. Arrayif expr
)
override

Implementation

@override
Object? visitArrayifExpr(Expr.Arrayif expr) {
  if (isTruthy(evaluate(expr.condition))) {
    return evaluate(expr.thenBranch);
  } else if (expr.elseBranch != null) {
    return evaluate(expr.elseBranch!);
  }
  return null;
}