UNPKG

@thi.ng/parse

Version:

Purely functional parser combinators & AST generation for generic inputs

19 lines 606 B
import type { DynamicParser } from "../api.js"; /** * Returns a parser function placeholder, whose implementation can be set at a * later stage via calling `.set()`. The parser always fails until set, after * which it then delegates to the chosen impl. * * @example * ```ts tangle:../../export/dynamic.ts * import { defContext, dynamic,lit } from "@thi.ng/parse"; * * const parser = dynamic<string>(); * parser.set(lit("a")); * * console.log(parser(defContext("a"))); * // true * ``` */ export declare const dynamic: <T = string>() => DynamicParser<T>; //# sourceMappingURL=dynamic.d.ts.map