/** * Standalone tooling functions for tokenizing, parsing, and analysis. * * These are thin wrappers around internal utilities that do not require * a Dvala instance. */ import { AutoCompleter } from './AutoCompleter/AutoCompleter'; import type { AutoCompleterParams } from './AutoCompleter/AutoCompleter'; import type { DvalaModule } from './builtin/modules/interface'; import type { TokenStream } from './tokenizer/tokenize'; import type { RecoverableParseResult } from './parser'; import type { Ast } from './parser/types'; import { untokenize } from './untokenizer'; export type { TokenStream }; /** * Tokenize a Dvala source string into a token stream. * Pass `debug: true` to capture source positions (needed for the debugger). */ export declare function tokenizeSource(source: string, debug?: boolean, filePath?: string): TokenStream; /** * Parse a token stream into an AST. * The stream is automatically minified (whitespace removed) before parsing. */ export declare function parseTokenStream(tokenStream: TokenStream): Ast; /** * Parse a token stream with error recovery. * Returns a partial AST (successfully parsed statements) and a list of errors. * Useful for language service features that need to work on broken files. */ export declare function parseTokenStreamRecoverable(tokenStream: TokenStream): RecoverableParseResult; /** * Convert a token stream back to source code. */ export { untokenize }; /** * Transform all symbol tokens in a token stream using the provided function. */ export declare function transformSymbols(tokenStream: TokenStream, transformer: (symbol: string) => string): TokenStream; /** * Get all undefined symbols in a Dvala program. * * @param source - Dvala source code * @param options - optional context * @param options.scope - host bindings to treat as defined * @param options.modules - modules to treat as available */ export declare function getUndefinedSymbols(source: string, options?: { scope?: Record; modules?: DvalaModule[]; }): Set; /** * Create an auto-completer for the given program at the given cursor position. * * @param program - Full Dvala source code * @param position - Cursor position (character offset) * @param params - Optional params (bindings to include as suggestions) */ export declare function getAutoCompleter(program: string, position: number, params?: AutoCompleterParams): AutoCompleter; export { format as formatSource } from './formatter/format'; export { parseToCst } from './parser'; export { buildDocTree } from './formatter/cstFormat';