macro_rules! map_until_stop_and_collect { ($F0:expr, $($EXPR:expr, $F:expr),*) => { ... }; }
Expand description
Transformation helper to process a heterogeneous sequence of tree node containing expressions.
This macro is very similar to TreeNodeIterator::map_until_stop_and_collect to
process nodes that are siblings, but it accepts an initial transformation (F0
) and
a sequence of pairs. Each pair is made of an expression (EXPR
) and its
transformation (F
).
The macro builds up a tuple that contains Transformed.data
result of F0
as the
first element and further elements from the sequence of pairs. An element from a pair
is either the value of EXPR
or the Transformed.data
result of F
, depending on
the Transformed.tnr
result of previous F
s (F0
initially).
§Returns
Error if any of the transformations returns an error
Ok(Transformed<(data0, …, dataN)>) such that:
transformed
is true if any of the transformations had transformed true(data0, ..., dataN)
, wheredata0
is theTransformed.data
fromF0
anddata1
…dataN
are from eitherEXPR
or theTransformed.data
ofF
tnr
fromF0
or the last invocation ofF