UNPKG

parjs

Version:

A parser-combinator library for JavaScript.

48 lines (47 loc) 1.89 kB
/** * @module parjs/combinators */ /** */ import { ImplicitParjser, ParjsCombinator } from "../../index"; /** * Applies the source parser followed by `next`. Yields the result of * `next`. * @param next */ export declare function qthen<T>(next: ImplicitParjser<T>): ParjsCombinator<any, T>; /** * Applies the source parser followed by `next`. Yields the result of * the source parser. * @param next */ export declare function thenq<T>(next: ImplicitParjser<any>): ParjsCombinator<T, T>; /** * Applies the source parser followed by `next`. Yields the results of * both in an array. * @param next */ export declare function then<A, B>(next: ImplicitParjser<B>): ParjsCombinator<A, [A, B]>; /** * Applies the source parser, followed by `next1` and then `next2`. Yields the * results of all in an array. * @param next1 The 2nd parser to apply. * @param next2 The 3rd parser to apply. */ export declare function then<A, B, C>(next1: ImplicitParjser<B>, next2: ImplicitParjser<C>): ParjsCombinator<A, [A, B, C]>; /** * Applies the source parser, followed by three other parsers. Yields the * results of all in an array. * @param next1 The 2nd parser to apply. * @param next2 The 3rd parser to apply. * @param next3 The 4th parser to apply. */ export declare function then<A, B, C, D>(next1: ImplicitParjser<B>, next2: ImplicitParjser<C>, next3: ImplicitParjser<D>): ParjsCombinator<A, [A, B, C, D]>; /** * Applies the source parser, followed by four other parsers. Yields the results * of all in an array. * @param next1 The 2nd parser to apply. * @param next2 The 3rd parser to apply. * @param next3 The 4th parser to apply. * @param next4 The 5th parser to apply. */ export declare function then<A, B, C, D, E>(next1: ImplicitParjser<B>, next2: ImplicitParjser<C>, next3: ImplicitParjser<D>, next4: ImplicitParjser<E>): ParjsCombinator<A, [A, B, C, D, E]>;