Started implementation for private flags in rust (#7269)

Adds flag to the cpp to fix bad annotations in all the languages

Addresses comments to the PR, and fixes logic for leaking annotations
This commit is contained in:
mustiikhalil
2022-06-05 23:04:05 +02:00
committed by GitHub
parent 967df08b1d
commit 11a1988705
13 changed files with 924 additions and 11 deletions

View File

@@ -221,6 +221,9 @@ const static FlatCOption options[] = {
"Only generated one typescript file per .fbs file." },
{ "", "annotate", "SCHEMA",
"Annotate the provided BINARY_FILE with the specified SCHEMA file." },
{ "", "no-leak-private-annotation", "",
"Prevents multiple type of annotations within a Fbs SCHEMA file."
"Currently this is required to generate private types in Rust" },
};
static void AppendTextWrappedString(std::stringstream &ss, std::string &text,
@@ -596,6 +599,8 @@ int FlatCompiler::Compile(int argc, const char **argv) {
opts.json_nested_legacy_flatbuffers = true;
} else if (arg == "--ts-flat-files") {
opts.ts_flat_file = true;
} else if (arg == "--no-leak-private-annotation") {
opts.no_leak_private_annotations = true;
} else if (arg == "--annotate") {
if (++argi >= argc) Error("missing path following: " + arg, true);
annotate_schema = flatbuffers::PosixPath(argv[argi]);