parser_gleam/parse_result

Types

pub type ParseError(i) {
  ParseError(
    input: Stream(i),
    expected: List(String),
    fatal: Bool,
  )
}

Constructors

  • ParseError(input: Stream(i), expected: List(String), fatal: Bool)
pub type ParseResult(i, a) =
  Result(ParseSuccess(i, a), ParseError(i))
pub type ParseSuccess(i, a) {
  ParseSuccess(value: a, next: Stream(i), start: Stream(i))
}

Constructors

  • ParseSuccess(value: a, next: Stream(i), start: Stream(i))

Functions

pub fn error(input: Stream(a), expected: Option(List(String)), fatal: Option(
    Bool,
  )) -> Result(ParseSuccess(a, b), ParseError(a))
pub fn escalate(err: ParseError(a)) -> ParseError(a)
pub fn extend(err1: ParseError(a), err2: ParseError(a)) -> ParseError(
  a,
)
pub fn success(value: a, next: Stream(b), start: Stream(b)) -> Result(
  ParseSuccess(b, a),
  ParseError(b),
)
pub fn with_expected(err: ParseError(a), expected: List(String)) -> ParseError(
  a,
)
Search Document