| 416 | } |
| 417 | |
| 418 | void parse_array(JsonArray &arr, const char *json) |
| 419 | { |
| 420 | if (json == NULL) { |
| 421 | fatal("json is NULL"); |
| 422 | return; |
| 423 | } |
| 424 | |
| 425 | if (*json == '[') { |
| 426 | json = skip_spaces(++json); |
| 427 | if (json == NULL) |
| 428 | return; |
| 429 | |
| 430 | if (*json == ']') |
| 431 | return; |
| 432 | |
| 433 | while (*json) { |
| 434 | array::push_back(arr, json); |
| 435 | |
| 436 | json = skip_value(json); |
| 437 | if (json == NULL) |
| 438 | return; |
| 439 | |
| 440 | json = skip_spaces(json); |
| 441 | if (json == NULL) |
| 442 | return; |
| 443 | |
| 444 | if (*json == ']') |
| 445 | return; |
| 446 | |
| 447 | json = skip_spaces(json); |
| 448 | if (json == NULL) |
| 449 | return; |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | fatal("Bad array"); |
| 454 | } |
| 455 | |
| 456 | static void parse_root_object(JsonObject &obj, const char *json) |
| 457 | { |
no test coverage detected