Fix an issue where the terms file could contain tokens named eval
or arguments
, which isn't allowed in strict mode.
The Rollup plugin will now ignore sources starting with null characters in its resolve hook.
Fix a bug that broken references to tokens in local token groups.
Include type declarations for the Rollup plugin.
Named or @export
-ed specialized tokens are now available in the terms file.
The generator now emits a warning when rules generate a lot of different variants (usually due to a combinatory explosion of ?
and |
operators).
Fix an issue where the generator could output invalid JavaScript when a specialization used a string that started with a number.
Adjust TypeScript output to compile with recent tsc versions. Add a test for zero-length node mounts
Support an exportName
option to the Rollup plugin.
Fix a quadratic complexity in state merging.
Fix a build issue that made the ES version of the Rollup plugin fail to load.
The new typeScript
option to buildParserFile
(and --typeScript
option to lezer-generator) makes the tool emit TypeScript code.
Fix a regression in the build process that caused the Rollup plugin to not be part of the npm package.
Make this package usable in TypeScript setups with node16/nodenext resolution.
BuildOptions.contextTracker
now takes a function, so that the code that produces it has access to the term IDs.
The test utilities can now be imported as "@lezer/generator/test"
.
Fix a bug where precedences specified for local tokens were not properly applied.
Make sure the Rollup plugin imports the rest of the library using a full file path.
Make --help
show the correct executable name.
Make sure require
isn't used as an identifier in generator output.
Fix an invalid optimization that sometimes led to incomplete token precedence tables, leading to incorrect tokenization.
Fix a bug where the error to use ()
to denote empty options in a choice expression was signalled even when that is what the input did.
Grammars can now declare @local tokens
blocks defining all the tokens that may appear in a set of state, and allowing @else
tokens that match everything else.
Fix broken Rollup plugin due to a bad import.
Fix a bug where the _ notation in tokens would match only half of a surrogate pair.
Fix a bug that caused invalid tokenizer data to be generated for character ranges ending in \uffff.
Emit enough information about external specializers to make ParserConfig.specializers
fixable.
Things that used to be written like std.digit
are now written @digit
. The old notation will remain available until a breaking release.
The new @eof
marker can be used in tokens to match the end of the input.
First stable version.
Fix an issue in the tokenizer for grammars that could cause it to run very slowly on some inputs.
A grammar can now include an @external propSource a from "b"
declaration to import a programmatically defined node prop source.
Fix a bug where explicitly specified token precedences were sometimes not properly enforced.
Fix a bug that caused some kind of skip rules (those ending in something optional) to not work correctly.
Fix an infinite recursion caused by some kinds of (obscure) token state machines.
Fix a bug that could lead to spurious 'inconsistent skip sets' errors.
Fix a bug that caused an unescaped '-' at the start or end of a character set to silently be converted to a nonsensical character.
Fix a confusing behavior where literal tokens declared in the @tokens
block didn't get names when they started with a lower-case character.
Top rules may now be defined inside @skip
scopes.
The parser no longer treats an empty position in a choice operator as the empty expression, but requires an explicit () marker (to avoid a common mistake).
The module's name changed from lezer-generator
to @lezer/generator
.
Nested parsers can no longer be specified in the grammar (they must now be set up programmatically).
Fix an issue where newlines in string tokens could silently corrupt the token.
Handle alternative output file extensions more gracefully.
@export
props may now have a value to set a specific export name.
Don't add inline rules to the terms file (since they may not be uniquely identified by name).
Generate more minimal state machines for the tokenizer.
Support @context
syntax to register a context tracker for a grammar.
Fix an issue where imported identifiers could clash with the export name in generated code.
Fix versions of lezer packages depended on.
Adjust to the new way nested parsers work in Lezer.
Top rule node types will now show up in the terms file.
It is no longer allowed for a top rule to share a name with another rule.
The serialized parser format changed.
Pseudo-props like name
, dialect
, inline
and dynamicPrec
now require an @
in front of them when specified in a rule's prop list.
@export
is now specified as a pseudo-prop instead of in front of the rule.
Top rule names are now required.
Rules can now specify an @isGroup
pseudo-prop to automatically attach a group name to all the (single) named nodes they produce.
Fix a crash that could happen when reporting a conflict error.
A @conflict
block inside @tokens
can now be used to explicitly indicate a conflict between two tokens.
Allow rules to be explicitly inlineable with an [inline]
pseudo-prop.
Fix lezer depencency versions
Simplify the representation of repeat expressions in the grammar in a way that avoids some spurious conflicts.
The output format has been modified to allow states to share part of their action table for better compression.
Fix a bug where the state collapsing could introduce GLR parsing in grammars that otherwise didn't require it.
Fix a bug where moduleStyle
defaulted to "cjs"
when using the node API (rather than to "es"
as documented).
You can now import "lezer-generator/rollup"
to get a rollup plugin that will transform grammars during the build.
Fix a bug that broke @external prop
declarations in grammars.
Make sure unrelated precedence declarations for non-cyclic overlapping tokens don't end up also defining a relation between those tokens.
Actually reuse parser states when skip rules refer to rules also used in other contexts.
Fix a bug where the automaton generated for skip rules wasn't being compressed.
Properly raise an error when different specializations for the same token are given different names.
Fix a bug that prevented NodeProp.skipped
from being properly attached to node types.
Fix a corner-case infinite loop in the state-collapsing algorithm (and speed it up).
Compile +
and *
operators in a way that is less likely to lead to conflicts.
Emit all shift/reduce and reduce/reduce conflicts in a single run, rather than stopping on the first one.
Emit all overlapping token errors, rather than only the first one.
Inline rules can now be anonymous (with syntax [props..] { body }
).
Dynamic precedences can now be associated with productions, which can help pick the preferred GLR parse when a grammar is ambiguous.
Token @precedence
declarations can now refer to a parameterized rule by name (without arguments) to indicate that all instances of that rule have a given precedence.
Fix an issue where the output file would in some cases have a superfluous comma.
Fix a bug in the reuse of compiled rules (which sometimes got confused by inline rules).
The error message for overlapping tokens is a bit more concrete now, including an example of a string that matches both tokens.
Add support for grammar dialects.
Add support for external specializers.
Commas in precedence tag, dialect, or external token lists are now optional.
Changes the serialized parser format.
The test runner helper now allows tests to pass additional configuration options.
The @detectDelim
directive now assigns NodeProp.openedBy
/closedBy
props to the bracket nodes, instead of NodeProp.delim
to the parent node.
Publish less useless cruft to npm, reducing package size.
Fix an issue where token groups were inappropriately merged when conflicting tokens didn't appear in overlapping state sets.
Fix an issue where external tokenizers needed for skipped tokens were not properly enabled for some states.
Fix a bug where the tool would sometimes overeagerly merge states, resulting in incorrect output.
Make dist/test loadable from CommonJS modules again.
Fix a bug that prevented NodeProp.top
from being assigned to top rules in most cases.
Fix an issue that broke the bin command.
Make the package load as an ES module on node
Changes the serialized parser format.
Add support for multiple @top
rules.
Support Foo(...)
syntax in test specs to indicate "ignore the children of this node".
You can now write a node name directly after @top
to give your top node type a name.
Changes the way repeated nodes are represented in the generated parser.
Fix crash when the top rule had no node name.
Adjust the way states' forced reductions are computed to avoid cycles (where force-reducing multiple times gets you back in your original state).
Fix issue where serialized parsers didn't have the top node prop set.
The generator now automatically assigns the top
node prop to the grammar's top node.
Fix bug that made matching single-token skipped expressions unnecessarily expensive.
Do not emit recovery actions in the parse table anymore.
Fix several issues in the way forced reductions were picked, to avoid infinite reduction loops.
Add support for props and custom node names in the grammar notation.
Allow importing of props via @external prop
.
Rule capitalization is now relevant (again), only capitalized rules appear in the tree by default.
Remove support for node tags, tag expressions, the @tags
block, and everything else related to tags.
Replace tagged expression syntax with inline rule syntax.
Literal declarations must now go into the @tokens
block.
The @detectDelim
declaration must now appear at the top level.
The dash in @external-...
syntax was dropped—@external
is now a separate token.
External grammars that default to null must now have the word empty
instead of from "..."
(to resolve an ambiguity that syntax introduced).
Fix bug where the grammar parser unintentionally required semicolon between rules in skip blocks.
Actually throw an error when detecing a skip inconsistency.
Track skip context more accurately through parse states.
Fix specializing of external tokens.
Add support for tags.
Add @tags
blocks, allow tags for literals.
Add @punctuation
to succinctly declare punctuation tags.
Add @infer-delim
to enable automatic delimiter detection.
Add @all
as a way to append tags to all tagged rules in the grammar.
Allow a choice of literals to be passed to @specialize
/@extend
.
Add dist/test.js
with test helper functions.
Require @
in front of grammar keywords.
Remove support for =
-style tag declarations.
Replace tag.foo
syntax with colon suffix syntax.
Actually include the .d.ts file in the published package.
First documented release.