range function Null safety

Parser<String> range(
  1. String start,
  2. String stop,
  3. [String? message]
)

Returns a parser that accepts any character in the range between start and stop.

Implementation

Parser<String> range(String start, String stop, [String? message]) =>
    CharacterParser(
        RangeCharPredicate(toCharCode(start), toCharCode(stop)),
        message ??
            '[${toReadableString(start)}-${toReadableString(stop)}] expected');