chain

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

Return data type will be an array of p's return data type

@safe
struct chain (
alias delim
bool allow_empty = false
) {}

Members

Static functions

opCall
auto opCall(R i)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

import sdpc.parsers;
import std.algorithm;

alias calc = transform!(chain!(number!(), token!"+"), (x) => x.reduce!"a+b");
auto i = "1+2+3+4+5";
auto r = calc(i);
assert(r.ok);
assert(r.v == 15);

Meta