Enum syntax::parse::token::Token[][src]

pub enum Token {
    Eq,
    Lt,
    Le,
    EqEq,
    Ne,
    Ge,
    Gt,
    AndAnd,
    OrOr,
    Not,
    Tilde,
    BinOp(BinOpToken),
    BinOpEq(BinOpToken),
    At,
    Dot,
    DotDot,
    DotDotDot,
    DotDotEq,
    DotEq,
    Comma,
    Semi,
    Colon,
    ModSep,
    RArrow,
    LArrow,
    FatArrow,
    Pound,
    Dollar,
    Question,
    SingleQuote,
    OpenDelim(DelimToken),
    CloseDelim(DelimToken),
    Literal(LitOption<Name>),
    Ident(Identbool),
    Lifetime(Ident),
    Interpolated(Lrc<(Nonterminal, LazyTokenStream)>),
    DocComment(Name),
    Whitespace,
    Comment,
    Shebang(Name),
    Eof,
}

Variants

Used by proc macros for representing lifetimes, not generated by lexer right now.

An opening delimiter, eg. {

A closing delimiter, eg. }

Doc comment

Whitespace

Comment

Methods

impl Token
[src]

Recovers a Token from an ast::Ident. This creates a raw identifier if necessary.

Returns true if the token starts with '>'.

Returns true if the token can appear at the start of an expression.

Returns true if the token can appear at the start of a type.

Returns true if the token can appear at the start of a generic bound.

Returns true if the token is any literal

Returns true if the token is any literal, a minus (which can follow a literal, for example a '-42', or one of the boolean idents).

Returns an identifier if this token is an identifier.

Returns a lifetime identifier if this token is a lifetime.

Returns true if the token is an identifier.

Returns true if the token is a lifetime.

Returns true if the token is a identifier whose name is the given string slice.

Returns true if the token is a documentation comment.

Returns true if the token is interpolated.

Returns true if the token is an interpolated path.

Returns true if the token is either the mut or const keyword.

Returns true if the token is a given keyword, kw.

Returns true if the token is a keyword used in the language.

Returns true if the token is a keyword reserved for possible future use.

Returns true if the token is either a special identifier or a keyword.

Returns tokens that are likely to be typed accidentally instead of the current token. Enables better error recovery when the wrong token is found.

Trait Implementations

impl Clone for Token
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Encodable for Token
[src]

impl Decodable for Token
[src]

impl PartialEq for Token
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Token
[src]

impl Hash for Token
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for Token
[src]

Formats the value using the given formatter. Read more

impl From<Token> for TokenStream
[src]

Performs the conversion.

Auto Trait Implementations

impl !Send for Token

impl !Sync for Token