Struct lib_ruby_parser::Token [−][src]
#[repr(C)]pub struct Token {
pub token_type: i32,
pub token_value: Bytes,
pub loc: Loc,
pub lex_state_before: LexState,
pub lex_state_after: LexState,
}
Expand description
A token that is emitted by a lexer and consumed by a parser
Fields
token_type: i32
Numeric representation of the token type, e.g. 42 (for example) for tINTEGER
token_value: Bytes
Value of the token, e.g “42” for 42
loc: Loc
Location of the token
lex_state_before: LexState
Lex state before reading the token
lex_state_after: LexState
Lex state after reading the token
Implementations
Consumes a token and returns an owned byte array of the token value
Converts token value into &str
Converts token to a string, replaces unknown chars to U+FFFD
Converts token to a string
Consumes a token and converts it into a string
Returns name of the token
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Token
impl UnwindSafe for Token
Blanket Implementations
Mutably borrows from an owned value. Read more