Module rustc_ap_rustc_ast::tokenstream [−][src]
Expand description
Token Streams
TokenStream
s represent syntactic objects before they are converted into ASTs.
A TokenStream
is, roughly speaking, a sequence of TokenTree
s,
which are themselves a single Token
or a Delimited
subsequence of tokens.
Ownership
TokenStream
s are persistent data structures constructed as ropes with reference
counted-children. In general, this means that calling an operation on a TokenStream
(such as slice
) produces an entirely new TokenStream
from the borrowed reference to
the original. This essentially coerces TokenStream
s into “views” of their subparts,
and a borrowed TokenStream
is sufficient to build an owned TokenStream
without taking
ownership of the original.
Structs
AttrAnnotatedTokenStream | A |
AttributesData | Stores the tokens for an attribute target, along with its attributes. |
Cursor | Owning by-value iterator over a |
CursorRef | By-reference iterator over a |
DelimSpan | |
LazyTokenStream | A lazy version of |
TokenStream | A |
TokenStreamBuilder |
Enums
AttrAnnotatedTokenTree | Like |
CanSynthesizeMissingTokens | |
Spacing | |
TokenTree | When the main Rust parser encounters a syntax-extension invocation, it parses the arguments to the invocation as a token tree. This is a very loose structure, such that all sorts of different AST fragments can be passed to syntax extensions using a uniform type. |
Traits
CreateTokenStream |
Type Definitions
TreeAndSpacing |