Parser now allows empty tables in JSON

Bug: 16870719
Change-Id: Ia5fdce49a67b1aa621ab1e37a815e2a3293257b6
Tested: on Linux
This commit is contained in:
Wouter van Oortmerssen
2014-08-12 16:20:13 -07:00
parent 620d8d6f7c
commit 0b47e69d4d
5 changed files with 15 additions and 7 deletions

View File

@@ -420,7 +420,7 @@ void Parser::SerializeStruct(const StructDef &struct_def, const Value &val) {
uoffset_t Parser::ParseTable(const StructDef &struct_def) {
Expect('{');
size_t fieldn = 0;
for (;;) {
if (!IsNext('}')) for (;;) {
std::string name = attribute_;
if (!IsNext(kTokenStringConstant)) Expect(kTokenIdentifier);
auto field = struct_def.fields.Lookup(name);