lezer-parser / lezer

Dev utils and issues for the Lezer core packages
33 stars 1 forks source link

Consider supporting a 'compress' action on stacks #3

Closed marijnh closed 4 months ago

marijnh commented 3 years ago

Right now, when taking the tree from a running parse, then continuing to run it, and taking the tree again, all nodes are recreated. It might be useful if the parser automatically, when the output buffer reaches a certain length and there's only one active stack, converted all finished nodes to Tree objects and rewrote its stack to refer to those.

marijnh commented 4 months ago

@codemirror/language no longer uses this pattern, and will restart parses after it has stopped them early to get a tree. Closing.