scala-parser-combinators
scala-parser-combinators copied to clipboard
A proposed new interface for skipping characters automatically
I implemented this new interface for Scanners but haven't yet implemented it for RegexParsers; implementing it in the obvious way for RegexParsers would create performance issues (likely making a linear process quadratic). Instead, I've pushed this to start a discussion about whether this interface is something the maintainers would like to see implemented.
The term whitespace is being used somewhat generously here; comments are not whitespace but are skipped, just as whitespace is. I renamed the apply method to parse so that apply could be called as before but that the desired skipping behavior would occur throughout. This has the added benefit of adding explicit meaning to the parse method, which subclasses will implement.
This PR begins to address https://github.com/scala/scala-parser-combinators/issues/320 and https://github.com/scala/scala-parser-combinators/issues/25