Skip to content

v4.2.7

Choose a tag to compare

@flowzone-app flowzone-app released this 11 Sep 12:16
· 135 commits to master since this release
c4d9c5d

Update dependency peggy to v5

Notable changes

  • Now supports testing with -t and -T with "amd", "umd", and "globals" format. Fork/exec no longer needed in basic generation path.
  • Adjust repository's Git configuration around CR/LF normalization. #​639
  • Now uses tsup for code generation instead of tsc and rollup. This may be user-visible, since tsup injects different polyfills than typescript was. #​644
  • Fix unicode ranges whose upper bound is astral.
  • Update dependencies.
  • Tweak TypeScript output from --dts to make error type more clear. #​623
  • Test on Node 24, but not Node 23.
  • Write a message after failing a compile in watch mode.
  • Fix TypeScript error in peg.d.ts, SyntaxError constructor should not have a return type.
  • Add more Unicode to fizzbuzz example.
  • Catch invalid unicode property escapes at compile time.
  • Fix TypeScript error in peg.d.ts.
  • Fix SyntaxError definition in peg.d.ts
  • BREAKING: Generated code no longer supports ES5. You can still generate
  • BREAKING: Node.js v20+ is now required for the CLI tools. No testing is
  • BREAKING: The SyntaxError class exported from generated parsers is now a
  • BREAKING: The grammar parser now uses your JavaScript environment's understanding
  • Extend library mode to include a success flag and a function for throwing
  • Slightly better verbose output from the CLI, showing where files are written.
  • Merged class rules (rules which consist of a character class like
  • Superfluous rules (rules which cannot be reached from an allowedStartRule)
  • Character classes now process characters not in the Basic Multi-Lingual
  • Unicode characters may now be specified with the \u{hex} syntax, allowing
  • Errors pointing to non-BMP characters as the "found" text will now show the
  • Character classes can now be annotated with the "u" flag, which will force
  • Empty inverted character classes such as [^] or [^]u now match one
  • String literals may now contain characters from outside the BMP.
  • Character classes may now contain \p{} or \P{} escapes to match or
  • A new "semantic" pass has been added to the compiler, which occurs after all
  • Unreachable code in rules like 'b'* / 'c', ![], &[], !('f'*), and
  • Globals, UMD, and CommonJS are now downloadable from the online version. The
  • Switch to pnpm-action instead of corepack for GitHub Actions. Ensure that help text always wraps the same in tests, no matter the actual terminal width. #​588
  • All libraries used in the web site brought up-to-date, versioned with all
  • Code coverage increased for Peggy Grammar parser.
  • Minor changes in code generation for parsers. More consistent indentation,
  • Avoid performance cliff for deeply-nested grammars when checking for
  • Small measures to try to get deno run -A npm:peggy to work. We will not
  • Fix a bug with named NEVER_MATCH expressions.
  • Warnings from grammar parsing are now presented more fully to the user in
  • One of the intermediate files that is generated in tests was not getting
  • Link to browserlist support matrix in documentation.
  • When clicking on the link to the examples grammar, do not download the
  • Set a minimum height for the editors in the online version.
  • Update the docs for newly-created compiler passes. Make pluck and literal
peggyjs/peggy (peggy)

v5.0.6

Compare Source

Released: 2025-08-05

New features
  • Now supports testing with -t and -T with "amd", "umd", and "globals" format. Fork/exec no longer needed in basic generation path.
    #​643
Bug fixes
  • Adjust repository's Git configuration around CR/LF normalization. #​639
  • Now uses tsup for code generation instead of tsc and rollup. This may be user-visible, since tsup injects different polyfills than typescript was. #​644

v5.0.5

Compare Source

Released: 2025-07-10

Bug fixes
  • Fix unicode ranges whose upper bound is astral.
    #​636

v5.0.4

Compare Source

Released: 2025-06-20

Bug fixes

v5.0.3

Compare Source

Released: 2025-05-30

Bug fixes
  • Tweak TypeScript output from --dts to make error type more clear. #​623
  • Test on Node 24, but not Node 23.
    #​624
  • Write a message after failing a compile in watch mode.
    #​624
Documentation

v5.0.2

Compare Source

Released: 2025-05-07

Bug fixes
  • Fix TypeScript error in peg.d.ts, SyntaxError constructor should not have a return type.
    #​619
  • Add more Unicode to fizzbuzz example.
    #​619
  • Catch invalid unicode property escapes at compile time.
    #​619

v5.0.1

Compare Source

Released: 2025-05-07

Bug fixes
  • Fix TypeScript error in peg.d.ts.
    #​615
  • Fix SyntaxError definition in peg.d.ts
    #​616

v5.0.0

Compare Source

Released: 2025-05-03

Major Changes
  • BREAKING: Generated code no longer supports ES5. You can still generate
    commonjs or es6 exports, but the code itself requires ES2020. If you need
    to support earlier runtimes, you should use a transpiler such as Babel.
    Generated code now uses const and let, but is still not strict about
    using const wherever possible, due to the complexities of code generation.
    Work-arounds and polyfills for class extension, padding, and Object.assign
    have been removed in favor of their ES2020 equivalents.
    #​593
  • BREAKING: Node.js v20+ is now required for the CLI tools. No testing is
    performed on earlier versions of Node, and no issues will be fixed for
    earlier versions. #​593
  • BREAKING: The SyntaxError class exported from generated parsers is now a
    proper subclass of the built-in ECMAscript SyntaxError class. The name of
    the type has changed to PeggySyntaxError, which may cause some slight need
    for rework in TypeScript-aware projects. This was the main driver behind
    moving away from ES5. #​593
  • BREAKING: The grammar parser now uses your JavaScript environment's understanding
    of Unicode classes, rather than a partial copy of Unicode 8 as before. This
    should be more correct and evolve over time while staying backward-compatible
    to the extent that the Unicode Consortium keeps to its goals. Because this
    might slightly affect what rule names are valid, we are marking this as a
    breaking change just in case.
    #​602
New features
  • Extend library mode to include a success flag and a function for throwing
    syntax errors when needed. Library mode is still intended as internal-only,
    and subject to backward-incompatible changes in future versions.
    #​501
  • Slightly better verbose output from the CLI, showing where files are written.
    #​601
  • Merged class rules (rules which consist of a character class like
    foo = [0-9] that are only called from a rule like bar = foo / [a-z], which
    merges the two classes together into a single rule like bar = [0-9a-z]),
    and which are not allowedStartRules, are no longer output into the generated
    parser, since there is no way for that code to be called. This has a chance
    of generating issues for people who are calling the internals of the
    generated parser using
    @​peggyjs/coverage, but that's a
    lightly-documented feature of that library.
    #​594
  • Superfluous rules (rules which cannot be reached from an allowedStartRule)
    no longer generate code into the parser. An INFO-level debug statement is
    generated for each of these removals. Like merged class rules above, this
    should only be removing dead code.
    #​594
  • Character classes now process characters not in the Basic Multi-Lingual
    Plane (BMP) correctly. This feature requires a JavaScript environment
    that supports the u flag to regular expressions. The u flag will only
    be used on character classes that make use of this new feature.
    #​602
  • Unicode characters may now be specified with the \u{hex} syntax, allowing
    easier inclusion of characters not in the BMP (such as newer emoji). This
    syntax works both in string literals and in character classes.
    #​602
  • Errors pointing to non-BMP characters as the "found" text will now show the
    full character and not the replacement character for the first surrogate in
    the UTF-16 representation.
    #​602
  • Character classes can now be annotated with the "u" flag, which will force
    the character class into Unicode mode, where one full Codepoint will be matched.
    For example, [^a]u will match 💪 (U+1F4AA). Without the "u" flag, [^a]
    would only match \uD83D, the first surrogate that makes up U+1F4AA in UTF-16
    encoding. #​602
  • Empty inverted character classes such as [^] or [^]u now match one
    character, because they match "not-nothing". Without the "u" flag, this is
    the same as .. With the "u" flag, this matches an entire codepoint that
    is not a lone surrogate, not just a single UTF-16 code unit (one or two JS
    characters). Previously, this expression compiled without the "u" flag, but
    was useless. #​602
  • String literals may now contain characters from outside the BMP.
    #​602
  • Character classes may now contain \p{} or \P{} escapes to match or
    inverted-match Unicode properties. See
    MDN
    for more details. If you are generating code for a non-JavaScript environment
    using a plugin, this may be somewhat challenging for the plugin author.
    Please file an issue on Peggy for help.
    #​602
  • A new "semantic" pass has been added to the compiler, which occurs after all
    transformations, but before code generation. Plugins in this pass can rely
    on annotations from previous passes to reason about the code.
    #​606
  • Unreachable code in rules like 'b'* / 'c', ![], &[], !('f'*), and
    &('f'*) now cause a semantic warning. This warning may be escalated to an
    error in a future release, once experience in the field has shown that the
    approach does not catch code that is valid.
    #​606
  • Globals, UMD, and CommonJS are now downloadable from the online version. The
    weird version of globals that was only available from the web download was
    removed. #​608
Bug fixes
  • Switch to pnpm-action instead of corepack for GitHub Actions. Ensure that help text always wraps the same in tests, no matter the actual terminal width. #​588
  • All libraries used in the web site brought up-to-date, versioned with all
    other dependencies, and served locally. (TODO: Old version of CodeMirror to
    be replaced with Monaco). #​593
  • Code coverage increased for Peggy Grammar parser.
    #​593
  • Minor changes in code generation for parsers. More consistent indentation,
    trailing commas (for consistency with the Peggy house style).
    #​593
  • Avoid performance cliff for deeply-nested grammars when checking for
    infinite recursion. Previously, nesting more than about 30 layers deep
    caused drastically increasing processing time. Now, nesting more than 700
    layers deep causes "Maximum call stack size exceeded"; hopefully this is
    deep enough in practice. #​600
  • Small measures to try to get deno run -A npm:peggy to work. We will not
    know if these were successful until the package is published next. Testing
    with --format es -t foo will still not work in Deno.
    #​603
  • Fix a bug with named NEVER_MATCH expressions.
    #​454
  • Warnings from grammar parsing are now presented more fully to the user in
    the CLI. Info messages from grammar parsing are presented the same if in
    verbose mode. #​605
  • One of the intermediate files that is generated in tests was not getting
    a warning when it was unexpectedly found on test start.
    #​604
Documentation
  • Link to browserlist support matrix in documentation.
    #​593
  • When clicking on the link to the examples grammar, do not download the
    .peggy file, but instead show a .peggy.txt file in a browser window.
    #​595
  • Set a minimum height for the editors in the online version.
    #​596
  • Update the docs for newly-created compiler passes. Make pluck and literal
    syntax use the new "dim" approach for optional bits.
    $612

List of commits

a3bd65a (Update dependency peggy to v5, 2025-05-06)