aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/flatbuffers/src/bfbs_gen_nim.cpp
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2023-09-06 12:00:15 +0300
committerthegeorg <thegeorg@yandex-team.com>2023-09-06 12:35:38 +0300
commit23225dd61414039ed8f923ca08c96efecc8894eb (patch)
treec35c77c85c0bca5f54ba4ceb397f442d9adfdf97 /contrib/libs/flatbuffers/src/bfbs_gen_nim.cpp
parentee92fee2d806dd933291766e2f42948c481b6398 (diff)
downloadydb-23225dd61414039ed8f923ca08c96efecc8894eb.tar.gz
Update contrib/libs/flatbuffers to 23.5.26
Diffstat (limited to 'contrib/libs/flatbuffers/src/bfbs_gen_nim.cpp')
-rw-r--r--contrib/libs/flatbuffers/src/bfbs_gen_nim.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/libs/flatbuffers/src/bfbs_gen_nim.cpp b/contrib/libs/flatbuffers/src/bfbs_gen_nim.cpp
index 45bd3c33d4..a8f4ee0c74 100644
--- a/contrib/libs/flatbuffers/src/bfbs_gen_nim.cpp
+++ b/contrib/libs/flatbuffers/src/bfbs_gen_nim.cpp
@@ -28,6 +28,7 @@
#include "bfbs_namer.h"
// The intermediate representation schema.
+#include "flatbuffers/code_generator.h"
#include "flatbuffers/reflection.h"
#include "flatbuffers/reflection_generated.h"
@@ -95,7 +96,10 @@ class NimBfbsGenerator : public BaseBfbsGenerator {
flatc_version_(flatc_version),
namer_(NimDefaultConfig(), NimKeywords()) {}
- Status GenerateFromSchema(const r::Schema *schema) FLATBUFFERS_OVERRIDE {
+ Status GenerateFromSchema(const r::Schema *schema,
+ const CodeGenOptions &options)
+ FLATBUFFERS_OVERRIDE {
+ options_ = options;
ForAllEnums(schema->enums(), [&](const r::Enum *enum_def) {
StartCodeBlock(enum_def);
GenerateEnum(enum_def);
@@ -671,12 +675,15 @@ class NimBfbsGenerator : public BaseBfbsGenerator {
// TODO(derekbailey): figure out a save file without depending on util.h
EnsureDirExists(path);
- const std::string file_name = path + "/" + namer_.File(name);
+ const std::string file_name =
+ options_.output_path + path + "/" + namer_.File(name);
SaveFile(file_name.c_str(), code, false);
}
std::unordered_set<std::string> keywords_;
std::map<std::string, std::string> imports_;
+ CodeGenOptions options_;
+
const r::Object *current_obj_;
const r::Enum *current_enum_;
const std::string flatc_version_;