j-mie6 / parsley

A fast and modern parser combinator library for Scala
https://j-mie6.github.io/parsley/
BSD 3-Clause "New" or "Revised" License
173 stars 15 forks source link

Prevent zero-width tokens from being formatted #196

Closed j-mie6 closed 1 year ago

j-mie6 commented 1 year ago

This PR stops zero-width tokens from being handed off to the user to format: they may return zero-width tokens if they want (their funeral), but we guarantee that this doesn't happen from our end. If an error tries to make a zero-width unexpected token, it will simple by ignored.

Added an additional guarantee to the documentation to make clear that the user may expect inputDemandedByParser to be greater than 0.

As a consequence of this change, notFollowedBy(unit) now correctly matches the semantics of empty.

codeclimate[bot] commented 1 year ago

Code Climate has analyzed commit d89f75ce and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 91.2% (0.0% change).

View more on Code Climate.