Expand description
Parse tracing: log events as the parser runs.
The canonical TypeScript runtime defines SIX selectable kinds —
step, rule, lex, parse, node, stack — driven by the
engine’s ctx.log callback. The Rust engine has no ctx.log; it
exposes typed subscribers instead, so each kind is wired to the
subscriber that carries its information:
| Kind | Rust source |
|---|---|
lex | subscribe_lex |
rule | subscribe_rules |
stack | subscribe_rules (the context’s rule stack) |
parse | subscribe_rule_done (the matched alternate) |
node | subscribe_rule_done (the completed node) |
step | no engine hook — see below |
step is the raw passthrough kind: in TypeScript the engine itself
calls ctx.log('step', …) once per parse step. The Rust engine emits
no such event, so selecting step here is accepted (the option name
stays in step with the other runtimes) but nothing is ever logged for
it. That is an engine-API limit, recorded in docs/reference.md.
Structs§
- Trace
Kinds - Which trace kinds are logged.
Constants§
- TRACE_
BANNER - The banner written once at the start of each traced parse.