import { holeNames, HoleInfo } from "../utils/holes.js"; import { Code, kindOf } from "../runtime/template/code.js"; export type { Code }; export { kindOf }; export declare function _parseExpr(source: string): Code; export declare function _parseStatements(source: string): Code; export declare function _toSource(code: Code): string; export declare function _loadTemplate(dir: string, filename: string): Code; export declare function _loadTemplateFromString(source: string): Code; export declare function _holesOf(code: Code): HoleInfo[]; export declare function _fill(code: Code, values: Record): Code; /** * Merge several fragments into one. * * Merging concatenates nodes. The only real question is what kind comes * out, and every answer follows from behavior that already exists. * * An empty merge gives an empty `statements` fragment, matching * `parseStatements("")` and the empty code literal. A single input comes * back unchanged, keeping its kind and doc comment. * * Beyond that: a `program` fragment may not merge with anything else, and * the result is `program` only when every input was. Widening an * expression to a statement is not a new decision, since `fill` already * accepts an `expr` fragment wherever statements go. * * Refusing to widen `program` matters because a declaration and a bare * statement have different placement rules. A silent merge would fail much * later, at the completed program's compile, with no useful position. */ export declare function _combine(codes: Code[]): Code; export { holeNames };