Closed lihaoyi closed 1 year ago
@lefou @lolgab if we expect the next version of Fastparse to be 3.0.0, then I'll merge this to get the bincompat breakage in before the version bump
Can you rebase this PR on top of #271, please?
@lefou should already be rebased
@lefou should already be rebased
I meant on top of master
branch.
@lefou I squashesd it on top of latest master, we can use the Squash and Merge
button to make sure the PR description is used on the final commit that ends up in master
Fixes https://github.com/com-lihaoyi/fastparse/issues/261, which is caused by the whitespace
P[_] => P[Unit]
implicits firing as implicit conversions rather than the implicit parameters they were originally intended to be. Since whitespace is meant to ignore failures, this caused failures caused by theFail.! : P[String]
to be ignored when implicitly converted toP[Unit]
The fix is to create a proper
Whitespace
trait to inherit from.Note that this is a binary incompatible change. It's stacked on top of https://github.com/com-lihaoyi/fastparse/pull/271 for convenience, but should probably land separately after. The relevant changes are in this commit https://github.com/com-lihaoyi/fastparse/pull/272/commits/d87ab6d9de062ec1e0bbf897643cefef7cd03338 if anyone wants to look.
Note that I moved the custom whitespace tests to a
scala2.12+
folder to skip them on 2.11. 2.11 does not support SAM conversion, which makes defining custom whitespaces a lot more boilerplatey. Can still be done, but no need to burden everyone with boilerplatey examples just to cater for the 2.11 folks in the test suite. Things are unlikely to break just for 2.11 anyway