()
| 4614 | // Parse JSON |
| 4615 | |
| 4616 | function json_value() { |
| 4617 | |
| 4618 | function json_object() { |
| 4619 | var brace = next_token, object = {}; |
| 4620 | advance('{'); |
| 4621 | if (next_token.id !== '}') { |
| 4622 | while (next_token.id !== '(end)') { |
| 4623 | while (next_token.id === ',') { |
| 4624 | warn('unexpected_a', next_token); |
| 4625 | advance(','); |
| 4626 | } |
| 4627 | if (next_token.id !== '(string)') { |
| 4628 | warn('expected_string_a'); |
| 4629 | } |
| 4630 | if (object[next_token.string] === true) { |
| 4631 | warn('duplicate_a'); |
| 4632 | } else if (next_token.string === '__proto__') { |
| 4633 | warn('dangling_a'); |
| 4634 | } else { |
| 4635 | object[next_token.string] = true; |
| 4636 | } |
| 4637 | advance(); |
| 4638 | advance(':'); |
| 4639 | json_value(); |
| 4640 | if (next_token.id !== ',') { |
| 4641 | break; |
| 4642 | } |
| 4643 | advance(','); |
| 4644 | if (next_token.id === '}') { |
| 4645 | warn('unexpected_a', token); |
| 4646 | break; |
| 4647 | } |
| 4648 | } |
| 4649 | } |
| 4650 | advance('}', brace); |
| 4651 | } |
| 4652 | |
| 4653 | function json_array() { |
| 4654 | var bracket = next_token; |
| 4655 | advance('['); |
| 4656 | if (next_token.id !== ']') { |
| 4657 | while (next_token.id !== '(end)') { |
| 4658 | while (next_token.id === ',') { |
| 4659 | warn('unexpected_a', next_token); |
| 4660 | advance(','); |
| 4661 | } |
| 4662 | json_value(); |
| 4663 | if (next_token.id !== ',') { |
| 4664 | break; |
| 4665 | } |
| 4666 | advance(','); |
| 4667 | if (next_token.id === ']') { |
| 4668 | warn('unexpected_a', token); |
| 4669 | break; |
| 4670 | } |
| 4671 | } |
| 4672 | } |
| 4673 | advance(']', bracket); |
no test coverage detected
searching dependent graphs…