nibble/pratt

Types

pub opaque type Config(a, tok, ctx)
pub opaque type Operator(a, tok, ctx)

Functions

pub fn expression(one_of first: List(
    fn(Config(a, b, c)) -> Parser(a, b, c),
  ), and_then then: List(Operator(a, b, c)), dropping spaces: Parser(
    Nil,
    b,
    c,
  )) -> Parser(a, b, c)
pub fn infix_left(precedence: Int, operator: Parser(Nil, a, b), apply: fn(
    c,
    c,
  ) -> c) -> Operator(c, a, b)
pub fn infix_right(precedence: Int, operator: Parser(Nil, a, b), apply: fn(
    c,
    c,
  ) -> c) -> Operator(c, a, b)
pub fn postfix(precedence: Int, operator: Parser(Nil, a, b), apply: fn(
    c,
  ) -> c) -> Operator(c, a, b)
pub fn prefix(precedence: Int, operator: Parser(Nil, a, b), apply: fn(
    c,
  ) -> c) -> fn(Config(c, a, b)) -> Parser(c, a, b)
pub fn sub_expression(config: Config(a, b, c), precedence: Int) -> Parser(
  a,
  b,
  c,
)
Search Document