forEachDepthFirstIndexed method

void forEachDepthFirstIndexed(
  1. void action(
    1. int index,
    2. Expression expression
    )
)

Takes an action for each element.

Calls action for each element along with the index in the iteration order.

Implementation

void forEachDepthFirstIndexed(
    void Function(int index, Expression expression) action) {
  var index = 0;
  for (var expression in depthFirst) {
    action(index, expression);
    index++;
  }
}