Expand description
Structural boundary and grouping Tokel Transformers.
This module provides transformers for modifying the structural hierarchy and boundaries of token streams.
§Available Transformers
| Transformer | Argument Type | Description |
|---|---|---|
Flatten | syn::parse::Nothing | Recursively removes all (), {}, and [] boundaries, flattening into a 1D stream. |
Encapsulate | EncapsulateGroup | Wraps the entire input stream inside the delimiter type of the provided argument. |
§Argument Types
syn::parse::Nothing- No argument is required.EncapsulateGroup- A single, empty token group (e.g.,(),{}, or[]) that specifies the target encapsulation delimiter.
§Examples
Basic Usage:
[< (()) [[Hello]] ([{ AA }]) >]:flatten->Hello AA[< Hello >]:encapsulate[[()]]->(Hello)
§Remarks
Flattenrecursively traverses all nested groups within the token stream and extracts their inner contents, resulting in a single, flat, one-dimensional token sequence.Encapsulatetakes the entire evaluated input stream and places it directly inside a new group matching the delimiter provided in the argument.
Structs§
- Encapsulate
- Wraps the entire input stream in the delimiter type of the provided argument
Group. - Encapsulate
Group - The argument type used for the
Encapsulatepass. - Flatten
- Recursively removes all
(),{}, and[]boundaries, flattening into a 1D stream.
Functions§
- register
- Inserts all
structure-relatedTransformers into the specifiedRegistry.