[cpp] Json parsing: adding support for parsing nested lists and top level lists (#4338)

* Extended json parsing capability: add support for parsing nested lists and top level lists

* Stylistic conformance with surrounding code + generalized comments

* More code tidy-up for stylistic conformance with surrounding code

* Blank lines

* Reverted changes related to top-level list parsing

* Styling: newline before else

* Taking out ProcessTableFields which is no longer needed as the top level list change was reverted.
This commit is contained in:
Guillaume Giraud
2017-06-08 01:58:19 +02:00
committed by Wouter van Oortmerssen
parent 86b505e412
commit b1740688bf
2 changed files with 38 additions and 9 deletions

View File

@@ -1106,6 +1106,13 @@ void ValueTest() {
12335089644688340133ULL);
}
void NestedListTest() {
flatbuffers::Parser parser1;
TEST_EQ(parser1.Parse("struct Test { a:short; b:byte; } table T { F:[Test]; }"
"root_type T;"
"{ F:[ [10,20], [30,40]] }"), true);
}
void EnumStringsTest() {
flatbuffers::Parser parser1;
TEST_EQ(parser1.Parse("enum E:byte { A, B, C } table T { F:[E]; }"