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.v!0 == "a"); assert(r4.v.v!1 == "b"); assert(r4.v.v!2 == "c"); assert(r4.v.v!3 == "d"); assert(r4.v.v!4 == "e"); auto r5 = seq!(token!"a")(i); //seq with single argument. assert(r5.ok); assert(r5.v.v!0 == "a");
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 ParseResult.v.v!index, where index is the index of the desired parser in T.