neg method

  1. @useResult
Parser<String> neg([
  1. String message = 'input not expected'
])

Returns a parser that consumes any input token (character), but the receiver.

For example, the parser letter().neg() accepts any input but a letter. The parser fails for inputs like 'a' or 'Z', but succeeds for input like '1', '_' or '$'.

Implementation

@useResult
Parser<String> neg([String message = 'input not expected']) =>
    any().skip(before: not(message));