pub struct Token {
pub kind: TokenKind,
pub span: Span,
pub newline_before: bool,
pub escaped: bool,
}Expand description
A token plus where it came from.
Fields§
§kind: TokenKindToken payload.
span: SpanSource range of the token.
newline_before: boolWhether a line terminator appeared between the previous token and this one (drives Automatic Semicolon Insertion and restricted productions).
escaped: boolWhether the token’s spelling used a \u escape.
A contextual keyword written with one is only an identifier: {\u0067et x() {}} is
not a getter. Reserved words are rejected by the lexer instead, so this only has to
answer for the handful of words that mean something by position.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Forget for Token
impl Freeze for Token
impl Move for Token
impl RefUnwindSafe for Token
impl Send for Tokenwhere
RawVecInner: Send,
impl Sync for Tokenwhere
RawVecInner: Sync,
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Tokenwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more