Parsita 1.8.0
This is likely to be the last minor release in the 1.x series. It is mainly intended to ease the transition to version 2. Bug fixes will continue to be made to the 1.8.x series, but new features will be added only to the 2.x series unless backporting is not particularly painful.
- Create
ParserContext
as a new context that behaves likeTextParsers
, but has a defaultwhitespace
ofNone
.TextParsers
andGeneralParsers
are now deprecated in favor ofParserContext
, which will be the only context starting in 2.0.0.
- Parsita
Result
now inherits fromreturns.Result
.- The inheritance purely implements the Parsita-specific methods (
Result.or_die
,Success.value
Failure.message
) and deprecates them to ease transition to 2.0.0, when Parsita will reexport the classes from Returns unmodified.
- The inheritance purely implements the Parsita-specific methods (
- Failure now wraps the
ParseError
exception rather than a string.Failure.message
still gives a string.- This makes room for
ParseError
keeping useful information as attributes rather than the information being destroyed into a string.
- This makes room for
- Make
reg
work in aGeneralParsers
context and on bytes (contributed by Chris Wheeler).- Add
.drop
to theReader
base class - Add efficient
.drop
method to theSequenceReader
class - Change
RegexParser
to allow bytes
- Add
Code that runs in Parsita 1.x should run in 1.8.0, though with with deprecation warnings. Code that runs in 1.8.0 without deprecation warnings should run in Parsita 2.x. Note that this only applies to code that uses the Parsita parsers. If you wrote your own parser (i.e. you inherit from Parser
), it's just going to have be fixed in 2.0; the internals of Parsita were changed to much to have custom parsers work in both versions.