|
Match data in a set of columns.
This is a fairly complex matcher. It allows matchers to be associated
with a range of indices (measured from the current point in the stream)
and only succeeds if all matchers succeed. The results are returned in
a list, in the same order as the matchers are specified.
A range if indices is given as a tuple (start, stop) which works like an
array index. So (0, 4) selects the first four characters (like [0:4]).
Alternatively, a number of characters can be given, in which case they
start where the previous column finished (or at zero for the first).
The matcher for each column will see the (selected) input data as a
separate stream. If a matcher should consume the entire column then
it should check for Eos.
Finally, the skip parameter controls how data to "the right" of the
columns is handled. If unset, the data are discarded (this functions
as an additional, final, column that currently drops data). Data to
"the left" are simply discarded.
Note: This does not support backtracking over the columns.
|