Expand description
Modules§
Structs§
- AttrToken Stream 
- An AttrTokenStreamis similar to aTokenStream, but with extra information about the tokens for attribute targets. This is used during expansion to perform early cfg-expansion, and to process attributes during proc-macro invocations.
- AttrsTarget 
- Stores the tokens for an attribute target, along with its attributes.
- DelimSpacing 
- DelimSpan 
- LazyAttr Token Stream 
- A lazy version of AttrTokenStream, which defers creation of an actualAttrTokenStreamuntil it is needed.
- NodeRange 
- A token range within an individual AST node’s (lazy) token stream, i.e.
relative to that node’s first token. Distinct from ParserRangeso the two kinds of range can’t be mixed up.
- ParserRange 
- A token range within a Parser’s full token stream.
- TokenCursor 
- A TokenStreamcursor that producesTokens. It’s a bit odd that we (a) lex tokens into a nice tree structure (TokenStream), and then (b) use this type to emit them as a linear sequence. But a linear sequence is what the parser expects, for the most part.
- TokenStream 
- A TokenStreamis an abstract sequence of tokens, organized intoTokenTrees.
- TokenStream Iter 
- TokenTree Cursor 
Enums§
- AttrToken Tree 
- Like TokenTree, but forAttrTokenStream.
- FlatToken 🔒
- A helper struct used when building an AttrTokenStreamfrom aLazyAttrTokenStream. Both delimiter and non-delimited tokens are stored asFlatToken::Token. A vector ofFlatTokens is then ‘parsed’ to build up anAttrTokenStreamwith nestedAttrTokenTree::Delimitedtokens.
- LazyAttr 🔒Token Stream Inner 
- 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 theJointHiddenvalue (which isn’t part ofproc_macro::Spacing) comes in useful.
- TokenTree 
- Part of a TokenStream.
Functions§
- _dummy 🔒
- attrs_and_ 🔒tokens_ to_ token_ trees 
- make_attr_ 🔒token_ stream 
- Converts a flattened iterator of tokens (including open and close delimiter tokens) into an
AttrTokenStream, creating anAttrTokenTree::Delimitedfor each matching pair of open and close delims.
Type Aliases§
- NodeReplacement 
- See the comment on ParserReplacement.
- ParserReplacement 
- Indicates a range of tokens that should be replaced by an AttrsTarget(replacement) or be replaced by nothing (deletion). This is used in two places during token collection.