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 !Send for Token
impl !Sync for Token
impl Forget for Token
impl Freeze for Token
impl Move for Token
impl RefUnwindSafe for Token
impl Unpin for Token
impl UnsafeUnpin for Tokenwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const RcInner<[u8]> is !null: UnsafeUnpin,
PhantomData<RcInner<[u8]>>: UnsafeUnpin,
*const RcInner<Vec<u8>> is !null: UnsafeUnpin,
PhantomData<RcInner<Vec<u8>>>: UnsafeUnpin,
impl UnwindSafe for Token
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