private function arrayPairList(ArrayNode $node, $terminator) {
    $elements = new CommaListNode();
    do {
      if ($this->currentType === $terminator) {
        break;
      }
      $this->matchHidden($elements);
      $elements->addChild($this->arrayPair());
    } while ($this->tryMatch(',', $elements, NULL, TRUE));
    $node->addChild($elements, 'elements');
  }