match<T> function

Parser<T> match<T>(
  1. Pattern pattern,
  2. {String errorMessage,
  3. SyntaxErrorSeverity severity}
)

Expects to match a given pattern. If it is not matched, you can provide a custom errorMessage.

Implementation

Parser<T> match<T>(Pattern pattern,
        {String errorMessage, SyntaxErrorSeverity severity}) =>
    new _Match<T>(pattern, errorMessage, severity ?? SyntaxErrorSeverity.error);