#[non_exhaustive]pub enum TokenKind {
Whitespace,
Newline,
Indent,
LineComment,
BlockComment,
String,
Interpolation,
Number,
Identifier,
Regex,
Punctuation,
Unterminated,
}Expand description
What a token is, at the lexical level only.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Whitespace
Spaces and tabs; newlines are their own kind.
Newline
Indent
Leading whitespace of a line in an indentation-sensitive language.
LineComment
BlockComment
String
String, character, template or raw-string literal, quotes included.
Interpolation
Interpolated section of a template literal, ${ and } included.
Number
Identifier
Regex
Regular-expression literal in languages that have them.
Punctuation
Unterminated
A block comment or string that the file ends inside.
Trait Implementations§
impl Copy for TokenKind
impl Eq for TokenKind
impl StructuralPartialEq for TokenKind
Auto Trait Implementations§
impl Freeze for TokenKind
impl RefUnwindSafe for TokenKind
impl Send for TokenKind
impl Sync for TokenKind
impl Unpin for TokenKind
impl UnsafeUnpin for TokenKind
impl UnwindSafe for TokenKind
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