From 8f8113b4fff748b57b0ff2f1a301e86b4703be84 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Tue, 9 Dec 2014 12:27:22 -0800 Subject: JSON test, symbolic enum names in JSON, and a few improvements. - Added a JSON test that round-trips (parses then re-serializes) several test messages, ensuring that the re-serialized form matches the original exactly. - Added support for printing and parsing symbolic enum names (rather than integer values) in JSON. - Updated JSON printer to properly handle string fields that come in multiple pieces. ('bytes' fields still do not support this, and this work is more challenging because it requires making the base64 encoder resumable. Base64 encoding is not separable at an input-byte granularity, unlike string escaping.) - Fixed a < vs. <= bug in UTF-8 encoding generation (oops). --- upb/bindings/lua/upb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'upb/bindings/lua') diff --git a/upb/bindings/lua/upb.c b/upb/bindings/lua/upb.c index 2bd78af..17fc0a8 100644 --- a/upb/bindings/lua/upb.c +++ b/upb/bindings/lua/upb.c @@ -1032,7 +1032,7 @@ static int lupb_enumdef_value(lua_State *L) { } else if (type == LUA_TSTRING) { const char *key = lua_tostring(L, 2); int32_t num; - if (upb_enumdef_ntoi(e, key, &num)) { + if (upb_enumdef_ntoiz(e, key, &num)) { lua_pushinteger(L, num); } else { lua_pushnil(L); -- cgit v1.2.3