Enum lexx::Token [] [src]

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

Variants

EqLtLeEqEqNeGeGtAndAndOrOrNotTildeBinOp(BinOpToken)BinOpEq(BinOpToken)AtDotDotDotDotDotDotCommaSemiColonModSepRArrowLArrowFatArrowPoundDollarQuestionOpenDelim(DelimToken)

An opening delimiter, eg. {

CloseDelim(DelimToken)

A closing delimiter, eg. }

Literal(LitOption<Name>)Ident(Ident)UnderscoreLifetime(Ident)Interpolated(Nonterminal)DocComment(Name)

Doc comment

MatchNt(IdentIdent)

Parse a nonterminal (name to bind, name of NT)

SubstNt(Ident)

A syntactic variable that will be filled in by macro expansion.

Whitespace

Whitespace

Comment

Comment

Shebang(Name)Eof

Methods

impl Token

fn is_like_gt(&self) -> bool

Returns true if the token starts with '>'.

fn can_begin_expr(&self) -> bool

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

fn is_lit(&self) -> bool

Returns true if the token is any literal

fn is_ident(&self) -> bool

Returns true if the token is an identifier.

fn is_doc_comment(&self) -> bool

Returns true if the token is a documentation comment.

fn is_interpolated(&self) -> bool

Returns true if the token is interpolated.

fn is_path(&self) -> bool

Returns true if the token is an interpolated path.

fn is_lifetime(&self) -> bool

Returns true if the token is a lifetime.

fn is_mutability(&self) -> bool

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

fn is_path_start(&self) -> bool

fn is_keyword(&self, kw: Keyword) -> bool

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

fn is_path_segment_keyword(&self) -> bool

fn is_any_keyword(&self) -> bool

Returns true if the token is either a strict or reserved keyword.

fn is_strict_keyword(&self) -> bool

Returns true if the token is a strict keyword.

fn is_reserved_keyword(&self) -> bool

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

Trait Implementations

impl Debug for Token

fn fmt(&self, __arg_0: &mut Formatter) -> Result<()Error>

impl Hash for Token

fn hash<__H>(&self, __arg_0: &mut __H) where __H: Hasher

impl Eq for Token

impl PartialEq<Token> for Token

fn eq(&self, __arg_0: &Token) -> bool

fn ne(&self, __arg_0: &Token) -> bool

impl Decodable for Token

fn decode<__D>(__arg_0: &mut __D) -> Result<Token, __D::Error> where __D: Decoder

impl Encodable for Token

fn encode<__S>(&self, __arg_0: &mut __S) -> Result<(), __S::Error> where __S: Encoder

impl Clone for Token

fn clone(&self) -> Token