Skip to main content Link Menu Expand (external link) Document Search Copy Copied

ParseResult overview

Added in v0.6.0


Table of contents


combinators

escalate

Signature

export declare const escalate: <I>(err: ParseError<I>) => ParseError<I>

Added in v0.6.0

extend

Signature

export declare const extend: <I>(err1: ParseError<I>, err2: ParseError<I>) => ParseError<I>

Added in v0.6.0

withExpected

Signature

export declare const withExpected: <I>(err: ParseError<I>, expected: Array<string>) => ParseError<I>

Added in v0.6.0

constructors

error

Signature

export declare const error: <I, A = never>(
  input: Stream<I>,
  expected?: string[] | undefined,
  fatal?: boolean | undefined
) => Either<ParseError<I>, ParseSuccess<I, A>>

Added in v0.6.0

success

Signature

export declare const success: <I, A>(
  value: A,
  next: Stream<I>,
  start: Stream<I>
) => Either<ParseError<I>, ParseSuccess<I, A>>

Added in v0.6.0

model

ParseError (interface)

Signature

export interface ParseError<I> {
  input: Stream<I>
  expected: Array<string>
  fatal: boolean
}

Added in v0.6.0

ParseResult (type alias)

Signature

export type ParseResult<I, A> = Either<ParseError<I>, ParseSuccess<I, A>>

Added in v0.6.0

ParseSuccess (interface)

Signature

export interface ParseSuccess<I, A> {
  value: A
  next: Stream<I>
  start: Stream<I>
}

Added in v0.6.0