Unverified Commit 659e799f authored by Paul Yang's avatar Paul Yang Committed by GitHub

Sync upb (#6577)

* Sync upb

* https://github.com/protocolbuffers/upb/pull/208

* Fix php c extension compiling

Don't use macros defined by upb

* Update ruby conformance failure list
parent b273cba1
...@@ -102,8 +102,6 @@ Required.Proto3.JsonInput.OptionalInt64Wrapper.JsonOutput ...@@ -102,8 +102,6 @@ Required.Proto3.JsonInput.OptionalInt64Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalStringWrapper.JsonOutput Required.Proto3.JsonInput.OptionalStringWrapper.JsonOutput
Required.Proto3.JsonInput.OptionalUint32Wrapper.JsonOutput Required.Proto3.JsonInput.OptionalUint32Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.JsonOutput
Required.Proto3.JsonInput.OptionalWrapperTypesWithNonDefaultValue.ProtobufOutput
Required.Proto3.JsonInput.RejectTopLevelNull Required.Proto3.JsonInput.RejectTopLevelNull
Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput
......
...@@ -47,8 +47,8 @@ size_t stringsink_string(void *_sink, const void *hd, const char *ptr, ...@@ -47,8 +47,8 @@ size_t stringsink_string(void *_sink, const void *hd, const char *ptr,
stringsink *sink = _sink; stringsink *sink = _sink;
size_t new_size = sink->size; size_t new_size = sink->size;
UPB_UNUSED(hd); PHP_PROTO_UNUSED(hd);
UPB_UNUSED(handle); PHP_PROTO_UNUSED(handle);
while (sink->len + len > new_size) { while (sink->len + len > new_size) {
new_size *= 2; new_size *= 2;
...@@ -243,7 +243,7 @@ DEFINE_APPEND_HANDLER(double, double) ...@@ -243,7 +243,7 @@ DEFINE_APPEND_HANDLER(double, double)
static void* appendstr_handler(void *closure, static void* appendstr_handler(void *closure,
const void *hd, const void *hd,
size_t size_hint) { size_t size_hint) {
UPB_UNUSED(hd); PHP_PROTO_UNUSED(hd);
stringfields_parseframe_t* frame = stringfields_parseframe_t* frame =
(stringfields_parseframe_t*)malloc(sizeof(stringfields_parseframe_t)); (stringfields_parseframe_t*)malloc(sizeof(stringfields_parseframe_t));
...@@ -354,7 +354,7 @@ static void new_php_string(zval* value_ptr, const char* str, size_t len) { ...@@ -354,7 +354,7 @@ static void new_php_string(zval* value_ptr, const char* str, size_t len) {
static void* str_handler(void *closure, static void* str_handler(void *closure,
const void *hd, const void *hd,
size_t size_hint) { size_t size_hint) {
UPB_UNUSED(hd); PHP_PROTO_UNUSED(hd);
stringfields_parseframe_t* frame = stringfields_parseframe_t* frame =
(stringfields_parseframe_t*)malloc(sizeof(stringfields_parseframe_t)); (stringfields_parseframe_t*)malloc(sizeof(stringfields_parseframe_t));
...@@ -763,7 +763,7 @@ static bool oneofstr_end_handler(void *closure, const void *hd) { ...@@ -763,7 +763,7 @@ static bool oneofstr_end_handler(void *closure, const void *hd) {
static void *oneofstr_handler(void *closure, static void *oneofstr_handler(void *closure,
const void *hd, const void *hd,
size_t size_hint) { size_t size_hint) {
UPB_UNUSED(hd); PHP_PROTO_UNUSED(hd);
stringfields_parseframe_t* frame = stringfields_parseframe_t* frame =
(stringfields_parseframe_t*)malloc(sizeof(stringfields_parseframe_t)); (stringfields_parseframe_t*)malloc(sizeof(stringfields_parseframe_t));
...@@ -1093,7 +1093,7 @@ static void putmap(zval* map, const upb_fielddef* f, upb_sink sink, ...@@ -1093,7 +1093,7 @@ static void putmap(zval* map, const upb_fielddef* f, upb_sink sink,
static upb_selector_t getsel(const upb_fielddef* f, upb_handlertype_t type) { static upb_selector_t getsel(const upb_fielddef* f, upb_handlertype_t type) {
upb_selector_t ret; upb_selector_t ret;
bool ok = upb_handlers_getselector(f, type, &ret); bool ok = upb_handlers_getselector(f, type, &ret);
UPB_ASSERT(ok); PHP_PROTO_ASSERT(ok);
return ret; return ret;
} }
......
...@@ -46,6 +46,15 @@ ...@@ -46,6 +46,15 @@
#define ARRAY_SIZE(x) \ #define ARRAY_SIZE(x) \
((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x]))))) ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))
#define PHP_PROTO_UNUSED(var) (void)var
/* PHP_PROTO_ASSERT(): in release mode, we use the expression without letting
* it be evaluated. This prevents "unused variable" warnings. */
#ifdef NDEBUG
#define PHP_PROTO_ASSERT(expr) do {} while (false && (expr))
#else
#define PHP_PROTO_ASSERT(expr) assert(expr)
#endif
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// PHP7 Wrappers // PHP7 Wrappers
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -3937,6 +3937,7 @@ static bool parse_default(const symtab_addctx *ctx, const char *str, size_t len, ...@@ -3937,6 +3937,7 @@ static bool parse_default(const symtab_addctx *ctx, const char *str, size_t len,
} else { } else {
return false; return false;
} }
break;
} }
case UPB_TYPE_STRING: case UPB_TYPE_STRING:
f->defaultval.str = newstr(ctx->alloc, str, len); f->defaultval.str = newstr(ctx->alloc, str, len);
...@@ -9656,7 +9657,8 @@ static bool start_any_stringval(upb_json_parser *p) { ...@@ -9656,7 +9657,8 @@ static bool start_any_stringval(upb_json_parser *p) {
static bool start_stringval(upb_json_parser *p) { static bool start_stringval(upb_json_parser *p) {
if (is_top_level(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); start_wrapper_object(p);
} else if (is_wellknown_msg(p, UPB_WELLKNOWN_FIELDMASK)) { } else if (is_wellknown_msg(p, UPB_WELLKNOWN_FIELDMASK)) {
start_fieldmask_object(p); start_fieldmask_object(p);
...@@ -9669,7 +9671,8 @@ static bool start_stringval(upb_json_parser *p) { ...@@ -9669,7 +9671,8 @@ static bool start_stringval(upb_json_parser *p) {
} else { } else {
return false; 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)) { if (!start_subobject(p)) {
return false; return false;
} }
...@@ -9875,7 +9878,8 @@ static bool end_stringval(upb_json_parser *p) { ...@@ -9875,7 +9878,8 @@ static bool end_stringval(upb_json_parser *p) {
return false; return false;
} }
if (does_string_wrapper_end(p)) { if (does_string_wrapper_end(p) ||
does_number_wrapper_end(p)) {
end_wrapper_object(p); end_wrapper_object(p);
if (!is_top_level(p)) { if (!is_top_level(p)) {
end_subobject(p); end_subobject(p);
...@@ -11051,11 +11055,11 @@ static bool does_fieldmask_end(upb_json_parser *p) { ...@@ -11051,11 +11055,11 @@ static bool does_fieldmask_end(upb_json_parser *p) {
* final state once, when the closing '"' is seen. */ * final state once, when the closing '"' is seen. */
#line 2791 "upb/json/parser.rl" #line 2794 "upb/json/parser.rl"
#line 2594 "upb/json/parser.c" #line 2597 "upb/json/parser.c"
static const char _json_actions[] = { static const char _json_actions[] = {
0, 1, 0, 1, 1, 1, 3, 1, 0, 1, 0, 1, 1, 1, 3, 1,
4, 1, 6, 1, 7, 1, 8, 1, 4, 1, 6, 1, 7, 1, 8, 1,
...@@ -11310,7 +11314,7 @@ static const int json_en_value_machine = 78; ...@@ -11310,7 +11314,7 @@ static const int json_en_value_machine = 78;
static const int json_en_main = 1; static const int json_en_main = 1;
#line 2794 "upb/json/parser.rl" #line 2797 "upb/json/parser.rl"
size_t parse(void *closure, const void *hd, const char *buf, size_t size, size_t parse(void *closure, const void *hd, const char *buf, size_t size,
const upb_bufhandle *handle) { const upb_bufhandle *handle) {
...@@ -11333,7 +11337,7 @@ size_t parse(void *closure, const void *hd, const char *buf, size_t size, ...@@ -11333,7 +11337,7 @@ size_t parse(void *closure, const void *hd, const char *buf, size_t size,
capture_resume(parser, buf); capture_resume(parser, buf);
#line 2872 "upb/json/parser.c" #line 2875 "upb/json/parser.c"
{ {
int _klen; int _klen;
unsigned int _trans; unsigned int _trans;
...@@ -11408,147 +11412,147 @@ _match: ...@@ -11408,147 +11412,147 @@ _match:
switch ( *_acts++ ) switch ( *_acts++ )
{ {
case 1: case 1:
#line 2599 "upb/json/parser.rl" #line 2602 "upb/json/parser.rl"
{ p--; {cs = stack[--top]; goto _again;} } { p--; {cs = stack[--top]; goto _again;} }
break; break;
case 2: case 2:
#line 2601 "upb/json/parser.rl" #line 2604 "upb/json/parser.rl"
{ p--; {stack[top++] = cs; cs = 23;goto _again;} } { p--; {stack[top++] = cs; cs = 23;goto _again;} }
break; break;
case 3: case 3:
#line 2605 "upb/json/parser.rl" #line 2608 "upb/json/parser.rl"
{ start_text(parser, p); } { start_text(parser, p); }
break; break;
case 4: case 4:
#line 2606 "upb/json/parser.rl" #line 2609 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_text(parser, p)); } { CHECK_RETURN_TOP(end_text(parser, p)); }
break; break;
case 5: case 5:
#line 2612 "upb/json/parser.rl" #line 2615 "upb/json/parser.rl"
{ start_hex(parser); } { start_hex(parser); }
break; break;
case 6: case 6:
#line 2613 "upb/json/parser.rl" #line 2616 "upb/json/parser.rl"
{ hexdigit(parser, p); } { hexdigit(parser, p); }
break; break;
case 7: case 7:
#line 2614 "upb/json/parser.rl" #line 2617 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_hex(parser)); } { CHECK_RETURN_TOP(end_hex(parser)); }
break; break;
case 8: case 8:
#line 2620 "upb/json/parser.rl" #line 2623 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(escape(parser, p)); } { CHECK_RETURN_TOP(escape(parser, p)); }
break; break;
case 9: case 9:
#line 2626 "upb/json/parser.rl" #line 2629 "upb/json/parser.rl"
{ p--; {cs = stack[--top]; goto _again;} } { p--; {cs = stack[--top]; goto _again;} }
break; break;
case 10: case 10:
#line 2631 "upb/json/parser.rl" #line 2634 "upb/json/parser.rl"
{ start_year(parser, p); } { start_year(parser, p); }
break; break;
case 11: case 11:
#line 2632 "upb/json/parser.rl" #line 2635 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_year(parser, p)); } { CHECK_RETURN_TOP(end_year(parser, p)); }
break; break;
case 12: case 12:
#line 2636 "upb/json/parser.rl" #line 2639 "upb/json/parser.rl"
{ start_month(parser, p); } { start_month(parser, p); }
break; break;
case 13: case 13:
#line 2637 "upb/json/parser.rl" #line 2640 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_month(parser, p)); } { CHECK_RETURN_TOP(end_month(parser, p)); }
break; break;
case 14: case 14:
#line 2641 "upb/json/parser.rl" #line 2644 "upb/json/parser.rl"
{ start_day(parser, p); } { start_day(parser, p); }
break; break;
case 15: case 15:
#line 2642 "upb/json/parser.rl" #line 2645 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_day(parser, p)); } { CHECK_RETURN_TOP(end_day(parser, p)); }
break; break;
case 16: case 16:
#line 2646 "upb/json/parser.rl" #line 2649 "upb/json/parser.rl"
{ start_hour(parser, p); } { start_hour(parser, p); }
break; break;
case 17: case 17:
#line 2647 "upb/json/parser.rl" #line 2650 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_hour(parser, p)); } { CHECK_RETURN_TOP(end_hour(parser, p)); }
break; break;
case 18: case 18:
#line 2651 "upb/json/parser.rl" #line 2654 "upb/json/parser.rl"
{ start_minute(parser, p); } { start_minute(parser, p); }
break; break;
case 19: case 19:
#line 2652 "upb/json/parser.rl" #line 2655 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_minute(parser, p)); } { CHECK_RETURN_TOP(end_minute(parser, p)); }
break; break;
case 20: case 20:
#line 2656 "upb/json/parser.rl" #line 2659 "upb/json/parser.rl"
{ start_second(parser, p); } { start_second(parser, p); }
break; break;
case 21: case 21:
#line 2657 "upb/json/parser.rl" #line 2660 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_second(parser, p)); } { CHECK_RETURN_TOP(end_second(parser, p)); }
break; break;
case 22: case 22:
#line 2662 "upb/json/parser.rl" #line 2665 "upb/json/parser.rl"
{ start_duration_base(parser, p); } { start_duration_base(parser, p); }
break; break;
case 23: case 23:
#line 2663 "upb/json/parser.rl" #line 2666 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_duration_base(parser, p)); } { CHECK_RETURN_TOP(end_duration_base(parser, p)); }
break; break;
case 24: case 24:
#line 2665 "upb/json/parser.rl" #line 2668 "upb/json/parser.rl"
{ p--; {cs = stack[--top]; goto _again;} } { p--; {cs = stack[--top]; goto _again;} }
break; break;
case 25: case 25:
#line 2670 "upb/json/parser.rl" #line 2673 "upb/json/parser.rl"
{ start_timestamp_base(parser); } { start_timestamp_base(parser); }
break; break;
case 26: case 26:
#line 2672 "upb/json/parser.rl" #line 2675 "upb/json/parser.rl"
{ start_timestamp_fraction(parser, p); } { start_timestamp_fraction(parser, p); }
break; break;
case 27: case 27:
#line 2673 "upb/json/parser.rl" #line 2676 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_timestamp_fraction(parser, p)); } { CHECK_RETURN_TOP(end_timestamp_fraction(parser, p)); }
break; break;
case 28: case 28:
#line 2675 "upb/json/parser.rl" #line 2678 "upb/json/parser.rl"
{ start_timestamp_zone(parser, p); } { start_timestamp_zone(parser, p); }
break; break;
case 29: case 29:
#line 2676 "upb/json/parser.rl" #line 2679 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_timestamp_zone(parser, p)); } { CHECK_RETURN_TOP(end_timestamp_zone(parser, p)); }
break; break;
case 30: case 30:
#line 2678 "upb/json/parser.rl" #line 2681 "upb/json/parser.rl"
{ p--; {cs = stack[--top]; goto _again;} } { p--; {cs = stack[--top]; goto _again;} }
break; break;
case 31: case 31:
#line 2683 "upb/json/parser.rl" #line 2686 "upb/json/parser.rl"
{ start_fieldmask_path_text(parser, p); } { start_fieldmask_path_text(parser, p); }
break; break;
case 32: case 32:
#line 2684 "upb/json/parser.rl" #line 2687 "upb/json/parser.rl"
{ end_fieldmask_path_text(parser, p); } { end_fieldmask_path_text(parser, p); }
break; break;
case 33: case 33:
#line 2689 "upb/json/parser.rl" #line 2692 "upb/json/parser.rl"
{ start_fieldmask_path(parser); } { start_fieldmask_path(parser); }
break; break;
case 34: case 34:
#line 2690 "upb/json/parser.rl" #line 2693 "upb/json/parser.rl"
{ end_fieldmask_path(parser); } { end_fieldmask_path(parser); }
break; break;
case 35: case 35:
#line 2696 "upb/json/parser.rl" #line 2699 "upb/json/parser.rl"
{ p--; {cs = stack[--top]; goto _again;} } { p--; {cs = stack[--top]; goto _again;} }
break; break;
case 36: case 36:
#line 2701 "upb/json/parser.rl" #line 2704 "upb/json/parser.rl"
{ {
if (is_wellknown_msg(parser, UPB_WELLKNOWN_TIMESTAMP)) { if (is_wellknown_msg(parser, UPB_WELLKNOWN_TIMESTAMP)) {
{stack[top++] = cs; cs = 47;goto _again;} {stack[top++] = cs; cs = 47;goto _again;}
...@@ -11562,11 +11566,11 @@ _match: ...@@ -11562,11 +11566,11 @@ _match:
} }
break; break;
case 37: case 37:
#line 2714 "upb/json/parser.rl" #line 2717 "upb/json/parser.rl"
{ p--; {stack[top++] = cs; cs = 78;goto _again;} } { p--; {stack[top++] = cs; cs = 78;goto _again;} }
break; break;
case 38: case 38:
#line 2719 "upb/json/parser.rl" #line 2722 "upb/json/parser.rl"
{ {
if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) { if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
start_any_member(parser, p); start_any_member(parser, p);
...@@ -11576,11 +11580,11 @@ _match: ...@@ -11576,11 +11580,11 @@ _match:
} }
break; break;
case 39: case 39:
#line 2726 "upb/json/parser.rl" #line 2729 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_membername(parser)); } { CHECK_RETURN_TOP(end_membername(parser)); }
break; break;
case 40: case 40:
#line 2729 "upb/json/parser.rl" #line 2732 "upb/json/parser.rl"
{ {
if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) { if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
end_any_member(parser, p); end_any_member(parser, p);
...@@ -11590,7 +11594,7 @@ _match: ...@@ -11590,7 +11594,7 @@ _match:
} }
break; break;
case 41: case 41:
#line 2740 "upb/json/parser.rl" #line 2743 "upb/json/parser.rl"
{ {
if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) { if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
start_any_object(parser, p); start_any_object(parser, p);
...@@ -11600,7 +11604,7 @@ _match: ...@@ -11600,7 +11604,7 @@ _match:
} }
break; break;
case 42: case 42:
#line 2749 "upb/json/parser.rl" #line 2752 "upb/json/parser.rl"
{ {
if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) { if (is_wellknown_msg(parser, UPB_WELLKNOWN_ANY)) {
CHECK_RETURN_TOP(end_any_object(parser, p)); CHECK_RETURN_TOP(end_any_object(parser, p));
...@@ -11610,54 +11614,54 @@ _match: ...@@ -11610,54 +11614,54 @@ _match:
} }
break; break;
case 43: case 43:
#line 2761 "upb/json/parser.rl" #line 2764 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(start_array(parser)); } { CHECK_RETURN_TOP(start_array(parser)); }
break; break;
case 44: case 44:
#line 2765 "upb/json/parser.rl" #line 2768 "upb/json/parser.rl"
{ end_array(parser); } { end_array(parser); }
break; break;
case 45: case 45:
#line 2770 "upb/json/parser.rl" #line 2773 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(start_number(parser, p)); } { CHECK_RETURN_TOP(start_number(parser, p)); }
break; break;
case 46: case 46:
#line 2771 "upb/json/parser.rl" #line 2774 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_number(parser, p)); } { CHECK_RETURN_TOP(end_number(parser, p)); }
break; break;
case 47: case 47:
#line 2773 "upb/json/parser.rl" #line 2776 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(start_stringval(parser)); } { CHECK_RETURN_TOP(start_stringval(parser)); }
break; break;
case 48: case 48:
#line 2774 "upb/json/parser.rl" #line 2777 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_stringval(parser)); } { CHECK_RETURN_TOP(end_stringval(parser)); }
break; break;
case 49: case 49:
#line 2776 "upb/json/parser.rl" #line 2779 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_bool(parser, true)); } { CHECK_RETURN_TOP(end_bool(parser, true)); }
break; break;
case 50: case 50:
#line 2778 "upb/json/parser.rl" #line 2781 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_bool(parser, false)); } { CHECK_RETURN_TOP(end_bool(parser, false)); }
break; break;
case 51: case 51:
#line 2780 "upb/json/parser.rl" #line 2783 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_null(parser)); } { CHECK_RETURN_TOP(end_null(parser)); }
break; break;
case 52: case 52:
#line 2782 "upb/json/parser.rl" #line 2785 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(start_subobject_full(parser)); } { CHECK_RETURN_TOP(start_subobject_full(parser)); }
break; break;
case 53: case 53:
#line 2783 "upb/json/parser.rl" #line 2786 "upb/json/parser.rl"
{ end_subobject_full(parser); } { end_subobject_full(parser); }
break; break;
case 54: case 54:
#line 2788 "upb/json/parser.rl" #line 2791 "upb/json/parser.rl"
{ p--; {cs = stack[--top]; goto _again;} } { p--; {cs = stack[--top]; goto _again;} }
break; break;
#line 3196 "upb/json/parser.c" #line 3199 "upb/json/parser.c"
} }
} }
...@@ -11674,32 +11678,32 @@ _again: ...@@ -11674,32 +11678,32 @@ _again:
while ( __nacts-- > 0 ) { while ( __nacts-- > 0 ) {
switch ( *__acts++ ) { switch ( *__acts++ ) {
case 0: case 0:
#line 2597 "upb/json/parser.rl" #line 2600 "upb/json/parser.rl"
{ p--; {cs = stack[--top]; if ( p == pe ) { p--; {cs = stack[--top]; if ( p == pe )
goto _test_eof; goto _test_eof;
goto _again;} } goto _again;} }
break; break;
case 46: case 46:
#line 2771 "upb/json/parser.rl" #line 2774 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_number(parser, p)); } { CHECK_RETURN_TOP(end_number(parser, p)); }
break; break;
case 49: case 49:
#line 2776 "upb/json/parser.rl" #line 2779 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_bool(parser, true)); } { CHECK_RETURN_TOP(end_bool(parser, true)); }
break; break;
case 50: case 50:
#line 2778 "upb/json/parser.rl" #line 2781 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_bool(parser, false)); } { CHECK_RETURN_TOP(end_bool(parser, false)); }
break; break;
case 51: case 51:
#line 2780 "upb/json/parser.rl" #line 2783 "upb/json/parser.rl"
{ CHECK_RETURN_TOP(end_null(parser)); } { CHECK_RETURN_TOP(end_null(parser)); }
break; break;
case 53: case 53:
#line 2783 "upb/json/parser.rl" #line 2786 "upb/json/parser.rl"
{ end_subobject_full(parser); } { end_subobject_full(parser); }
break; break;
#line 3238 "upb/json/parser.c" #line 3241 "upb/json/parser.c"
} }
} }
} }
...@@ -11707,7 +11711,7 @@ goto _again;} } ...@@ -11707,7 +11711,7 @@ goto _again;} }
_out: {} _out: {}
} }
#line 2816 "upb/json/parser.rl" #line 2819 "upb/json/parser.rl"
if (p != pe) { if (p != pe) {
upb_status_seterrf(parser->status, "Parse error at '%.*s'\n", pe - p, p); upb_status_seterrf(parser->status, "Parse error at '%.*s'\n", pe - p, p);
...@@ -11750,13 +11754,13 @@ static void json_parser_reset(upb_json_parser *p) { ...@@ -11750,13 +11754,13 @@ static void json_parser_reset(upb_json_parser *p) {
/* Emit Ragel initialization of the parser. */ /* Emit Ragel initialization of the parser. */
#line 3289 "upb/json/parser.c" #line 3292 "upb/json/parser.c"
{ {
cs = json_start; cs = json_start;
top = 0; top = 0;
} }
#line 2858 "upb/json/parser.rl" #line 2861 "upb/json/parser.rl"
p->current_state = cs; p->current_state = cs;
p->parser_top = top; p->parser_top = top;
accumulate_clear(p); accumulate_clear(p);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment