rawsql-ts
Version:
[beta]High-performance SQL parser and AST analyzer written in TypeScript. Provides fast parsing and advanced transformation capabilities.
44 lines (43 loc) • 1.26 kB
TypeScript
/**
* Utilities for string operations during tokenization
*/
export declare class StringUtils {
/**
* Creates a visual representation of an error position in text
* @param input The input text
* @param errPosition The error position
* @returns A string with a caret pointing to the error position
*/
static getDebugPositionInfo(input: string, errPosition: number): string;
/**
* Skip white space characters.
*/
private static skipWhiteSpace;
/**
* Skip line comment.
*/
private static readLineComment;
/**
* Skip block comment.
*/
private static readBlockComment;
/**
* Skip white space characters and SQL comments.
* @returns Object containing the new position and an array of skipped comments
*/
static readWhiteSpaceAndComment(input: string, position: number): {
position: number;
lines: string[];
};
/**
* Read a regular identifier.
*/
static readRegularIdentifier(input: string, position: number): {
identifier: string;
newPosition: number;
};
static tryReadRegularIdentifier(input: string, position: number): {
identifier: string;
newPosition: number;
} | null;
}