NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3108 most downloaded on npm
Incremental parser
Last release 2 days ago
07 Oct 2026
Ships unpredictably
gaps range from 1 weeks to 1.3 years
Nearly every release is documented
notes for 48 of 48 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
48 releases · first in 2021
One column per quarter.
Fix an issue that could cause the wrong context hash to be assigned to nodes with skipped nodes after them, affecting incremental parsing.
Fix an issue that could cause the wrong context hash to be assigned to nodes with skipped nodes after them, affecting incremental parsing.
Fix an issue where incremental parsing could fail to reuse nodes created by repeat expressions if there was skipped content between the repetitions.
Fix a tree corruption issue caused by unsound error node merging.
Fix a tree corruption issue caused by unsound error node merging.
Fix production of invalid trees on zero-length reductions directly following a skipped token.
Fix production of invalid trees on zero-length reductions directly following a skipped token.
Fix an issue where the wrong start position was emitted for composite skipped nodes in some circumstances.
Fix an issue where the wrong start position was emitted for composite skipped nodes in some circumstances.
Fix an issue that caused zero-length non-tree tokens to grow the extent of their parent node.
Fix an issue that caused zero-length non-tree tokens to grow the extent of their parent node.
Fix an issue where zero-length tokens could fail to properly set the parser's reduce pos.
Fix an issue where zero-length tokens could fail to properly set the parser's reduce pos.
Improve heuristic for picking a stack during error-recovery at the end of the input.
When pruning excessive recovery parse stacks, prefer to drop those with worse parse scores.
When pruning excessive recovery parse stacks, prefer to drop those with worse parse scores.
Fix a bug that caused the parser to corrupt its output tree in some situations when attaching a look-ahead prop to a node.
Fix a bug that caused the parser to corrupt its output tree in some situations when attaching a look-ahead prop to a node.
Fix an issue that caused some skipped nodes to incorrectly become children of the node before them.
Fix an issue that caused some skipped nodes to incorrectly become children of the node before them.
Fix a tree corruption issue caused by lookahead records in some circumstances.
Fix a tree corruption issue caused by lookahead records in some circumstances.
Fix a bug where incremental parsing could inappropriately reuse a node when it ended in a repeat or optional part, and was followed by a sequence of s
Fix a bug where incremental parsing could inappropriately reuse a node when it ended in a repeat or optional part, and was followed by a sequence of skipped nodes longer than 25 characters.
The new InputStream.acceptTokenTo method allows a tokenizer to create a token that ends at some absolute position.
The new InputStream.acceptTokenTo method allows a tokenizer to create a token that ends at some absolute position.
Further reduce maximum parse depth—the old limit could still cause the tree building function to overflow the stack on V8 when all rules on the stack
Further reduce maximum parse depth—the old limit could still cause the tree building function to overflow the stack on V8 when all rules on the stack produce actual visible tree nodes.
The parser will now emit an error node when it reaches the end of the top rule but not the end of the input, and restarts parsing the top rule.
The parser will now emit an error node when it reaches the end of the top rule but not the end of the input, and restarts parsing the top rule.
Fix an issue that could, when error-recovery happened after a skipped token, cause the parser to emit nodes whose start position was after their end position.
Reduce tree depth limit to avoid V8 overflowing its stack.
Reduce tree depth limit to avoid V8 overflowing its stack.
When parsing input ranges with gaps, don't treat the token after a gap as covering the entire gap.
When parsing input ranges with gaps, don't treat the token after a gap as covering the entire gap.
Make this package usable in TypeScript setups using node16/nodenext resolution.
Make this package usable in TypeScript setups using node16/nodenext resolution.
Fix another issue in the way local token groups and input gaps interact.
Fix another issue in the way local token groups and input gaps interact.
Fix an issue that caused incorrect trees to be emitted when a forced reduction happened inside a skipped term.
Fix an issue that caused incorrect trees to be emitted when a forced reduction happened inside a skipped term.
Fix a bug where the parser could skip characters while tokenizing in a local token group.
Fix a bug where the parser could skip characters while tokenizing in a local token group.
Fix an issue where context-tracking parsers, in specific circumstances, could create incorrectly nested trees.
Fix an issue where context-tracking parsers, in specific circumstances, could create incorrectly nested trees.
Fix an issue where some grammars could make the parser unable to force reductions on invalid input, leading to trees that were missing some wrapping n
Fix an issue where some grammars could make the parser unable to force reductions on invalid input, leading to trees that were missing some wrapping nodes around the broken input.
Fix tokenizing of @else tokens that span separate input ranges.
Fix tokenizing of @else tokens that span separate input ranges.
Fix a crash when parsing a non-atomic skippable at the top of a nested parse.
Fix a crash when parsing a non-atomic skippable at the top of a nested parse.
Fix a bug that caused the tree-depth limit on left-associative rules to be applied to rules generated for repeat operators.
Place a limit on the amount of (non-recovering) parse stacks active at the same time to avoid exponential slowdown on inputs that nest ambiguous const
Place a limit on the amount of (non-recovering) parse stacks active at the same time to avoid exponential slowdown on inputs that nest ambiguous constructs.
Reduce the maximum left-associative nesting depth, since the old value could still cause Chrome (but not Firefox) to overflow its call stack.
Fix a bug that could corrupt the parse stack when parsing a non-single-token skippable expression from the initial parse state.
Fix a bug that could corrupt the parse stack when parsing a non-single-token skippable expression from the initial parse state.
Avoid the problem of huge numbers of repeated left-associative operator applications creating a stack too deep to recurse on by detecting such parses
Avoid the problem of huge numbers of repeated left-associative operator applications creating a stack too deep to recurse on by detecting such parses and force-reducing out of them.
Add support for grammars that use @local tokens declarations.
Fix a bug that made Stack.canShift incorrectly return true in some circumstances.
Fix a bug that made Stack.canShift incorrectly return true in some circumstances.
Fix a tokenizer bug that broke tokenizing of the character \uffff.
Fix a tokenizer bug that broke tokenizing of the character \uffff.
Fix a regression in the way tokenizers read input when parsing multiple separate ranges.
Fix a regression in the way tokenizers read input when parsing multiple separate ranges.
Fix an issue that could cause the tokenizer to crash when tokens ended directly on a gap in the input ranges.
Fix an issue that could cause the tokenizer to crash when tokens ended directly on a gap in the input ranges.
Include LRParser.deserialize in the TypeScript declarations.
Include LRParser.deserialize in the TypeScript declarations.
Fix a bug that broke ParserConfig.specializers (requires @lezer/generator 1.1.1).
External specializers can now be replaced when reconfiguring an LRParser.
External specializers can now be replaced when reconfiguring an LRParser.
Support the output produced by the new @eof marker in lezer-generator.
Support the output produced by the new @eof marker in lezer-generator.
### New features First stable version.
First stable version.
Don't crash when a non-Node environment defines a process global that doesn't have an env property.
Don't crash when a non-Node environment defines a process global that doesn't have an env property.
Fix a bug that could cause partially-parsed nodes to be reused when they ended in skipped nodes, when parsing incrementally.
Fix an issue that could make the parser merge adjacent error nodes even when they had different parent nodes.
Fix an issue that could make the parser merge adjacent error nodes even when they had different parent nodes.
Fix an issue that caused error nodes created for inserted tokens to sometimes end up in the wrong parent node.
Fix an issue that caused error nodes created for inserted tokens to sometimes end up in the wrong parent node.
Avoid the need for generated parser files to directly import @lezer/common.
Avoid the need for generated parser files to directly import @lezer/common.
Fix a bug that caused reductions that didn't consume anything to sometimes end up outside their parent node in the tree.
Fix a bug that caused reductions that didn't consume anything to sometimes end up outside their parent node in the tree.
Fix a bug that could cause some kinds of composite skipped expressions to not be parsed correctly.
Fix a bug that could cause some kinds of composite skipped expressions to not be parsed correctly.
Make sure tree depth does not grow unbounded, so that recursive tree traversal is safe from overflowing the stack.
Make sure tree depth does not grow unbounded, so that recursive tree traversal is safe from overflowing the stack.
Be less agressive about pruning long-running GLR parse splits.
Fix a bug that caused node lookahead to be one less than it should be.
Fix a bug that caused node lookahead to be one less than it should be.
Fix an issue that could cause the parser to, when recovering, parse beyond the position given to stopAt.
Fix a mistake in the way forced reductions are checked.
Fix a mistake in the way forced reductions are checked.
Fix crashes or infinite recursion caused by applying forced reductions in situations where they were not valid.
Fix crashes or infinite recursion caused by applying forced reductions in situations where they were not valid.
Fix a bug where the parse position could get corrupted during a parse, leading to crashes or nonsensical output.
Fix a bug where the parse position could get corrupted during a parse, leading to crashes or nonsensical output.
Fix an inconsistency in the .d.ts emitted by the build.
Fix an inconsistency in the .d.ts emitted by the build.
LRParser.configure now takes a contextTracker option to replace the context tracker used by the parser.
The module's name changed from lezer to @lezer/lr.
The module's name changed from lezer to @lezer/lr.
The Parser class was renamed to LRParser (Parser is now the abstract class that all parsers extend).
Nested parsing is no longer handled inside the LR parser (instead, it is done by using parseMixed from the @lezer/common package as a wrapper).
External tokenizers are passed different arguments and get a different input stream abstraction (to make accidental uncontrolled lookahead and lookbehind, which were easy ways to break incremental parsing, harder).
Drops support for Stack.startOf (which is no longer useful without lookbehind).
Context trackers also get passed different arguments, following the changed input stream format.
This package no longer re-exports bindings from @lezer/common.
Slightly prefer deleting token to inserting them to avoid far-fetched parses.
Fix a problem where node reuse didn't take the amount of look-ahead done by the tokenizer into account, and could reuse nodes whose content would tokenize differently due to changes after them.
Track tokenizer lookahead to fix a problem where some incremental parses would produce incorrect results.
LR parsers now support a wrapper configuration option that allows you to inject additional logic by wrapping the PartialParse object it returns.
Your coding agent can read these notes before it upgrades. Set up the MCP server →