Module sdpc.combinators

Combinators

Structs

Name Description
chain Match pattern p delim p delim p ... p delim p
choice Match any of the given pattern, stop when first match is found. All parsers
lookahead Match u but doesn't consume anything from the input range
many Like many_r but with default reduce function that put all return values into an array, or return number of matches
many_r Match func* or func+
optional Optionally matches p
seq Appply a sequence of parsers one after another.

Aliases

Name Type Description
between transform!(seq!(discard!begin,func,discard!end),(x)=>x.v!1) Match pattern begin func end, return the result of func.
discard transform!(p,(_){}) Match p but discard the result
discard!(many!(discard!p,true)) Skip p zero or more times