diff options
Diffstat (limited to 'upb/json/parser.rl')
-rw-r--r-- | upb/json/parser.rl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/upb/json/parser.rl b/upb/json/parser.rl index e026c3e..2641dda 100644 --- a/upb/json/parser.rl +++ b/upb/json/parser.rl @@ -1189,7 +1189,8 @@ static bool start_any_stringval(upb_json_parser *p) { static bool start_stringval(upb_json_parser *p) { if (is_top_level(p)) { - if (is_string_wrapper_object(p)) { + if (is_string_wrapper_object(p) || + is_number_wrapper_object(p)) { start_wrapper_object(p); } else if (is_wellknown_msg(p, UPB_WELLKNOWN_FIELDMASK)) { start_fieldmask_object(p); @@ -1202,7 +1203,8 @@ static bool start_stringval(upb_json_parser *p) { } else { return false; } - } else if (does_string_wrapper_start(p)) { + } else if (does_string_wrapper_start(p) || + does_number_wrapper_start(p)) { if (!start_subobject(p)) { return false; } @@ -1408,7 +1410,8 @@ static bool end_stringval(upb_json_parser *p) { return false; } - if (does_string_wrapper_end(p)) { + if (does_string_wrapper_end(p) || + does_number_wrapper_end(p)) { end_wrapper_object(p); if (!is_top_level(p)) { end_subobject(p); |