char function

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

Returns a parser that accepts a specific character only.

Implementation

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