pub struct Token {
pub kind: SyntaxKind,
pub range: TextRange,
pub error: Option<LexError>,
}Expand description
One token, trivia included. Concatenating the ranges of all tokens reproduces the input.
Fields§
§kind: SyntaxKindThe token kind. Lexical errors have kind SyntaxKind::LEX_ERROR,
except unterminated block comments, which keep
SyntaxKind::BLOCK_COMMENT and carry Token::error.
range: TextRangeThe token’s bytes in the input.
error: Option<LexError>Set when SANY’s token manager would fail on this token.
Trait Implementations§
impl Copy for Token
impl Eq for Token
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 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