src/json.c

changeset 1596
2d2c4ec38133
parent 1595
2e0353a9bc30
child 1600
a1a728d7ebfd
equal deleted inserted replaced
1595:2e0353a9bc30 1596:2d2c4ec38133
644 return_rec(CX_JSON_VALUE_ALLOC_FAILED); // LCOV_EXCL_LINE 644 return_rec(CX_JSON_VALUE_ALLOC_FAILED); // LCOV_EXCL_LINE
645 } 645 }
646 json_add_state(json, JP_STATE_OBJ_NAME_OR_CLOSE); 646 json_add_state(json, JP_STATE_OBJ_NAME_OR_CLOSE);
647 return_rec(CX_JSON_NO_ERROR); 647 return_rec(CX_JSON_NO_ERROR);
648 } 648 }
649 case CX_JSON_TOKEN_END_ARRAY: {
650 if (state == JP_STATE_VALUE_BEGIN_AR) {
651 // discard the array from the value buffer
652 json->vbuf_size--;
653 json->states_size--;
654 return_rec(CX_JSON_NO_ERROR);
655 } else {
656 return_rec(CX_JSON_FORMAT_ERROR_UNEXPECTED_TOKEN);
657 }
658 }
649 case CX_JSON_TOKEN_STRING: { 659 case CX_JSON_TOKEN_STRING: {
650 if ((vbuf = json_create_value(json, CX_JSON_STRING)) == NULL) { 660 if ((vbuf = json_create_value(json, CX_JSON_STRING)) == NULL) {
651 return_rec(CX_JSON_VALUE_ALLOC_FAILED); // LCOV_EXCL_LINE 661 return_rec(CX_JSON_VALUE_ALLOC_FAILED); // LCOV_EXCL_LINE
652 } 662 }
653 cxmutstr str = unescape_string(json->allocator, token.content); 663 cxmutstr str = unescape_string(json->allocator, token.content);

mercurial