Skip to main content

Module rule

Module rule 

Source

Structs§

AltMatch
Effective result of matching one alternate. Dynamic error/routing/backtrack callbacks are resolved into this record before the modifier runs, matching TypeScript’s AltMatch contract.
AltSpec
Condition
Rule
A rule as the parse loop sees it.
RuleDone
RuleDoneAlt
RuleName
A rule’s name.
RuleSnapshot
RuleSpec

Enums§

ActionBinding
One executable action in its exact declaration position. The mature engines allow named function references and direct callbacks to be mixed; retaining this sequence avoids losing prepend/append order while keeping the serialized a/bo/ao/bc/ac lists available for inspection.
AltActionBinding
CompareOp
RuleState

Type Aliases§

AltAction
Full canonical alternate action. A returned error token aborts the pass; other returned tokens are ignored by the mature engine and should be expressed as None here.
AltBack
Function-valued token backtrack count.
AltBackWithMatch
AltCondition
Function-valued alternate condition. The candidate’s matched tokens have already been copied onto rule when this callback runs.
AltConditionWithLexer
Condition with access to the live lexer. This is the imperative form used by plugins that perform controlled lookahead from a condition.
AltConditionWithLexerAndMatch
Complete canonical condition shape: the live effective match plus access to the lexer for bounded, plugin-controlled lookahead.
AltConditionWithMatch
Canonical condition shape, including the effective match record being assembled for this candidate.
AltError
Function-valued alternate error. Returning a token rejects the alternate at its match site and uses the token’s err/why field as the error code.
AltErrorWithMatch
AltModifier
Post-match alternate modifier. It takes and returns the effective match so replacement is explicit rather than mutating shared grammar state.
AltModifierWithMatch
Full canonical alternate modifier. next is the pre-routing next-rule view (Some(current) during open, None during close). The returned match is the one used for erroring, state mutation, action, and routing.
AltNext
Function-valued push/replace route.
AltNextWithMatch
StateAction
Canonical rule lifecycle callback (bo/ao/bc/ac). next is the rule selected for the following pass, or None for the no-rule sentinel; out is the previous handler’s token result in the same phase.