longest<T> function

Parser<T> longest<T>(
  1. Iterable<Parser<T>> parsers,
  2. {Object errorMessage,
  3. SyntaxErrorSeverity severity}
)

Matches any one of the given parsers.

You can provide a custom errorMessage.

Implementation

Parser<T> longest<T>(Iterable<Parser<T>> parsers,
    {Object errorMessage, SyntaxErrorSeverity severity}) {
  return new _Longest(
      parsers, errorMessage, severity ?? SyntaxErrorSeverity.error);
}