predicate function

  1. @useResult
Parser<String> predicate(
  1. int length,
  2. Predicate<String> predicate,
  3. String message
)

Returns a parser that reads input of the specified length, accepts it if the predicate matches, or fails with the given message.

Implementation

@useResult
Parser<String> predicate(
        int length, Predicate<String> predicate, String message) =>
    PredicateParser(length, predicate, message);