Fastparse is a more modern and much faster parser-combinator library for Scala.
Its disitinctive features are:
More precise and fine-grained handling of whitespace (achieved through parameterizing certain parsers with indentation depth)
Much better error reporting (shows the position where parser failed and the surrounding characters). Can be improved even further with cuts and opaque modifier (if need be). Debugging the parser is also much easier with .log and .trace methods.
Much better performance (not really relevant in our case but still)
In the process of rewriting I also had to revisit testing the parsers:
EO sources used for testing parsers are now loaded from resources directory
Some common parts (like mutual recursion example) where refactored into separate objects.
I also left some TODOs which indicate places where some work may be needed to be done in the future.
Fastparse is a more modern and much faster parser-combinator library for Scala. Its disitinctive features are:
In the process of rewriting I also had to revisit testing the parsers:
I also left some TODOs which indicate places where some work may be needed to be done in the future.