Expression token state #
This module owns duplicate detection, group state, token decoding, and the canonicalization invariants preserved by each state transition.
Instances For
Accumulated grouping and duplicate-detection state for one expression.
Axis identities already accepted in this expression.
The currently open parenthesized group, if any.
- axesRev : List CompositeAxis
Completed physical axes in reverse source order.
Instances For
Normalize decimal words to their canonical natural-number spelling while leaving structural tokens unchanged.
Instances For
Canonicalizing decimal words does not change whether a token is an arrow.
Canonicalizing decimal words preserves and reflects comma tokens.
Canonical token replacement cannot introduce an arrow into an arrow-free stream.
Construct a source-located duplicate-axis diagnostic.
Instances For
Record one named axis or ellipsis while enforcing the expression's duplicate policy.
Instances For
Successful duplicate registration is independent of the diagnostic source span.
Enforce einops underscore placement while permitting the wildcard _.
Instances For
Interpret one word token as a named, anonymous, or unit axis and update duplicate tracking.
Instances For
Decode and register a bare ellipsis token.
Instances For
Append an axis to the open group or as a new top-level physical axis.
Instances For
Render the parser state's completed axes and any currently open group.
Instances For
Appending an axis to parser state appends its token kind to the rendered state.
Relate parser states that differ only in source spans and canonical decimal spelling.
Instances For
Pushing canonically equal axes preserves canonical parser-state equivalence.
Replacing equal duplicate-tracking lists preserves canonical state equivalence.
Opening corresponding empty groups preserves canonical state equivalence.
Closing corresponding groups preserves canonical token structure despite span changes.
Successful word decoding appends the token's canonical kind to parser state.
Decoding a canonical word spelling succeeds with an equivalent next parser state.
Successful ellipsis decoding appends exactly one ellipsis token kind.
Re-decoding an ellipsis at a new span preserves canonical parser state.