mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
Parser will allow a table or vector to have a trailing comma.
Unless in --strict-json mode. Also added strict_json option to the parser, which in addition controls if field names without quotes are allowed. Change-Id: Id56fe5c780bdb9170958050ffa8fa23cf2babe95 Tested: on Linux.
This commit is contained in:
@@ -102,7 +102,8 @@ static void Error(const char *err, const char *obj, bool usage,
|
||||
printf(
|
||||
" -o PATH Prefix PATH to all generated files.\n"
|
||||
" -I PATH Search for includes in the specified path.\n"
|
||||
" --strict-json Strict JSON: add quotes to field names.\n"
|
||||
" --strict-json Strict JSON: field names must be / will be quoted,\n"
|
||||
" no trailing commas in tables/vectors.\n"
|
||||
" --no-prefix Don\'t prefix enum values with the enum type in C++.\n"
|
||||
" --gen-includes Generate include statements for included schemas the\n"
|
||||
" generated file depends on (C++).\n"
|
||||
@@ -174,7 +175,7 @@ int main(int argc, const char *argv[]) {
|
||||
"specify one of -c -g -j -t -b etc.", true);
|
||||
|
||||
// Now process the files:
|
||||
flatbuffers::Parser parser(proto_mode);
|
||||
flatbuffers::Parser parser(opts.strict_json, proto_mode);
|
||||
for (auto file_it = filenames.begin();
|
||||
file_it != filenames.end();
|
||||
++file_it) {
|
||||
|
||||
Reference in New Issue
Block a user