Skip to content

Global Initializers, @plucking

Compare
Choose a tag to compare
@hildjj hildjj released this 22 Apr 20:11
· 754 commits to main since this release
9eb73d1

Major Changes

  • Added global initializer blocks, which contain code that is only run once
    when the grammar is loaded, rather than once every time the parser runs.
    Global initializers are surrounded by {{ and }}, and must come before
    the per-parser initializer, which is surrounded by { and }.
    @jaubourg
  • Back-ported value plucking with @ from pegjs head. If your rule has a simple action that returns one or more of the values matched by the rule, you can instead mark those expressions with @ and not need an action. This works inside of parens as well. @hildjj

Bug fixes

  • #10: Better docs for parser options
  • #40: Turn on eslint prefer-const
  • #58: Release script didn't push tag correctly
  • #61: Replace download link with new one in doc (partial fix)
  • #71: Readme doesn't include "es" format
  • #72: Generated code has wrong version number