View Source Cogito.Combinators (Cogito v1.0.2)

A list of basic combinators.

The meaning of each of them is derived from the names.

Summary

Functions

between(parser, left_p, right_p)

@spec between(Cogito.parser(), Cogito.parser(), Cogito.parser()) :: Cogito.parser()

char(predicate)

@spec char((integer() -> true | false) | integer()) :: Cogito.parser()

choice(parsers)

@spec choice([Cogito.parser()]) :: Cogito.parser()

eos(parser)

@spec eos(Cogito.parser()) :: (String.t() -> {:ok, any()} | {:err, any()})

eos!(parser)

@spec eos!(Cogito.parser()) :: Cogito.parser!()

fseq(parsers, function)

@spec fseq([Cogito.parser()], (any() -> any())) :: Cogito.parser()

identity(value)

@spec identity(any()) :: Cogito.parser()

ignore(parser)

@spec ignore(Cogito.parser()) :: Cogito.parser()

join(parser)

@spec join(Cogito.parser()) :: Cogito.parser()

lazy(parser)

(macro)
@spec lazy(Cogito.parser()) :: Macro.t()

many1(parser)

@spec many1(Cogito.parser()) :: Cogito.parser()

many(parser)

@spec many(Cogito.parser()) :: Cogito.parser()

map(parser, function)

@spec map(Cogito.parser(), (any() -> any())) :: Cogito.parser()

nth(parsers, n)

@spec nth([Cogito.parser()], integer()) :: Cogito.parser()

optional(parser)

@spec optional(Cogito.parser()) :: Cogito.parser()

repeat(parser, n)

@spec repeat(Cogito.parser(), integer()) :: Cogito.parser()

seq(parsers)

@spec seq([Cogito.parser()]) :: Cogito.parser()