Tree.iterate
no longer allows returning from inside the iteration (use cursors directly for that kind of use cases).
Subtree
has been renamed to SyntaxNode
and narrowed in scope a little.
The top
, skipped
, and error
node props no longer exist.
The package now offers a TreeCursor
abstraction, which can be used for both regular iteration and for custom traversal of a tree.
SyntaxNode
instances have nextSibling
/prevSibling
getters that allow more direct navigation through the tree.
Node types now expose isTop
, isSkipped
, isError
, and isRepeated
properties that indicate special status.
Adds NodeProp.group
to assign group names to node types.
Syntax nodes now have helper functions getChild
and getChildren
to retrieve direct child nodes by type or group.
NodeType.match
(and thus NodeProp.add
) now allows types to be targeted by group name.
Node types have a new is
method for checking whether their name or one of their groups matches a given string.
Fix lezer depencency versions
Adjust to new output format of repeat rules.
No longer list internal properties in the type definitions.
Drop NodeProp.delim
in favor of NodeProp.openedBy
/closedBy
.
Make the package load as an ES module on node
The package now provides an ES6 module.
Fix a bug that caused applyChanges
to include parts of the old tree that weren't safe to reuse.
Fix bug that would cause tree balancing of deep trees to produce corrupt output.
Bump version along with the rest of the lezer packages.
In applyChanges
, make sure the tree is collapsed all the way to the
nearest non-error node next to the change.
Fix a bug that prevented balancing of repeat nodes when there were skipped nodes present between the repeated elements (which ruined the efficiency of incremental parses).
TreeBuffer
objects now have an iterate
function.
Buffers can optionally be tagged with an (unnamed) node type to allow reusing them in an incremental parse without wrapping them in a tree.
Tree.build
now takes its arguments wrapped in an object. It also expects the buffer content to conform to from lezer 0.7.0's representation of repeated productions.
The repeated
node prop was removed (the parser generator now encodes repetition in the type ids).
NodeProp.add
now also allows a selector object to be passed.
Adds NodeProp.top
, which flags a grammar's outer node type.
Drops the NodeProp.lang
prop (superseded by top
).
Export BufferCursor
again, which was accidentally removed from the exports in 0.3.0.
The iterate
method now takes an object instead of separate parameters.
Introduces node props.
Node types are now objects holding a name, id, and set of props.
Tags are gone again, nodes have plain string names.
Fix incorrect node length calculation in Tree.build
.
Tree nodes are now identified with tags.
New Tag
data structure to represent node tags.
Drop support for grammar ids and node types.
Actually include the .d.ts file in the published package.
First documented release.