6.2 KiB
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
Added
Removed
Changed
Fixed
[0.9.2] - 2023-03-02
Fixed
- Properly fixed
skip_then_retry_untilregression
[0.9.1] - 2023-03-02
Fixed
- Regression in
skip_then_retry_untilrecovery strategy
[0.9.0] - 2023-02-07
Added
- A
spill-stackfeature that usesstackerto avoid stack overflow errors for deeply recursive parsers - The ability to access the token span when using
select!likeselect! { |span| Token::Num(x) => (x, span) } - Added a
skip_parserrecovery strategy that allows you to implement your own recovery strategies in terms of other parsers. For example,.recover_with(skip_parser(take_until(just(';'))))skips tokens until after the next semicolon - A
notcombinator that consumes a single token if it is not the start of a given pattern. For example,just("\\n").or(just('"')).not()matches anycharthat is not either the final quote of a string, and is not the start of a newline escape sequence - A
semantic_indentationparser for parsing indentation-sensitive languages. Note that this is likely to be deprecated/removed in the future in favour of a more powerful solution #[must_use]attribute for parsers to ensure that they're not accidentally created without being usedOption<Vec<T>>andVec<Option<T>>now implementChain<T>andOption<String>implementsChain<char>choicenow supports both arrays and vectors of parsers in addition to tuples- The
Simpleerror type now implementsEq
Changed
text::whitespacereturns aRepeatedinstead of animpl Parser, allowing you to call methods likeat_leastandexactlyon it.- Improved
no_stdsupport - Improved examples and documentation
- Use zero-width spans for EoI by default
- Don't allow defining a recursive parser more than once
- Various minor bug fixes
- Improved
Displayimplementations for various built-in error types andSimpleReason - Use an
OrderedContainertrait to avoid unexpected behaviour for unordered containers in combination withjust
Fixed
- Made several parsers (
todo,unwrapped, etc.) more useful by reporting the parser's location on panic - Boxing a parser that is already boxed just gives you the original parser to avoid double indirection
- Improved compilation speeds
[0.8.0] - 2022-02-07
Added
then_withcombinator to allow limited support for parsing nested patterns- impl From<&[T; N]> for Stream
SkipUntil/SkipThenRetryUntil::skip_start/consume_endfor more precise control over skip-based recovery
Changed
- Allowed
Validateto map the output type - Switched to zero-size End Of Input spans for default implementations of
Stream - Made
delimited_bytake combinators instead of specific tokens - Minor optimisations
- Documentation improvements
Fixed
- Compilation error with
--no-default-features - Made default behaviour of
skip_untilmore sensible
[0.7.0] - 2021-12-16
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
[0.6.0] - 2021-11-22
Added
skip_untilerror recovery strategySeparatedBy::at_leastandSeparatedBy::at_mostfor parsing a specific number of separated itemsParser::validatefor integrated AST validationRecursive::declareandRecursive::definefor more precise control over recursive declarations
Changed
- Improved
separated_byerror messages - Improved documentation
- Hid a new (probably) unused implementation details
[0.5.0] - 2021-10-30
Added
take_untilprimitive
Changed
- Added span to fallback output function in
nested_delimiters
[0.4.0] - 2021-10-28
Added
- Support for LL(k) parsing
- Custom error recovery strategies
- Debug mode
- Nested input flattening
Changed
- Radically improved error quality