Debugging โ
- Tree dumps: walk with
tree.cursor()printingnodeType+ spans (thetree_walkexample pattern) โ most "wrong tree" reports become obvious here. - Loggers:
parser.setLogger(.{ .level = .debug })streams shifts, reductions, recovery, and reuse decisions;.traceadds lexer events. - Tracers:
Tracerrecords structured events for programmatic inspection and replay. - Bisection: shrink the source to the smallest failing span, then check token coverage (unmatched bytes) and table coverage (missing actions) at that state.
Related: Logging, Troubleshooting, Debugging examples.
