/** * Lossless ClickHouse SQL lexer: concatenating every token's `text` reproduces * the input exactly. It follows ClickHouse's own lexer closely enough to tell * code from strings, quoted identifiers and comments, and names from numbers; * it is not a parser. */ export type SQLTokenKind = 'whitespace' | 'line_comment' | 'block_comment' | 'string' | 'quoted_identifier' | 'identifier' | 'number' | 'punctuation'; export interface SQLToken { kind: SQLTokenKind; /** Exact source text of the token. */ text: string; /** Offset of the first character in the input. */ start: number; /** Offset just past the last character. */ end: number; /** * `false` only for a string, quoted identifier or block comment that runs to * the end of the input without its closing delimiter. */ terminated: boolean; } export declare function tokenizeSQL(sql: string): SQLToken[]; /** Whitespace and comments: tokens that never change what a statement means. */ export declare function isTrivia(token: SQLToken): boolean; /** The name an identifier token denotes: bare text, or the unquoted value. */ export declare function identifierName(token: SQLToken): string | undefined; /** The value of a terminated string literal (`'…'` or a `$tag$…$tag$` heredoc). */ export declare function stringLiteralValue(token: SQLToken): string | undefined; //# sourceMappingURL=sql-lexer.d.ts.map