seq

Appply a sequence of parsers one after another.

Don't use tuple as data type in any of the parsers. The return data type is a special type of tuple. To get the data of each of the parsers, use Result.v.v!index, where index is the index of the desired parser in T.

version(legacy)
struct seq (
T...
) {}

Members

Enums

notVoid
eponymoustemplate notVoid(T)
Undocumented in source.

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;
auto i = "abcde";
auto r4 = seq!(token!"a", token!"b", token!"c", token!"d", token!"e")(i);
assert(r4.ok);
assert(r4.v[0] == "a");
assert(r4.v[1] == "b");
assert(r4.v[2] == "c");
assert(r4.v[3] == "d");
assert(r4.v[4] == "e");

auto r5 = seq!(token!"a")(i); //seq with single argument.
assert(r5.ok);
assert(r5.v[0] == "a");

Meta