Skip to content

Releases: ponylang/peg

0.1.8

Choose a tag to compare

@ponylang-main ponylang-main released this 24 Aug 23:08

Fix skip inside terminal producing empty tokens

When a skip operator (-e) appeared inside a terminal (.term()), the terminal silently produced an empty token instead of advancing past the skipped content. For example, (-L("[") * R('a', 'z').many1() * -L("]")).term(MyLabel) applied to [hello] would yield an empty token rather than a token spanning the full match.

Skip inside a terminal now advances past the matched content, and the resulting token spans the entire matched region including the skipped bytes.

Fix Many looping forever when inner parser succeeds without advancing

Many looped forever when its inner parser returned a zero-advance success. Two parsers produce this: Not returns (0, Skipped) when its inner parser fails to match, and Option returns (0, NotPresent) when its inner parser fails to match. With the default separator (NoParser), the separator also returns a zero-advance success, so nothing in the loop state changed between iterations.

Reproducer: L("x").op_not().many() applied to any input where "x" doesn't appear at the current position. Also L("x").opt().many() under the same conditions. Both are reachable from .peg files: (!e)* compiles to Not(e).many(), and (e?)* compiles to Option(e).many().

In tree mode, Option inside Many also caused unbounded memory growth: NotPresent is an ASTChild, so each iteration pushed it into the AST node.

Many now breaks out of the loop when the inner parser succeeds without consuming any input.

[0.1.8] - 2026-08-24

Fixed

  • Fix skip inside terminal producing empty tokens (PR #91)
  • Fix Many looping forever when inner parser succeeds without advancing (PR #93)

0.1.7

Choose a tag to compare

@ponylang-main ponylang-main released this 12 Mar 01:31

Fix unreachable sep rule in self-describing PEG grammar

The sep rule (for the % separated-list-zero-or-more operator) was defined in examples/peg.peg but never referenced in suffix, making it unreachable. Only %+ (one or more) was reachable via sep1. The suffix rule now includes sep.

Update to work with ponyc 0.61.1

ponyc 0.61.1 now detects exhaustive match blocks and treats unreachable else clauses as compile errors. peg has been updated to remove these unreachable else clauses, which means peg now requires ponyc 0.61.1 or newer.

[0.1.7] - 2026-03-12

Fixed

  • Fix unreachable sep rule in self-describing PEG grammar (PR #59)
  • Update to work with ponyc 0.61.1 (PR #63)

0.1.6

Choose a tag to compare

@ponylang-main ponylang-main released this 09 Jan 18:34

Add support for not colorizing the terminal output

Prior to this change any error message called via PegFormatError.console
would return an error message with ANSI escape sequence code for coloring. This
created a problem when piping the output to something other than a terminal.

This change adds the ability to remove ANSI escape sequence codes from the
output. The change is non-breaking as the default behavior is to colorize
the output. The colorization can be turned off by supplying false to
the colorize parameter:

PegFormatError.console(error, false)

[0.1.6] - 2024-01-09

Added

  • Add support for not outputting color to terminal (PR #44)

0.1.5

Choose a tag to compare

@ponylang-main ponylang-main released this 07 Oct 01:46

Update to work with Pony 0.56.3

Pony 0.56.3 has a bug fix that uncovered what should have been a compilation error in peg. We've updated to fix the error.

[0.1.5] - 2023-10-07

Fixed

  • Remove usage of a box inside a recover (PR #42)

0.1.4

Choose a tag to compare

@ponylang-main ponylang-main released this 26 Feb 13:39

Update to work with change Pony 0.49.0

The object capabilities system in the Pony standard library was reworked and we've updated to match it.

Update to work with ponytest name change in Pony 0.49.0

The Pony unit testing framework PonyTest had its package name renamed from ponytest to pony_test to match standard library naming conventions. We've updated to account for the new name.

[0.1.4] - 2022-02-26

Fixed

  • Update to address PonyTest package being renamed (PR #27)

Changed

  • Update to work with object capabilities changes in Pony 0.49.0 (PR #26)

0.1.3

Choose a tag to compare

@ponylang-main ponylang-main released this 16 Jan 03:39

Update to work with latest ponyc

The most recent ponyc implements RFC #65 which changes the type of Env.root.

We've updated accordingly. You won't be able to use this and future versions of the library without a corresponding update to your ponyc version.

[0.1.3] - 2022-01-16

Changed

  • Update for change in Env.root type (PR #24)

0.1.2

Choose a tag to compare

@ponylang-main ponylang-main released this 03 Sep 03:19

Updates to work with ponyc 0.44.0

RFC 70 resulted in breaking changes in ponyc. We've updated peg so that it works with ponyc 0.44.0.

[0.1.2] - 2021-09-03

Fixed

  • Update to work with ponyc 0.44.0 (PR #22)

0.1.1

Choose a tag to compare

@ponylang-main ponylang-main released this 08 Feb 22:04

Internal only release

This was release was purely for non-public facing changes.

[0.1.1] - 2021-02-08

0.1.0

Choose a tag to compare

@Theodus Theodus released this 06 May 14:13
Merge pull request #2 from jemc/master

Update for latest ponyc master (explicit partial calls).