/** * Public parser entry points for the TDC DSL. * * Two variants are provided: * - `parse(source)` → returns a ParseResult with tree + diagnostics. * All detected errors are collected; callers decide what to do with * them. Recommended for tooling (editor LSP, linter, CI reporters). * - `parseStrict(source)` → throws `TdcParseError` on any diagnostic, * returns the parse tree otherwise. Recommended for one-shot runs * where any syntax error aborts generation anyway. * * Both variants share the same underlying pipeline (lexer → parser tree) * and the same error-collection logic. */ import { type DocumentContext } from '../generated/TDCParser.js'; import { type ParserDiagnostic } from './errors.js'; export interface ParseResult { readonly tree: DocumentContext; readonly diagnostics: readonly ParserDiagnostic[]; } /** * Parse a TDC source string. Does not throw on syntax errors — use * `result.diagnostics` to inspect them. */ export declare function parse(source: string): ParseResult; /** * Parse a TDC source string. Throws `TdcParseError` with all collected * diagnostics if any lexer/parser error was raised; otherwise returns the * parse tree. */ export declare function parseStrict(source: string): DocumentContext; //# sourceMappingURL=parse.d.ts.map