Releases: kevinmehall/rust-peg
Releases · kevinmehall/rust-peg
0.8.5
New features
- Add
#{|input, pos| ... }custom expr (#395) - Allow type bounds (e.g.
Box<dyn Operand + 'input>) in rule return types (#385) - Allow specifying generic arguments (e.g.
my_rule::<u32>()) when calling a rule. (#396)
Deprecations
The never-documented ##method() syntax is deprecated because the ## token is not allowed by Rust edition 2024. It will be removed in rust-peg v0.9. ##method() can be replaced with #{|input, pos| input.method(pos) }.
Contributors
Full Changelog: 0.8.4...0.8.5
0.8.4
Fixes
- Fix macro panic for parse error at end of
peg::parser!{ }specification (#376) by @kevinmehall - Fix handling of
r#raw idents (#378) by @A4-Tacks in #379
Full Changelog: 0.8.3...0.8.4
0.8.3
Fixes
- Fix error with
[x..]range pattern (1b2da45)
Improvements
- Allow inlining standard Parse trait impls by @neocturne (#374)
- Support
whereclauses on rules by @A4-Tacks (#371) - Support trailing commas in type parameter lists by @A4-Tacks (#371)
- Improve compatibility with Rust qualified path syntax in type grammar by @A4-Tacks (#371)
Other
- Remove support for
cratevisibility modifier, which was dropped from rustc nightly in 2022
0.8.2
- Allow
expected!()to accept a&'static strexpression, not just a literal. (#361) - Use
BTreeSet`` inExpectedSet`` for deterministic ordering. (#336) - Add enabled-by-default
stdfeature that can be disabled to build on no-std + alloc (#336) - Fix regression with
impl Traitreturn types (#319)
Contributors
0.8.1
0.8.0
New Features
#[cache_left_rec]annotation to allow left recursion (#266)- Return matched token/character from
[ ]pattern expression (#234)
Fixes
- Fix Rust grammar for arguments (#261) and type bounds (#279)
- Fix
tracefeature when usinginfix!{}(#277) - Fix
#[cache]with grammar lifetime parameters - Allow
clippy::redundant_closure_calllint in generated grammar (#258)
Breaking changes
Most users will not require changes to upgrade from 0.7 to 0.8; these only affect advanced use cases.
- Allow only lifetime, not type, parameters at the grammar level. (type parameters were never properly supported)
- Add
'inputlifetime parameter toParseElemtrait so implementations can return tokens by reference. (#268) - Require
CopyonParseElem::Elementto better represent the expectation that they are cheap to copy/move.
Contributors: @kevinmehall @zsol @neunenak @fgasperij
0.7.0
New features
- Significantly improved compile-time error messages for invalid grammars
- Support
[MyToken(x)]syntax for capturing variables from pattern expressions (#245) - Restore support for
[^ ]inverted pattern syntax - Add
#[no_eof] pub rule() = ...syntax to allow matching a prefix of the input rather than reporting a parse error if the rule does not reach end-of-file (#233) - Allow
rule _ =without parentheses when defining special underscore rule (#243) - Add grammar-level type and lifetime parameters (#254)
- Compile-time check for repeat expressions that infinite-loop without consuming input (#210)
- Implement
PartialEq, PartialOrd, Eq, Ord, Debug, HashforRuleResult(#217)
Fixes
- Extend detection of infinite-loop left recursion to check inside
precedence!()(#238) - Wrap user-supplied code in immediately-invoked closure so that
returnand?behave as expected (#246) - Remove overzealous error checks to allow passing rule closure arguments as parameters to another call (#226)
Breaking changes
- Add required
is_eof()method toParsetrait (#252) - Certain patterns that would infinite-loop or stack overflow if executed are now a compile-time error
mixed_sitehygiene prevents action code from accessing internal parser state variables such as__input,__pos, etc.
Contributors
0.6.3
- Fix multiline doc-comments (#232)
- Documentation improvements
Contributors: @dario23 @kevinmehall
0.6.2
- Derive
PartialEq, PartialOrd, Eq, Ord, Debug, Hashfor RuleResult (#217) - Documentation improvements
Contributors: @dario23 @kevinmehall
0.6.1
- Use fully qualified
Resultpath to avoid problems ifResultis shadowed (#214) - Update to 2018 edition for more consistent behavior when the
pegname is shadowed - Allow crate-relative imports in grammars (#213)
- Documentation improvements
- Fix rule arguments on
pub rule - Forbid
#[cache]on rules with arguments
Contributors: @dario23 @kevinmehall