any<T> function

Parser<T> any<T>(
  1. Iterable<Parser<T>> parsers,
  2. {bool backtrack = true,
  3. dynamic errorMessage,
  4. SyntaxErrorSeverity severity}
)

Matches any one of the given parsers.

If backtrack is true (default), a failed parse will not modify the scanner state.

You can provide a custom errorMessage. You can set it to false to not generate any error at all.

Implementation

Parser<T> any<T>(Iterable<Parser<T>> parsers,
    {bool backtrack: true, errorMessage, SyntaxErrorSeverity severity}) {
  return new _Any(parsers, backtrack != false, errorMessage,
      severity ?? SyntaxErrorSeverity.error);
}