0.7
Added
-
A new tutorial to help new users
-
selectmacro, a wrapper overfilter_mapthat makes extracting data from specific tokens easy -
choiceparser, a better alternative to longorchains (which sometimes have poor compilation performance) -
todoparser, that panics when used (but not when created) (akin to Rust'stodo!macro, but for parsers) -
keywordparser, that parses exact identifiers -
from_strcombinator to allow converting a pattern to a value inline, usingstd::str::FromStr -
unwrappedcombinator, to automatically unwrap an output value inline -
rewindcombinator, that allows reverting the input stream on success. It's most useful when requiring that a
pattern is followed by some terminating pattern without the first parser greedily consuming it -
map_err_with_spancombinator, to allow fetching the span of the input that was parsed by a parser before an error
was encountered -
or_elsecombinator, to allow processing and potentially recovering from a parser error -
SeparatedBy::at_mostto require that a separated pattern appear at most a specific number of times -
SeparatedBy::exactlyto require that a separated pattern be repeated exactly a specific number of times -
Repeated::exactlyto require that a pattern be repeated exactly a specific number of times -
More trait implementations for various things, making the crate more useful
Changed
- Made
just,one_of, andnone_ofsignificant more useful. They can now accept strings, arrays, slices, vectors,
sets, or just single tokens as before - Added the return type of each parser to its documentation
- More explicit documentation of parser behaviour
- More doc examples
- Deprecated
seq(justhas been generalised and can now be used to parse specific input sequences) - Sealed the
Charactertrait so that future changes are not breaking - Sealed the
Chaintrait and made it more powerful - Moved trait constraints on
Parserto where clauses for improved readability
Fixed
- Fixed a subtle bug that allowed
separated_byto parse an extra trailing separator when it shouldn't - Filled a 'hole' in the
Errortrait's API that conflated a lack of expected tokens with expectation of end of input - Made recursive parsers use weak reference-counting to avoid memory leaks