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

Generalise `empty` in internals #197

Closed j-mie6 closed 1 year ago

j-mie6 commented 1 year ago

This PR generalises the empty combinator so that it can specify the caret at all levels of abstraction: prior to this, error messages supported wide carets from the filters, but the Empty instruction fixed this to 0. The new behaviour allows this to vary all the way up to the combinator level, with

def empty(caretWidth: Int): Parsley[Nothing]

In parsley.errors.combinator. The current empty is now aliased to empty(0). In future this will be exposed, allowing for the primitive construction of say the filterOut combinator, if desired.

codeclimate[bot] commented 1 year ago

Code Climate has analyzed commit 1fb09b5f 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.