Trailing commas now require a json5 parser

Modifies the yajl test case to add the -5 option
This commit is contained in:
Andrew Johnson
2020-07-07 00:31:14 -05:00
parent ae604b2a55
commit 91c5b2fee2
2 changed files with 29 additions and 25 deletions
+4 -2
View File
@@ -332,7 +332,8 @@ yajl_do_parse(yajl_handle hand, const unsigned char * jsonText,
case yajl_tok_right_bracket: {
yajl_state s = yajl_bs_current(hand->stateStack);
if (s == yajl_state_array_start ||
s == yajl_state_array_need_val)
((hand->flags & yajl_allow_json5) &&
(s == yajl_state_array_need_val)))
{
if (hand->callbacks &&
hand->callbacks->yajl_end_array)
@@ -404,7 +405,8 @@ yajl_do_parse(yajl_handle hand, const unsigned char * jsonText,
case yajl_tok_right_brace: {
yajl_state s = yajl_bs_current(hand->stateStack);
if (s == yajl_state_map_start ||
s == yajl_state_map_need_key) {
((hand->flags & yajl_allow_json5) &&
(s == yajl_state_map_need_key))) {
if (hand->callbacks && hand->callbacks->yajl_end_map) {
_CC_CHK(hand->callbacks->yajl_end_map(hand->ctx));
}