PackageTrack
Sign in Get early access

peg

A simple Parsing Expression Grammar (PEG) parser generator.

0.8.6 32M downloads/mo #1618 most downloaded on crates.io kevinmehall/rust-peg

What this package is like to depend on

Last release 3 months ago

04 May 2026

Ships fairly regularly

a new release about every 7 months

Rarely documented

notes for 10 of 52 stable releases

Nothing withdrawn

no release was ever pulled

12 years old

52 releases · first in 2014

1 release in the last 12 months

see the full history below

Release timeline

52 releases · Nov 2014 to May 2026
2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 52
  1. 0.8.6 04 May 2026
    Release notes

    New features

    • Add grammar-wide injected variables for more easily building syntax trees with spans (#421)
    • Support use-tree syntax (#408)
    • Support use-bound on return position impl trait (#409)
    • Allow rules without = expr at macro expansion time so that rust-analyzer can suggest a return type. (#410)

    Fixes

    • Fix for no-std (#406)
    • Fix for trace feature with #[cache] (#398)
    • Fix span on closing brace in meta-grammar (#411)

    Minimum Rust version is increased to 1.82.

    Contributors

    @kevinmehall @A4-Tacks @csnover @luohewuyang

    Open source →
    Release notes

    0.8.6 Latest

    Latest

    Compare

    Choose a tag to compare

    Open source →
  2. 0.8.5 02 Mar 2025
    Release notes

    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

    Open source →
    Release notes

    0.8.5

    Compare

    Choose a tag to compare

    Open source →
  3. 0.8.4 21 Jul 2024
    Release notes

    Fixes

    Full Changelog: 0.8.3...0.8.4

    Open source →
    Release notes

    0.8.4

    Compare

    Choose a tag to compare

    Open source →
  4. 0.8.3 27 Apr 2024
    Release notes

    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
    Open source →
    Release notes

    0.8.3

    Compare

    Choose a tag to compare

    Open source →
  5. 0.8.2 11 Oct 2023
    Release notes
    • 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

    Open source →
    Release notes

    0.8.2

    Compare

    Choose a tag to compare

    Open source →
  6. 0.8.1 26 Sep 2022
    Release notes

    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

    Open source →
    Release notes

    0.8.1

    Compare

    Choose a tag to compare

    Open source →
  7. 0.8.0 04 Jan 2022
    Release notes

    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

    Open source →
    Release notes

    0.8.0

    Compare

    Choose a tag to compare

    Open source →
  8. 0.7.0 10 Apr 2021
    Release notes

    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

    Open source →
    Release notes

    0.7.0

    Compare

    Choose a tag to compare

    Open source →
  9. 0.6.3 22 Jul 2020
    Release notes
    • Fix multiline doc-comments (#232)
    • Documentation improvements

    Contributors: @dario23 @kevinmehall

    Open source →
    Release notes

    0.6.3

    Compare

    Choose a tag to compare

    Open source →
  10. 0.6.2 15 Feb 2020
    Release notes
    • Derive PartialEq, PartialOrd, Eq, Ord, Debug, Hash for RuleResult (#217)
    • Documentation improvements

    Contributors: @dario23 @kevinmehall

    Open source →
    Release notes

    0.6.2

    Compare

    Choose a tag to compare

    Open source →
  11. 0.6.1 18 Jan 2020

    Nothing published for this version

  12. 0.6.0 06 Oct 2019

    Nothing published for this version

  13. 0.5.7 06 Oct 2018

    Nothing published for this version

  14. 0.5.4 24 Jun 2017

    Nothing published for this version

  15. 0.5.3 09 May 2017

    Nothing published for this version

  16. 0.5.2 29 Apr 2017

    Nothing published for this version

  17. 0.5.1 29 Jan 2017

    Nothing published for this version

  18. 0.5.0 15 Jan 2017

    Nothing published for this version

  19. 0.4.0 21 Nov 2016

    Nothing published for this version

  20. 0.3.18 03 Nov 2016

    Nothing published for this version

  21. 0.3.17 22 Oct 2016

    Nothing published for this version

  22. 0.3.16 17 Sep 2016

    Nothing published for this version

  23. 0.3.15 01 Sep 2016

    Nothing published for this version

  24. 0.3.14 03 Jul 2016

    Nothing published for this version

  25. 0.3.13 22 Jun 2016

    Nothing published for this version

  26. 0.3.12 11 Jun 2016

    Nothing published for this version

  27. 0.3.11 26 Apr 2016

    Nothing published for this version

  28. 0.3.10 18 Feb 2016

    Nothing published for this version

  29. 0.3.9 13 Feb 2016

    Nothing published for this version

  30. 0.3.8 12 Jan 2016

    Nothing published for this version

  31. 0.3.7 07 Jan 2016

    Nothing published for this version

  32. 0.3.6 06 Dec 2015

    Nothing published for this version

  33. 0.3.5 28 Nov 2015

    Nothing published for this version

  34. 0.3.4 07 Nov 2015

    Nothing published for this version

  35. 0.3.3 01 Sep 2015

    Nothing published for this version

  36. 0.3.2 26 Aug 2015

    Nothing published for this version

  37. 0.3.1 21 Jul 2015

    Nothing published for this version

  38. 0.3.0 19 May 2015

    Nothing published for this version

  39. 0.2.3 08 Apr 2015

    Nothing published for this version

  40. 0.2.2 29 Mar 2015

    Nothing published for this version

  41. 0.2.1 25 Mar 2015

    Nothing published for this version

  42. 0.2.0 13 Mar 2015

    Nothing published for this version

  43. 0.1.9 08 Mar 2015

    Nothing published for this version

  44. 0.1.8 01 Mar 2015

    Nothing published for this version

  45. 0.1.7 13 Feb 2015

    Nothing published for this version

  46. 0.1.6 11 Feb 2015

    Nothing published for this version

  47. 0.1.5 29 Jan 2015

    Nothing published for this version

  48. 0.1.4 24 Jan 2015

    Nothing published for this version

  49. 0.1.3 10 Jan 2015

    Nothing published for this version

  50. 0.1.2 24 Dec 2014

    Nothing published for this version

  51. 0.1.1 06 Dec 2014

    Nothing published for this version

  52. 0.1.0 23 Nov 2014

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive