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,
Comma,
Semi,
Colon,
ModSep,
RArrow,
LArrow,
FatArrow,
Pound,
Dollar,
Question,
OpenDelim(DelimToken),
CloseDelim(DelimToken),
Literal(Lit, Option<Name>),
Ident(Ident),
Underscore,
Lifetime(Ident),
Interpolated(Nonterminal),
DocComment(Name),
MatchNt(Ident, Ident),
SubstNt(Ident),
SpecialVarNt(SpecialMacroVar),
Whitespace,
Comment,
Shebang(Name),
Eof,
}rustc_private)Variants
Eqrustc_private)Ltrustc_private)Lerustc_private)EqEqrustc_private)Nerustc_private)Gerustc_private)Gtrustc_private)AndAndrustc_private)OrOrrustc_private)Notrustc_private)Tilderustc_private)BinOp(BinOpToken)rustc_private)BinOpEq(BinOpToken)rustc_private)Atrustc_private)Dotrustc_private)DotDotrustc_private)DotDotDotrustc_private)Commarustc_private)Semirustc_private)Colonrustc_private)ModSeprustc_private)RArrowrustc_private)LArrowrustc_private)FatArrowrustc_private)Poundrustc_private)Dollarrustc_private)Questionrustc_private)OpenDelim(DelimToken)rustc_private)An opening delimiter, eg. {
CloseDelim(DelimToken)rustc_private)A closing delimiter, eg. }
Literal(Lit, Option<Name>)rustc_private)Ident(Ident)rustc_private)Underscorerustc_private)Lifetime(Ident)rustc_private)Interpolated(Nonterminal)rustc_private)DocComment(Name)rustc_private)Doc comment
MatchNt(Ident, Ident)rustc_private)Parse a nonterminal (name to bind, name of NT)
SubstNt(Ident)rustc_private)A syntactic variable that will be filled in by macro expansion.
SpecialVarNt(SpecialMacroVar)rustc_private)A macro variable with special meaning.
Whitespacerustc_private)Whitespace
Commentrustc_private)Comment
Shebang(Name)rustc_private)Eofrustc_private)Methods
impl Token[src]
fn is_like_gt(&self) -> bool
rustc_private)Returns true if the token starts with '>'.
fn can_begin_expr(&self) -> bool
rustc_private)Returns true if the token can appear at the start of an expression.
fn is_lit(&self) -> bool
rustc_private)Returns true if the token is any literal
fn is_ident(&self) -> bool
rustc_private)Returns true if the token is an identifier.
fn is_interpolated(&self) -> bool
rustc_private)Returns true if the token is interpolated.
fn is_path(&self) -> bool
rustc_private)Returns true if the token is an interpolated path.
fn is_lifetime(&self) -> bool
rustc_private)Returns true if the token is a lifetime.
fn is_mutability(&self) -> bool
rustc_private)Returns true if the token is either the mut or const keyword.
fn is_path_start(&self) -> bool
fn to_binop(&self) -> Option<BinOpKind>
rustc_private)Maps a token to its corresponding binary operator.
fn is_keyword(&self, kw: Keyword) -> bool
rustc_private)Returns true if the token is a given keyword, kw.
fn is_path_segment_keyword(&self) -> bool
fn is_any_keyword(&self) -> bool
rustc_private)Returns true if the token is either a strict or reserved keyword.
fn is_strict_keyword(&self) -> bool
rustc_private)Returns true if the token is a strict keyword.
fn is_reserved_keyword(&self) -> bool
rustc_private)Returns true if the token is a keyword reserved for possible future use.
fn mtwt_eq(&self, other: &Token) -> bool
rustc_private)Hygienic identifier equality comparison.
See styntax::ext::mtwt.
Trait Implementations
Derived Implementations
impl Debug for Token[src]
impl Hash for Token[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher1.3.0
Feeds a slice of this type into the state provided.
impl Eq for Token[src]
impl PartialEq for Token[src]
fn eq(&self, __arg_0: &Token) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Token) -> bool
This method tests for !=.
impl Decodable for Token[src]
impl Encodable for Token[src]
impl Clone for Token[src]
fn clone(&self) -> Token
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more