Skip to content

Releases: kevinmehall/rust-peg

0.8.5

02 Mar 19:51
Compare
Choose a tag to compare

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

@kevinmehall @brasswood

Full Changelog: 0.8.4...0.8.5

0.8.4

21 Jul 16:21
Compare
Choose a tag to compare

Fixes

Full Changelog: 0.8.3...0.8.4

0.8.3

27 Apr 17:35
Compare
Choose a tag to compare

Fixes

  • Fix error with [x..] range pattern (1b2da45)

Improvements

  • Allow inlining standard Parse trait impls by @neocturne (#374)
  • Support where clauses 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 crate visibility modifier, which was dropped from rustc nightly in 2022

0.8.2

11 Oct 02:43
Compare
Choose a tag to compare
  • Allow expected!() to accept a &'static str expression, not just a literal. (#361)
  • Use BTreeSet`` in ExpectedSet`` for deterministic ordering. (#336)
  • Add enabled-by-default std feature that can be disabled to build on no-std + alloc (#336)
  • Fix regression with impl Trait return types (#319)

Contributors

@stevefan1999-personal @Flamenco @tchajed @kevinmehall

0.8.1

26 Sep 00:04
Compare
Choose a tag to compare

Fixes

  • Fix type inference for generic argument in rule's return position (#317)
  • Fix parsing of &'a mut T in type grammar (#304)

Improvements

  • Made LineCol Copy (#298)

Contributors

@kevinmehall @plaflamme @zsol @Kile-Asmussen @kw217

0.8.0

04 Jan 00:58
Compare
Choose a tag to compare

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 trace feature when using infix!{} (#277)
  • Fix #[cache] with grammar lifetime parameters
  • Allow clippy::redundant_closure_call lint 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 'input lifetime parameter to ParseElem trait so implementations can return tokens by reference. (#268)
  • Require Copy on ParseElem::Element to better represent the expectation that they are cheap to copy/move.

Contributors: @kevinmehall @zsol @neunenak @fgasperij

0.7.0

10 Apr 21:09
Compare
Choose a tag to compare

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, Hash for RuleResult (#217)

Fixes

  • Extend detection of infinite-loop left recursion to check inside precedence!() (#238)
  • Wrap user-supplied code in immediately-invoked closure so that return and ? 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 to Parse trait (#252)
  • Certain patterns that would infinite-loop or stack overflow if executed are now a compile-time error
  • mixed_site hygiene prevents action code from accessing internal parser state variables such as __input, __pos, etc.

Contributors

@kevinmehall @dario23 @bgw @adrianwn

0.6.3

22 Jul 03:06
Compare
Choose a tag to compare
  • Fix multiline doc-comments (#232)
  • Documentation improvements

Contributors: @dario23 @kevinmehall

0.6.2

15 Feb 19:19
Compare
Choose a tag to compare
  • Derive PartialEq, PartialOrd, Eq, Ord, Debug, Hash for RuleResult (#217)
  • Documentation improvements

Contributors: @dario23 @kevinmehall

0.6.1

18 Jan 19:21
Compare
Choose a tag to compare
  • Use fully qualified Result path to avoid problems if Result is shadowed (#214)
  • Update to 2018 edition for more consistent behavior when the peg name 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