parseString<O> function

O parseString<O>(
  1. O? parse(
    1. State<String> state
    ),
  2. String source
)

Implementation

O parseString<O>(O? Function(State<String> state) parse, String source) {
  final state = State(source);
  final result = parse(state);
  if (state.ok) {
    return result as O;
  }

  final parseResult = _createParseResult<String, O>(state, result);
  return parseResult.getResult();
}