[Lua] Apply Namer to Lua (#7171)

* Apply Namer to Lua bfbs code gen

* refactor namer into IdlNamer to keep idl includes separate

* remove commented out code

* added bfbs_namer

* remove Enum case

* add to bazel
This commit is contained in:
Derek Bailey
2022-03-15 21:48:42 -07:00
committed by GitHub
parent b8c77d4041
commit 0bceba24db
11 changed files with 383 additions and 234 deletions

View File

@@ -73,10 +73,6 @@ static bool IsStructOrTable(const reflection::BaseType base_type) {
return base_type == reflection::Obj;
}
static bool IsScalar(const reflection::BaseType base_type) {
return base_type >= reflection::UType && base_type <= reflection::Double;
}
static bool IsFloatingPoint(const reflection::BaseType base_type) {
return base_type == reflection::Float || base_type == reflection::Double;
}
@@ -93,22 +89,6 @@ static bool IsVector(const reflection::BaseType base_type) {
return base_type == reflection::Vector;
}
static std::string Denamespace(const flatbuffers::String *name,
std::string &ns) {
const size_t pos = name->str().find_last_of('.');
if (pos == std::string::npos) {
ns = "";
return name->str();
}
ns = name->str().substr(0, pos);
return name->str().substr(pos + 1);
}
static std::string Denamespace(const flatbuffers::String *name) {
std::string ns;
return Denamespace(name, ns);
}
// A concrete base Flatbuffer Generator that specific language generators can
// derive from.
class BaseBfbsGenerator : public BfbsGenerator {