safe method

Parser<T> safe(
  1. {bool backtrack = true,
  2. String errorMessage,
  3. SyntaxErrorSeverity severity}
)

Safely escapes this parser when an error occurs.

The generated parser only runs once; repeated uses always exit eagerly.

Implementation

Parser<T> safe(
        {bool backtrack: true,
        String errorMessage,
        SyntaxErrorSeverity severity}) =>
    new _Safe<T>(
        this, backtrack, errorMessage, severity ?? SyntaxErrorSeverity.error);