Update dependency peggy to v5 #47
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^2.0.1
->^5.0.0
Release Notes
peggyjs/peggy (peggy)
v5.0.0
Compare Source
Released: 2025-05-03
Major Changes
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
andlet
, but is still not strict aboutusing
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
performed on earlier versions of Node, and no issues will be fixed for
earlier versions. #593
proper subclass of the built-in ECMAscript SyntaxError class. The name of
the type has changed to
PeggySyntaxError
, which may cause some slight needfor rework in TypeScript-aware projects. This was the main driver behind
moving away from ES5. #593
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
syntax errors when needed. Library mode is still intended as internal-only,
and subject to backward-incompatible changes in future versions.
#501
#601
foo = [0-9]
that are only called from a rule likebar = foo / [a-z]
, whichmerges 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
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
Plane (BMP) correctly. This feature requires a JavaScript environment
that supports the
u
flag to regular expressions. Theu
flag will onlybe used on character classes that make use of this new feature.
#602
\u{hex}
syntax, allowingeasier inclusion of characters not in the BMP (such as newer emoji). This
syntax works both in string literals and in character classes.
#602
full character and not the replacement character for the first surrogate in
the UTF-16 representation.
#602
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
[^]
or[^]u
now match onecharacter, because they match "not-nothing". Without the "u" flag, this is
the same as
.
. With the "u" flag, this matches an entire codepoint thatis 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
#602
\p{}
or\P{}
escapes to match orinverted-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
transformations, but before code generation. Plugins in this pass can rely
on annotations from previous passes to reason about the code.
#606
'b'* / 'c'
,![]
,&[]
,!('f'*)
, and&('f'*)
now cause a semantic warning. This warning may be escalated to anerror in a future release, once experience in the field has shown that the
approach does not catch code that is valid.
#606
weird version of globals that was only available from the web download was
removed. #608
Bug fixes
other dependencies, and served locally. (TODO: Old version of CodeMirror to
be replaced with Monaco). #593
#593
trailing commas (for consistency with the Peggy house style).
#593
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
deno run -A npm:peggy
to work. We will notknow if these were successful until the package is published next. Testing
with
--format es -t foo
will still not work in Deno.#603
#454
the CLI. Info messages from grammar parsing are presented the same if in
verbose mode. #605
a warning when it was unexpectedly found on test start.
#604
Documentation
#593
.peggy file, but instead show a .peggy.txt file in a browser window.
#595
#596
syntax use the new "dim" approach for optional bits.
$612
v4.2.0
Compare Source
Released: 2024-11-19
New features
parser.d.ts
, which should may help people that use Peggy programmatically in nonstandard ways.Bug fixes
Documentation
v4.1.1
Compare Source
v4.1.0 did not actually get published due to a workflow issue that should
be sorted out now.
New features
Bug fixes
peggy
binary on Windows by handling node runtime flags manually, executing a sub-instance of node to actually runpeggy
.peg$maxFailExpected
andpeg$maxFailPos
.v4.0.3
Compare Source
Released: 2024-06-19
New features
Bug fixes
array, null, or undefined as allowedStartRules option
to work with eslint flat config
web version
plucked word and its pattern.
to playwright for web tests, and added them to CI.
Documentation
!.
).v4.0.2
Compare Source
Released: 2024-02-26
Bug fixes
--allowedRules *
more clearmade the minimum supported node version v20.8. Updated to latest from-mem.
v4.0.1
Compare Source
Released: 2024-02-23
Bug fixes
examples.
Refactor
cli/fromMem.js
into separate projectfrom-mem.
--library
typescript file.
v4.0.0
Compare Source
Released: 2024-02-13
Major Changes
issue by moving reportInfiniteRecursion to the new prepare pass, and having
it fail after finding the first issue. This will require plugin authors
to ensure that reportInfiniteRecursion is in the new pass correctly.
allow topLevelInitializer and initializer to be arrays, in support of
multi-file inputs. This will require plugin updates. The CLI and API now
take multiple files as input, where the first file is your main library, and
subsequent files consist of a library of other rules. The CLI can take file
names of the form
npm:<package-name>/<filename>
to load library rules froman NPM package that is installed relative to the previous non-npm file name,
or to the current working directory if this is the first file name.
required for running the CLI or using Peggy as a library. Generated code
still targets older runtimes.
from external compiled grammars inside a source grammar, using
import {rule} from "external.js"
. Note that this syntax will generate eitherimport
orrequire
in the JavaScript output, depending on the value ofthe
format
parameter. This will need explicit support fromplugins, with a few new AST node types and a few visitor changes.
Internet Explorer. Move to eslint flat configs in order to lint minimized
browser code for compatibility with
defaults, maintained node versions, not op_mini all
.Minor Changes
@generated
in generatedcode
to the command line interface.
browser
key to package.json, pointing to Webpack output.avoid audit warnings.
substrings in various MATCH_ bytecodes
output and source-map if they do not exist, rather than erroring.
ExponentiationExpression
rule (operator**
) tojavascript.pegjs
example grammar.-t
and-T
testingfrom the CLI with
--format es
.Bug Fixes
import
.examples/javascript.pegjs
.v3.0.2
Compare Source
Released: 2023-03-21
Minor Changes
command line argument, which has been invalid since v1.2. From @hildjj.
Bug Fixes
on grammar errors. From @hildjj
for min or max not handling non-integer returns correctly. From @hildjj.
documentation. From @AndrewRayCode.
documentation. From @AndrewRayCode.
allowed-start-rule is documented for CLI. From @hildjj.
v3.0.1
Compare Source
Released: 2022-03-05
Minor Changes
generate. This change loosens type checking strictness to allow for options
unknown to Peggy, but used by plugins such as ts-pegjs. From @hildjj.
Bug Fixes
between rules. From @hildjj.
character in identifiers. This is not a breaking change because no grammar
could have successfully used these in the past. From @hildjj.
docs, including indentation and ensuring that the CNAME file is correct.
possibility in repetition delimeters. From @hildjj and @Mingun.
words as reserved. Clarify the documentation about identifiers. Ensure
that it is more clear that the target language being generated determines
what words are reserved. Clarify that reserved word checking is only
done for labels. From @nene.
external label to the expression inside the
repeated
node. From @Mingun.v3.0.0
Compare Source
Released: 2023-02-21
Major Changes
the documentation, from @hildjj
bytecode, from @hildjj
dependencies, causing minimum supported version of node.js to move to 14.
Generated grammar source should still work on older node versions and some
older browsers, but testing is currently manual for those. from @hildjj
repetition operator
expression|min .. max, delimiter|
, from @Mingunthe list of JavaScript reserved words. This will break existing grammars
that use any of the new words in their rule or label names. from @hildjj
Important information for plug-in authors: PR #291 added 4 new opcodes to the bytecode:
IF_LT
IF_GE
IF_LT_DYNAMIC
IF_GE_DYNAMIC
and added a new AST node and a visitor method
repeated
. Do not forget to update your plug-ins.Important information for grammar authors: the following words, which used to
be valid identifiers for rules and labels, are now treated as JavaScript
reserved words, and will cause errors at compile time if you are using them:
Minor Changes
"*"
is now a validallowedStartRule
, which means all rules are allowed, from @hildjj-S <rule>
or--start-rule <rule>
to specify the start rule when testing,from @hildjj
in parser input textarea, from @Mingun
source-with-inline-map
, which generates source text with an inline map,from @hildjj
string be given as a grammarSource if you are generating a source map, from
@hildjj
ast
andan
--ast
flag for the CLI to get an internal grammar AST for investigation(can be useful for plugin writers), from @Mingun
editors, from @Mingun
from @hildjj
SemVer.org semantic version string, from @dselman
relative offsets into their source files (e.g. if embedded in another doc),
from @hildjj.
data from stdin using
-T -
, from @hildjj.eleventy, from @camcherry
Bug Fixes
information for DiagnosticCallback, from @hildjj
to be received without blocking on the CLI tests, from @hildjj
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.