pub enum TokenKind {
Show 35 variants
Unknown,
Literal {
kind: LiteralKind,
},
Whitespace,
Ident,
Semi,
Eof,
Slash,
LineComment,
BlockComment {
terminated: bool,
},
Minus,
Colon,
Dot,
Eq,
Gt,
And,
Lt,
Bang,
Plus,
Tilde,
Pound,
Question,
Or,
Percent,
Caret,
Star,
Backtick,
At,
CloseBracket,
OpenBracket,
CloseParen,
OpenParen,
Comma,
UnknownPrefix,
PositionalParam,
QuotedIdent {
terminated: bool,
},
}Variants§
Unknown
Used when there’s an error of some sort while lexing.
Literal
Examples: 12u8, 1.0e-40, b"123". Note that _ is an invalid
suffix, but may be present here on string and float literals. Users of
this type will need to check for and reject that case.
See LiteralKind for more details.
Fields
kind: LiteralKindWhitespace
Space, tab, newline, carriage return, vertical tab, form feed
Ident
Identifier
case-sensitive
Semi
;
Eof
End of file
Slash
/
LineComment
-- foo
BlockComment
/*
foo
*/Minus
-
Colon
:
Dot
.
Eq
=
Gt
>
And
&
Lt
<
Bang
!
Plus
+
Tilde
~
Pound
#
Question
?
Or
|
Percent
%
Caret
^
Star
*
Backtick
`
At
@
CloseBracket
]
OpenBracket
[
CloseParen
)
OpenParen
(
Comma
,
UnknownPrefix
Error case that we need to report later on.
PositionalParam
Positional Parameter, e.g., $1
see: https://www.postgresql.org/docs/16/sql-expressions.html#SQL-EXPRESSIONS-PARAMETERS-POSITIONAL
QuotedIdent
Quoted Identifier, e.g., "update" in update "my_table" set "a" = 5;
These are case-sensitive, unlike TokenKind::Ident
see: https://www.postgresql.org/docs/16/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS