import { EditorPosition } from '../classes/editorposition'; export declare class Token { type: string; text: string; line: number; column: number; roundAndSquareBracketDepth: number; /** * Useful for filtering out keyword arguments or array members from the autocomplete feed. */ isInArrayOrFunctionArgument: boolean; constructor(type: string, text: string, isInArrayOrFunctionArgument?: boolean, roundAndSquareBracketDepth?: number, line?: number, column?: number); countOfNewLinesAfter: number; } /** * Tokenize the input string. This is a wrapper around the ANTLR lexer based on **MODIFIED** RoomleGrammar.g4. The changes are: * Comments -> chanel(HIDDEN) * Space - remove \n * add LineBreak: [\n] -> channel(HIDDEN); * build with npm run build:antlr * @param input RoomleScript * @returns tokens */ export declare function tokenizeRoomleScript(input: string): Token[]; /** * Get the token under the cursor, adjusting for the script start position in the file (there are multiple scripts in one file, from which every gets parsed separately). * @param tokens array of tokens * @param lineOfFile line number in the editor file (1-based) * @param columnOfFile column number in the editor file (1-based) * @param scriptStartLine line number where the script starts in the editor file (1-based) * @param scriptStartColumn column number where the script starts in the editor file (1-based) * @returns */ export declare function findRoomleScriptTokenAtPosition(tokens: Token[], position: EditorPosition, scriptStartPosition: EditorPosition): Token | undefined; /** * This searches previous tokens to find the function name for a given token (or index of a token). * Procedure: * - if roundAndSquareBracketDepth is zero, we can not be inside a function call, return unddefined * - search backwards for the first opening round bracket (skipping nested brackets) * - the token before that opening bracket is the function name (if it is an Identifier) is returned * - watch out for another nested function call (another opening round bracket before the closing one) or expressions with brackets * @param tokenOrIndex * @param tokens */ export declare function findFunctionIdentifierOfTokenArgument(tokenOrIndex: number | Token, tokens: Token[]): string | undefined;