UNPKG

fruitsconfits

Version:

FruitsConfits - A well typed and sugared parser combinator framework for TypeScript/JavaScript.

60 lines (59 loc) 4.96 kB
import { StringParserFnWithCtx } from './types'; import { ApplyProductionRulesArg, makeProgram } from './parser'; export declare function charSequence<C, R>(helper: (token: string) => R): (needle: string) => StringParserFnWithCtx<C, R>; export declare function charClass<C, R>(helper: (token: string) => R): (...needles: string[]) => StringParserFnWithCtx<C, R>; export declare function charClassNot<C, R>(helper: (token: string) => R): (...needles: string[]) => StringParserFnWithCtx<C, R>; export declare function charClassByNeedleFn<C, R>(helper: (token: string) => R): (needle: (src: string) => number) => StringParserFnWithCtx<C, R>; export declare function templateStringsParam<C, R>(criteria: (o: any) => boolean, conv?: (o: any) => any): StringParserFnWithCtx<C, R>; export declare function getStringParsers<C, R>(params: { rawToToken: (rawToken: string) => R; concatTokens: (tokens: R[]) => R[]; }): { seq: (needle: string) => import("./types").ParserFnWithCtx<string, C, R>; cls: (...needles: string[]) => import("./types").ParserFnWithCtx<string, C, R>; notCls: (...needles: string[]) => import("./types").ParserFnWithCtx<string, C, R>; clsFn: (needle: (src: string) => number) => import("./types").ParserFnWithCtx<string, C, R>; classes: { alpha: import("./types").ParserFnWithCtx<string, C, R>; upper: import("./types").ParserFnWithCtx<string, C, R>; lower: import("./types").ParserFnWithCtx<string, C, R>; num: import("./types").ParserFnWithCtx<string, C, R>; nonzero: import("./types").ParserFnWithCtx<string, C, R>; bin: import("./types").ParserFnWithCtx<string, C, R>; oct: import("./types").ParserFnWithCtx<string, C, R>; hex: import("./types").ParserFnWithCtx<string, C, R>; alnum: import("./types").ParserFnWithCtx<string, C, R>; space: import("./types").ParserFnWithCtx<string, C, R>; spaceWithinSingleLine: import("./types").ParserFnWithCtx<string, C, R>; ctrl: import("./types").ParserFnWithCtx<string, C, R>; newline: import("./types").ParserFnWithCtx<string, C, R>; word: import("./types").ParserFnWithCtx<string, C, R>; any: import("./types").ParserFnWithCtx<string, C, R>; }; numbers: { bin: (...prefixes: Array<StringParserFnWithCtx<C, R>>) => import("./types").ParserFnWithCtx<string, C, R>; oct: (...prefixes: Array<StringParserFnWithCtx<C, R>>) => import("./types").ParserFnWithCtx<string, C, R>; hex: (...prefixes: Array<StringParserFnWithCtx<C, R>>) => import("./types").ParserFnWithCtx<string, C, R>; int: import("./types").ParserFnWithCtx<string, C, R>; bigint: import("./types").ParserFnWithCtx<string, C, R>; float: import("./types").ParserFnWithCtx<string, C, R>; }; isParam: typeof templateStringsParam; cat: (...parsers: import("./types").ParserFnWithCtx<string, C, R>[]) => import("./types").ParserFnWithCtx<string, C, R>; once: (parser: import("./types").ParserFnWithCtx<string, C, R>) => import("./types").ParserFnWithCtx<string, C, R>; repeat: (parser: import("./types").ParserFnWithCtx<string, C, R>) => import("./types").ParserFnWithCtx<string, C, R>; qty: (min?: number | undefined, max?: number | undefined) => (parser: import("./types").ParserFnWithCtx<string, C, R>) => import("./types").ParserFnWithCtx<string, C, R>; zeroWidth: (helper?: (() => R) | undefined) => import("./types").ParserFnWithCtx<string, C, R>; err: (message: string) => import("./types").ParserFnWithCtx<string, C, R>; beginning: (helper?: (() => R) | undefined) => import("./types").ParserFnWithCtx<string, C, R>; end: (helper?: (() => R) | undefined) => import("./types").ParserFnWithCtx<string, C, R>; first: (...parsers: Array<StringParserFnWithCtx<C, R>>) => import("./types").ParserFnWithCtx<string, C, R>; or: (...parsers: Array<StringParserFnWithCtx<C, R>>) => import("./types").ParserFnWithCtx<string, C, R>; combine: (...parsers: import("./types").ParserFnWithCtx<string, C, R>[]) => import("./types").ParserFnWithCtx<string, C, R>; erase: (...parsers: import("./types").ParserFnWithCtx<string, C, R>[]) => import("./types").ParserFnWithCtx<string, C, R>; trans: (fn: (tokens: R[]) => R[]) => (...parsers: import("./types").ParserFnWithCtx<string, C, R>[]) => import("./types").ParserFnWithCtx<string, C, R>; ahead: (...parsers: Array<StringParserFnWithCtx<C, R>>) => import("./types").ParserFnWithCtx<string, C, R>; behind: (n: number, helper?: (() => R) | undefined) => (...parsers: import("./types").ParserFnWithCtx<string, C, R>[]) => import("./types").ParserFnWithCtx<string, C, R>; rules: (args: ApplyProductionRulesArg<string, C, R>) => (lexer: import("./types").ParserFnWithCtx<string, C, R>) => import("./types").ParserFnWithCtx<string, C, R>; makeProgram: typeof makeProgram; };