Enum lexx::TokenTree [] [src]

pub enum TokenTree {
    Token(SpanToken),
    Delimited(SpanRc<Delimited>),
    Sequence(SpanRc<SequenceRepetition>),
}

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.

If the syntax extension is an MBE macro, it will attempt to match its LHS token tree against the provided token tree, and if it finds a match, will transcribe the RHS token tree, splicing in any captured macro_parser::matched_nonterminals into the SubstNts it finds.

The RHS of an MBE macro is the only place SubstNts are substituted. Nothing special happens to misnamed or misplaced SubstNts.

Variants

A single token

A delimited sequence of token trees

A kleene-style repetition sequence with a span

Methods

impl TokenTree
[src]

Returns the Span corresponding to this token tree.

Use this token tree as a matcher to parse given tts.

Check if this TokenTree is equal to the other, regardless of span information.

Retrieve the TokenTree's span.

Indicates if the stream is a token that is equal to the provided token.

Indicates if the token is an identifier.

Returns an identifier.

Returns a Token literal.

Returns an AST string literal.

Trait Implementations

impl Debug for TokenTree
[src]

impl Clone for TokenTree
[src]

impl Decodable for TokenTree
[src]

impl Encodable for TokenTree
[src]

impl PartialEq<TokenTree> for TokenTree
[src]

impl Eq for TokenTree
[src]

impl ToTokens for TokenTree
[src]

impl Hash for TokenTree
[src]