Skip to content

Parsita 2.1.0

Compare
Choose a tag to compare
@drhagen drhagen released this 27 Jun 00:13
· 21 commits to master since this release

This is a quick follow-on to the 2.0.0 release. I neglected to make some methods private that were supposed to be private. Because the 2.0.0 release was only three days ago, I hope this will be fine. This is just a bugfix release for anyone who combines the built-in parsers to make their parsers (most users). But this is a severely breaking change for any custom parsers (inherit from Parser rather than use them).

  • Made Parser.consume private
    • Renamed consume to _consume
    • Renamed cached_consume to consume
    • This is the breaking change for custom parsers. Custom parsers now need to override _consume instead of consume and need to call consume instead of cached_consume. This actually brings the 2.x branch a little bit closer to the 1.x branch.
  • Renamed StringReader.current_line to _current_line
  • Moved Parser.handle_other to a global function
    • Export this function as parsita.parsers.wrap_literal
    • Use wrap_literal for all the parsers, not just the operators
      • Literal wrapping now applies to all non-Parser objects, not just str
      • pred now wraps literals like the other parsers, rather than requiring a proper Parser object