language-ext icon indicating copy to clipboard operation
language-ext copied to clipboard

Fix error message of notFollowedBy parser

Open StefanBertels opened this issue 1 year ago • 0 comments

  1. [BUG] Tests shows that notFollowedBy reports wrong position. Fixed.
  2. notFollowedBy did output result of p. This might be something different than input string and therefore might hide the problem. As label is not available I think it is a better approach to output the problematic part of the input string (at least if something was consumed).
  3. The new version will allow parsers that don't consume anything like eof. Might be rare but why not support notFollowedBy(eof) or parsers that are decorated with lookahead etc.

Notes: I tried handling all cases of ParserResult state correctly, but I'm not sure -- especially about the last case.

StefanBertels avatar Oct 26 '22 22:10 StefanBertels