char function Null safety

Parser<String> char(
  1. String char,
  2. [String? message]
)

Returns a parser that accepts a specific character only.

Implementation

Parser<String> char(String char, [String? message]) => CharacterParser(
    SingleCharPredicate(toCharCode(char)),
    message ?? '"${toReadableString(char)}" expected');