Troubleshooting โ
error.NoLanguage from parse โ
Call setLanguage first. It also validates the ABI โ IncompatibleAbiVersion means the tables target an ABI outside 13โ15.
Tree has errors on input I expected to parse โ
- Print the tree (
examples/tree_walk.zigpattern) and look forERROR/MISSINGnodes. - Check token coverage: characters no matcher accepts become skipped error bytes.
- Check table coverage: the grammar tables must define an action for every reachable
(state, token)pair.
Query compiles but matches nothing โ
- Top-level patterns match anywhere, but nested patterns need direct children โ
(program (number))fails when anumberis nested deeper. - Anonymous tokens match only non-named nodes;
(+)never matches anidentifier. - Field names must come from the language's field map for that production.
Query compile errors โ
UnexpectedTokenusually means unbalanced parentheses or a stray!assertion.InvalidPredicatemeans the#name?is unknown โ see the supported list.- An empty query source is
UnexpectedEof, not an empty query.
Changed ranges are empty after an edit โ
Same-span text substitutions (e.g. 2 โ 3) change no positions or structure, so there is structurally nothing to report. Insertions, deletions, and span changes report normally.
Leaks reported by the testing allocator โ
Every owning object needs deinit: parser, trees, cursors, queries, query cursors, and changed-range slices. Nodes never need cleanup.
Still stuck? โ
- Enable
parser.setLogger(.{ .level = .debug })and re-run. - Open an issue at the repository with the source, the grammar tables version, and the tree dump.
