pub enum DirectiveAction {
None,
Call(ActionFn),
Token(TokenActionFn),
Path(String),
}Expand description
How a directive transforms its parsed body.
Mirrors the TypeScript action: StateAction | string option: a
callback, or a dotted path resolved against the parser options when the
directive fires.
Variants§
None
No action — the directive’s node stays the empty map seeded by the
rule’s bo hook.
Call(ActionFn)
A classic action: set rule.node to the result value.
Token(TokenActionFn)
An action that may return a token for the close hook to forward.
Path(String)
A dotted path resolved against the parser options at directive-execution time; the resolved value becomes the directive’s node.
The TypeScript options object is open, so TS resolves the path from
its top level. The Rust Options struct is closed — like Go’s —
so the path is resolved in the plugin-options namespace
(TS options.plugin): "custom.x" reads
parser.plugin_options("custom")["x"].