public function rewriteChildren()

in codegen/syntax/ForStatement.hack [177:220]


  public function rewriteChildren<Tret as ?Node>(
    (function(Node, vec<Node>): Tret) $rewriter,
    vec<Node> $parents = vec[],
  ): this {
    $parents[] = $this;
    $keyword = $rewriter($this->_keyword, $parents);
    $left_paren = $rewriter($this->_left_paren, $parents);
    $initializer = $this->_initializer === null
      ? null
      : $rewriter($this->_initializer, $parents);
    $first_semicolon = $rewriter($this->_first_semicolon, $parents);
    $control =
      $this->_control === null ? null : $rewriter($this->_control, $parents);
    $second_semicolon = $rewriter($this->_second_semicolon, $parents);
    $end_of_loop = $this->_end_of_loop === null
      ? null
      : $rewriter($this->_end_of_loop, $parents);
    $right_paren = $rewriter($this->_right_paren, $parents);
    $body = $rewriter($this->_body, $parents);
    if (
      $keyword === $this->_keyword &&
      $left_paren === $this->_left_paren &&
      $initializer === $this->_initializer &&
      $first_semicolon === $this->_first_semicolon &&
      $control === $this->_control &&
      $second_semicolon === $this->_second_semicolon &&
      $end_of_loop === $this->_end_of_loop &&
      $right_paren === $this->_right_paren &&
      $body === $this->_body
    ) {
      return $this;
    }
    return new static(
      $keyword as ForToken,
      $left_paren as LeftParenToken,
      /* HH_FIXME[4110] ?NodeList<ListItem<IExpression>> may not be enforceable */ $initializer,
      $first_semicolon as SemicolonToken,
      $control as ?IExpression,
      $second_semicolon as SemicolonToken,
      /* HH_FIXME[4110] ?NodeList<ListItem<IExpression>> may not be enforceable */ $end_of_loop,
      $right_paren as RightParenToken,
      $body as IStatement,
    );
  }