Crate ra_ap_tt

Source
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§

DelimSpan
Delimiter
Ident
Identifier or keyword.
Lit
Literal
Punct
Subtree
SubtreeBuilderRestorePoint
SubtreeView
TextRange
A range in text, represented as a pair of TextSize.
TextSize
A measure of text length. Also, equivalently, an index into text.
TokenTreesView
TopSubtree
TopSubtreeBuilder

Enums§

DelimiterKind
IdentIsRaw
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 the JointHidden value (which isn’t part of proc_macro::Spacing) comes in useful.
TokenTree

Constants§

MAX_GLUED_PUNCT_LEN

Functions§

pretty
token_to_literal