View Source Cogito.Combinators (Cogito v1.2.0)
A list of basic combinators.
Building example (collect primitive):
[
parser,
[
ws(),
delimiter,
ws(),
parser
]
|> nth(1)
|> many()
]
|> fseq(fn [h, t] -> [h | t] end)
|> option([])
The meaning of each of them is derived from the names.
Summary
Functions
Don't use it with Cogito.Primitives.ws()
because nth(1)
will break everything.
Functions
@spec between(Cogito.parser(), Cogito.parser(), Cogito.parser()) :: Cogito.parser()
Don't use it with Cogito.Primitives.ws()
because nth(1)
will break everything.
@spec choice([Cogito.parser()]) :: Cogito.parser()
@spec eos!(Cogito.parser()) :: Cogito.parser!()
@spec identity(any()) :: Cogito.parser()
@spec ignore(Cogito.parser()) :: Cogito.parser()
@spec join(Cogito.parser()) :: Cogito.parser()
@spec lazy(Cogito.parser()) :: Macro.t()
@spec many1(Cogito.parser()) :: Cogito.parser()
@spec many(Cogito.parser()) :: Cogito.parser()
@spec nth([Cogito.parser()], integer()) :: Cogito.parser()
@spec option(Cogito.parser(), any()) :: Cogito.parser()
@spec repeat(Cogito.parser(), integer()) :: Cogito.parser()
@spec seq([Cogito.parser()]) :: Cogito.parser()