reportFailedPredicate method

void reportFailedPredicate(
  1. Parser recognizer,
  2. FailedPredicateException e
)

This is called by {@link #reportError} when the exception is a FailedPredicateException.

@see #reportError

@param recognizer the parser instance @param e the recognition exception

Implementation

void reportFailedPredicate(Parser recognizer, FailedPredicateException e) {
  final ruleIndex = recognizer.context?.ruleIndex;
  final ruleName = ruleIndex != null ? recognizer.ruleNames[ruleIndex] : '';
  final msg = 'rule ' + ruleName + ' ' + e.message;
  recognizer.notifyErrorListeners(msg, e.offendingToken, e);
}