pub enum TokenKind {
Show 18 variants
Eof,
Identifier,
QuotedIdentifier,
Verbatim,
String,
Number,
Comment,
Operator,
Dot,
OpenParen,
CloseParen,
OpenBracket,
CloseBracket,
OpenBrace,
CloseBrace,
Comma,
Semicolon,
Unknown,
}Expand description
What a Token is.
Variants§
Eof
End of input. Always the last token; text is empty.
Identifier
Source, let, Table.SelectRows, #table, Server.Name — keywords,
dotted names, and the #-prefixed keyword family are all identifiers
here; whether a word means a keyword or a name is resolution’s business,
not the lexer’s.
QuotedIdentifier
#"1998 Sales" — a quoted identifier, "" as the escape.
Verbatim
#!"not parsed" — a verbatim literal (evaluates to an error value).
String
"text" — a text literal, "" as the escape.
Number
1, 1.5, 1.5E-10, 0xff.
Comment
// … or /* … */ — never produces a reference.
Operator
= < > <= >= <> + - * / & @ ! ? ?? => .. ...
Dot
. on its own — a dot that did not absorb into an identifier.
OpenParen
(
CloseParen
)
OpenBracket
[ — opens a field access ([Name]) or a record literal ([K = V]);
the extractor tells the two apart.
CloseBracket
]
OpenBrace
{
CloseBrace
}
Comma
,
Semicolon
;
Unknown
Any other character. Never fails the scan.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.