mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-20 22:47:33 +00:00
[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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user