Skip to content

v0.20.8

Choose a tag to compare

@odvcencio odvcencio released this 01 Jul 19:01

Added — consumer-controllable forest parsing

Downstream consumers that generate a parser table with grammargen can now opt their own grammar into the GSS-forest GLR fast path without forking gotreesitter, via three surfaces:

  • Language.WantsForest — Go field; gob-serialized, so it's baked into GenerateLanguageAndBlob output and backward-compatible.
  • grammargen.Grammar.WantsForest — Go flag on the grammar IR, plumbed onto the assembled Language.
  • "gotreesitter": { "wantsForest": true } in grammar.json — declarative; read by ImportGrammarJSON and mirrored back by ExportGrammarJSON only when set, so standard grammars' output is byte-unchanged.

Built-in languages keep their curated, byte-range parity-certified forest defaults (behavior unchanged). Consumer opt-in is at the consumer's responsibility — the forest's decline→production fallback still prevents hard failures on declined inputs, but a clean-but-different tree is the consumer's to own. ExtendGrammar inherits the flag from its base grammar.

Full Changelog: v0.20.7...v0.20.8