From 738156521afd1ca64fd9b1b04a42e363f87a67ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Thu, 14 Mar 2024 22:40:00 +0000 Subject: [PATCH] lua: kKeep type names to avoid incorrect require casing 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 --- src/bfbs_gen_lua.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bfbs_gen_lua.cpp b/src/bfbs_gen_lua.cpp index 185e859620a..b3da048c586 100644 --- a/src/bfbs_gen_lua.cpp +++ b/src/bfbs_gen_lua.cpp @@ -46,7 +46,7 @@ std::set LuaKeywords() { } Namer::Config LuaDefaultConfig() { - return { /*types=*/Case::kUpperCamel, + return { /*types=*/Case::kKeep, /*constants=*/Case::kUnknown, /*methods=*/Case::kUpperCamel, /*functions=*/Case::kUpperCamel, @@ -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"; }