visitChildren method

  1. @override
void visitChildren(
  1. AstVisitor visitor
)
override

Use the given visitor to visit all of the children of this node.

The children will be visited in lexical order.

Implementation

@override
void visitChildren(AstVisitor visitor) {
  //
  // Note that subclasses are responsible for visiting the identifier because
  // they often need to visit other nodes before visiting the identifier.
  //
  if (_commentIsBeforeAnnotations()) {
    _comment?.accept(visitor);
    _metadata.accept(visitor);
  } else {
    List<AstNode> children = sortedCommentAndAnnotations;
    int length = children.length;
    for (int i = 0; i < length; i++) {
      children[i].accept(visitor);
    }
  }
}