summaryrefslogtreecommitdiff
path: root/upb
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2019-08-19 17:17:35 -0700
committerGitHub <noreply@github.com>2019-08-19 17:17:35 -0700
commitd3762e96cb8910b8281419faee7bd70b323c753d (patch)
tree12cbe6a737dde4a760d26c621aa77663c392eadd /upb
parent931bbecbd3230ae7f22efa5d203639facc47f719 (diff)
Accpet string for numeric wrappers (#202)
Diffstat (limited to 'upb')
-rw-r--r--upb/json/parser.rl9
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);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback