visitReturnStmt method

  1. @override
void visitReturnStmt(
  1. Return stmt
)
override

Implementation

@override
void visitReturnStmt(Stmt.Return stmt) {
  Object? value;
  if (stmt.value != null) {
    value = evaluate(stmt.value!);
  }
  throw ReturnException(value);
}