Expand description
GoogleSQL (BigQuery) lexer.
tokenize returns the significant tokens; tokenize_with_trivia also returns whitespace and
comments so a formatter can lay the text out again without losing anything. Every token keeps
its byte Span in the source and its exact source text.
Structs§
Enums§
- Comment
Kind - The kind of comment.
- Punct
- Punctuation and operators.
- Quote
Style - Which quotes delimit a string, bytes literal or quoted name.
- Token
Kind - What a token is.
Constants§
- RESERVED_
KEYWORDS - GoogleSQL reserved keywords: never an unquoted identifier (except after a
.).
Functions§
- comments
- The comments of
sql, in order. - escape_
identifier - Escape
valuefor a backtick-quoted identifier. - escape_
string - Escape
valuefor a non-raw GoogleSQL string withquote. - is_
reserved_ keyword - Whether
wordis a GoogleSQL reserved keyword (case-insensitive). - tokenize
- The significant tokens of
sql(no whitespace or comments). - tokenize_
extended - Like
tokenize, with$allowed inside identifiers (EXPR$0) and at the start of a name ($f1). - tokenize_
with_ trivia - Every token of
sql, whitespace and comments included, in order. Concatenating their texts givessql.