pub struct Token {
pub kind: TokenKind,
pub span: Span,
pub preceded_by_newline: bool,
}Expand description
A lexed token.
Fields§
§kind: TokenKind§span: Span§preceded_by_newline: boolTrue when a line break separates this token from the previous one.
Newlines are not tokens; the parser reads this flag only where a
statement could end, so most parsing routines never see line breaks.
Line breaks hidden inside a // or /* */ comment count as well, so
commenting out the tail of a line cannot join two statements.
Trait Implementations§
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
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