Skip to content

Commit

Permalink
lua: kKeep type names to avoid incorrect require casing
Browse files Browse the repository at this point in the history
Having a struct UUID, the file generated was Uuid.lua,
but generated code passing UUID all uppercase to require,
on case sensitive filesystems this doesn't work
  • Loading branch information
serprex committed Mar 14, 2024
1 parent 67eb95d commit 7381565
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bfbs_gen_lua.cpp
Expand Up @@ -46,7 +46,7 @@ std::set<std::string> LuaKeywords() {
}

Namer::Config LuaDefaultConfig() {
return { /*types=*/Case::kUpperCamel,
return { /*types=*/Case::kKeep,
/*constants=*/Case::kUnknown,
/*methods=*/Case::kUpperCamel,
/*functions=*/Case::kUpperCamel,
Expand Down Expand Up @@ -507,7 +507,7 @@ class LuaBfbsGenerator : public BaseBfbsGenerator {

std::string GenerateMethod(const r::Field *field) const {
const r::BaseType base_type = field->type()->base_type();
if (IsScalar(base_type)) { return namer_.Type(GenerateType(base_type)); }
if (IsScalar(base_type)) { return namer_.Method(GenerateType(base_type)); }
if (IsStructOrTable(base_type)) { return "Struct"; }
return "UOffsetTRelative";
}
Expand Down

0 comments on commit 7381565

Please sign in to comment.