Optionally generate type prefixes and suffixes for python code (#7857)

* optionally generate type prefixes and suffixes for python code

* fix codegen error when qualified name is empty

* generated code updated
This commit is contained in:
Max Burke
2023-04-25 21:38:16 -07:00
committed by GitHub
parent 3fda20d7c7
commit 56ecc1f548
29 changed files with 1568 additions and 454 deletions

View File

@@ -250,6 +250,8 @@ const static FlatCOption flatc_options[] = {
{ "", "no-leak-private-annotation", "",
"Prevents multiple type of annotations within a Fbs SCHEMA file. "
"Currently this is required to generate private types in Rust" },
{ "", "python-no-type-prefix-suffix", "",
"Skip emission of Python functions that are prefixed with typenames" },
{ "", "file-names-only", "",
"Print out generated file names without writing to the files"},
};
@@ -650,7 +652,9 @@ FlatCOptions FlatCompiler::ParseFromCommandLineArguments(int argc,
opts.ts_no_import_ext = true;
} else if (arg == "--no-leak-private-annotation") {
opts.no_leak_private_annotations = true;
} else if (arg == "--annotate-sparse-vectors") {
} else if (arg == "--python-no-type-prefix-suffix") {
opts.python_no_type_prefix_suffix = true;
} else if (arg == "--annotate-sparse-vectors") {
options.annotate_include_vector_contents = false;
} else if (arg == "--annotate") {
if (++argi >= argc) Error("missing path following: " + arg, true);