tryParse<I, O> function

ParseResult<I, O> tryParse<I, O>(
  1. O? parse(
    1. State<I> state
    ),
  2. I input
)

Implementation

ParseResult<I, O> tryParse<I, O>(O? Function(State<I> state) parse, I input) {
  final state = State(input);
  final result = parse(state);
  final parseResult = _createParseResult<I, O>(state, result);
  return parseResult;
}