sdpc.combinators

Combinators

Members

Aliases

discard
alias discard(alias p) = transform!(p, (_))

Match p but discard the result

skip
alias skip(alias p) = discard!(many!(p, true))

Skip p zero or more times

Structs

between
struct between(alias begin, alias func, alias end)

Match pattern begin func end, return the result of func.

chain
struct chain(alias p, alias delim, bool allow_empty = false)

Match pattern p delim p delim p ... p delim p

choice
struct choice(T...)

Match any of the given pattern, stop when first match is found. All parsers must return the same type.

lookahead
struct lookahead(alias u, bool negative = false)

Match u but doesn't consume anything from the input range

many
struct many(alias func, bool allow_none = false)

Match func* or func+

optional
struct optional(alias p)

Optionally matches p

seq
struct seq(T...)

Appply a sequence of parsers one after another.

Meta