|
@@ 358-365 (lines=8) @@
|
| 355 |
|
$node = new ArrayNode(); |
| 356 |
|
$first = true; |
| 357 |
|
while (!$this->stream->current->test(Token::PUNCTUATION_TYPE, ']')) { |
| 358 |
|
if (!$first) { |
| 359 |
|
$this->stream->expect(Token::PUNCTUATION_TYPE, ',', 'An array element must be followed by a comma'); |
| 360 |
|
|
| 361 |
|
// trailing ,? |
| 362 |
|
if ($this->stream->current->test(Token::PUNCTUATION_TYPE, ']')) { |
| 363 |
|
break; |
| 364 |
|
} |
| 365 |
|
} |
| 366 |
|
$first = false; |
| 367 |
|
|
| 368 |
|
$node->addElement($this->parseExpression()); |
|
@@ 382-389 (lines=8) @@
|
| 379 |
|
$node = new ArrayNode(); |
| 380 |
|
$first = true; |
| 381 |
|
while (!$this->stream->current->test(Token::PUNCTUATION_TYPE, '}')) { |
| 382 |
|
if (!$first) { |
| 383 |
|
$this->stream->expect(Token::PUNCTUATION_TYPE, ',', 'A hash value must be followed by a comma'); |
| 384 |
|
|
| 385 |
|
// trailing ,? |
| 386 |
|
if ($this->stream->current->test(Token::PUNCTUATION_TYPE, '}')) { |
| 387 |
|
break; |
| 388 |
|
} |
| 389 |
|
} |
| 390 |
|
$first = false; |
| 391 |
|
|
| 392 |
|
// a hash key can be: |