24 lines
755 B
TypeScript
24 lines
755 B
TypeScript
/**
|
|
* @typedef {Readonly<[any[], Iterator<any>]>} ParserState
|
|
*/
|
|
export class ParseError extends Error {
|
|
/**
|
|
* @param {string} message
|
|
* @param {ParserState} state
|
|
* @param {Error} [cause]
|
|
*/
|
|
constructor(message: string, state: ParserState, cause?: Error);
|
|
state: readonly [any[], Iterator<any, any, any>];
|
|
}
|
|
export class State extends Tuple {
|
|
static from(values: any): State;
|
|
constructor(remaining: any, read?: any[]);
|
|
next(): any;
|
|
[Clone](): Readonly<State>;
|
|
}
|
|
export function state(remaining: any, read: any): State;
|
|
export const parse: any;
|
|
export const parseAll: any;
|
|
export type ParserState = Readonly<[any[], Iterator<any>]>;
|
|
import { Tuple } from './tuple.js';
|
|
import { Clone } from './clone.js';
|