Skip to main content

Module token

Module token 

Source
Expand description

Token types for SQL lexer

This module defines the token types used by the SQL lexer and parser.

Structs§

Position
Position represents a position in the input source
Token
Token represents a lexical token

Enums§

TokenType
TokenType represents the type of a token

Statics§

KEYWORDS
SQL keywords (case-insensitive)
OPERATORS
SQL operators
PUNCTUATORS
SQL punctuators

Functions§

is_keyword
Check if a string is an SQL keyword (case-insensitive) Uses a compiled HashSet for O(1) lookups instead of O(n) linear search
is_operator
Check if a string is an SQL operator
is_operator_char
Characters that can be part of an operator
is_punctuator
Check if a character is an SQL punctuator
punctuator_str
Get a static string for a punctuator character (avoids allocation) Returns None if the character is not a punctuator