Expand description
tt
crate defines a TokenTree
data structure: this is the interface (both
input and output) of macros.
The TokenTree
is semantically a tree, but for performance reasons it is stored as a flat structure.
Modules§
- buffer
- Stateful iteration over token trees.
- iter
- A “Parser” structure for token trees. We use this when parsing a declarative macro definition into a list of patterns and templates.
Structs§
- Delim
Span - Delimiter
- Ident
- Identifier or keyword.
- Lit
- Literal
- Punct
- Subtree
- Subtree
Builder Restore Point - Subtree
View - Text
Range - A range in text, represented as a pair of
TextSize
. - Text
Size - A measure of text length. Also, equivalently, an index into text.
- Token
Trees View - TopSubtree
- TopSubtree
Builder
Enums§
- Delimiter
Kind - Ident
IsRaw - Leaf
- LitKind
- Spacing
- Indicates whether a token can join with the following token to form a
compound token. Used for conversions to
proc_macro::Spacing
. Also used to guide pretty-printing, which is where theJointHidden
value (which isn’t part ofproc_macro::Spacing
) comes in useful. - Token
Tree