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(Rc<Nonterminal>), DocComment(Name), SubstNt(Ident), Whitespace, Comment, Shebang(Name), Eof, }
rustc_private
)Variants
Eq
rustc_private
)Lt
rustc_private
)Le
rustc_private
)EqEq
rustc_private
)Ne
rustc_private
)Ge
rustc_private
)Gt
rustc_private
)AndAnd
rustc_private
)OrOr
rustc_private
)Not
rustc_private
)Tilde
rustc_private
)BinOp(BinOpToken)
rustc_private
)BinOpEq(BinOpToken)
rustc_private
)At
rustc_private
)Dot
rustc_private
)DotDot
rustc_private
)DotDotDot
rustc_private
)Comma
rustc_private
)Semi
rustc_private
)Colon
rustc_private
)ModSep
rustc_private
)RArrow
rustc_private
)LArrow
rustc_private
)FatArrow
rustc_private
)Pound
rustc_private
)Dollar
rustc_private
)Question
rustc_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
)Underscore
rustc_private
)Lifetime(Ident)
rustc_private
)Interpolated(Rc<Nonterminal>)
rustc_private
)DocComment(Name)
rustc_private
)Doc comment
SubstNt(Ident)
rustc_private
)A syntactic variable that will be filled in by macro expansion.
Whitespace
rustc_private
)Whitespace
Comment
rustc_private
)Comment
Shebang(Name)
rustc_private
)Eof
rustc_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 can_begin_type(&self) -> bool
rustc_private
)Returns true
if the token can appear at the start of a type.
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_doc_comment(&self) -> bool
rustc_private
)Returns true
if the token is a documentation comment.
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_qpath_start(&self) -> bool
rustc_private
)fn is_path_start(&self) -> bool
rustc_private
)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
rustc_private
)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.
Trait Implementations
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
impl Encodable for Token
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
impl Decodable for Token
[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Token, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
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 Eq 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: Hasher
1.3.0
Feeds a slice of this type into the state provided.