private function staticArrayPairList(ArrayNode $node, $terminator) {
    $elements = new CommaListNode();
    do {
      if ($this->currentType === $terminator) {
        break;
      }
      $this->matchHidden($elements);
      $value = $this->staticScalar();
      if ($this->currentType === T_DOUBLE_ARROW) {
        $pair = new ArrayPairNode();
        $pair->addChild($value, 'key');
        $this->mustMatch(T_DOUBLE_ARROW, $pair);
        $pair->addChild($this->staticScalar(), 'value');
        $elements->addChild($pair);
      }
      else {
        $elements->addChild($value);
      }
    } while ($this->tryMatch(',', $elements, NULL, TRUE));
    $node->addChild($elements, 'elements');
  }
private function staticArrayPairList(ArrayNode $node, $terminator) {
    $elements = new CommaListNode();
    do {
      if ($this->currentType === $terminator) {
        break;
      }
      $this->matchHidden($elements);
      $value = $this->staticScalar();
      if ($this->currentType === T_DOUBLE_ARROW) {
        $pair = new ArrayPairNode();
        $pair->addChild($value, 'key');
        $this->mustMatch(T_DOUBLE_ARROW, $pair);
        $pair->addChild($this->staticScalar(), 'value');
        $elements->addChild($pair);
      }
      else {
        $elements->addChild($value);
      }
    } while ($this->tryMatch(',', $elements, NULL, TRUE));
    $node->addChild($elements, 'elements');
  }
private function staticArrayPairList ( ArrayNode $ node , $ terminator ) { $ elements = new CommaListNode ( ) ; do { if ( $ this -> currentType === $ terminator ) { break ; } $ this -> matchHidden ( $ elements ) ; $ value = $ this -> staticScalar ( ) ; if ( $ this -> currentType === T_DOUBLE_ARROW ) { $ pair = new ArrayPairNode ( ) ; $ pair -> addChild ( $ value , 'key' ) ; $ this -> mustMatch ( T_DOUBLE_ARROW , $ pair ) ; $ pair -> addChild ( $ this -> staticScalar ( ) , 'value' ) ; $ elements -> addChild ( $ pair ) ; } else { $ elements -> addChild ( $ value ) ; } } while ( $ this -> tryMatch ( ',' , $ elements , NULL , TRUE ) ) ; $ node -> addChild ( $ elements , 'elements' ) ; }
Parse static array pair list.
@param ArrayNode $node Array node to add elements to
@param int|string $terminator Token type that terminates the array pair list
Parse static array pair list .