UNPKG

rawsql-ts

Version:

[beta]High-performance SQL parser and AST analyzer written in TypeScript. Provides fast parsing and advanced transformation capabilities.

22 lines (21 loc) 887 B
import { Lexeme } from "../models/Lexeme"; /** * Utility functions for handling comments in parsers */ export declare class CommentUtils { /** * Collects comments from preceding tokens that are associated with a specific keyword. * This function looks for comments in tokens before the current position that might * be related to the current clause. * * @param lexemes Array of lexemes * @param currentIndex Index of the current keyword token * @param keywordValue Expected keyword value (e.g., 'from', 'where') * @returns Array of comments associated with this clause */ static collectClauseComments(lexemes: Lexeme[], currentIndex: number, keywordValue: string): string[] | null; /** * Checks if a token value is a significant SQL keyword that would separate clauses */ private static isSignificantSqlKeyword; }