summaryrefslogtreecommitdiffstats
path: root/src/Bindings/BindingsProcessor.lua
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2017-08-30 10:35:19 +0200
committerMattes D <github@xoft.cz>2017-08-30 15:25:13 +0200
commita24147d970b5825619df39d06b39437effd04b41 (patch)
tree3d809acc62e3f165896bf48f6d39eb13a3e4460d /src/Bindings/BindingsProcessor.lua
parentUpdate core plugins to latest version (#3951) (diff)
downloadcuberite-a24147d970b5825619df39d06b39437effd04b41.tar
cuberite-a24147d970b5825619df39d06b39437effd04b41.tar.gz
cuberite-a24147d970b5825619df39d06b39437effd04b41.tar.bz2
cuberite-a24147d970b5825619df39d06b39437effd04b41.tar.lz
cuberite-a24147d970b5825619df39d06b39437effd04b41.tar.xz
cuberite-a24147d970b5825619df39d06b39437effd04b41.tar.zst
cuberite-a24147d970b5825619df39d06b39437effd04b41.zip
Diffstat (limited to 'src/Bindings/BindingsProcessor.lua')
-rw-r--r--src/Bindings/BindingsProcessor.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Bindings/BindingsProcessor.lua b/src/Bindings/BindingsProcessor.lua
index d6c39dec6..f013b3918 100644
--- a/src/Bindings/BindingsProcessor.lua
+++ b/src/Bindings/BindingsProcessor.lua
@@ -206,7 +206,7 @@ local function OutputLuaStateHelpers(a_Package)
local f = assert(io.open("LuaState_Declaration.inc", "w"))
f:write("\n// LuaState_Declaration.inc\n\n// This file is generated along with the Lua bindings by ToLua. Do not edit manually, do not commit to repo.\n")
f:write("// Implements a Push() and GetStackValue() function for each class exported to the Lua API.\n")
- f:write("// This file expects to be included form inside the cLuaState class definition\n")
+ f:write("// This file expects to be included from inside the cLuaState class definition\n")
f:write("\n\n\n\n\n")
for _, item in ipairs(types) do
if not(g_HasCustomPushImplementation[item.name]) then
@@ -218,6 +218,7 @@ local function OutputLuaStateHelpers(a_Package)
f:write("bool GetStackValue(int a_StackPos, ConstPtr" .. item.lname .. " & a_ReturnedVal);\n")
end
f:write("\n\n\n\n\n")
+
f:close()
end
@@ -266,6 +267,18 @@ local function OutputLuaStateHelpers(a_Package)
end
f:close()
end
+
+ do
+ local f = assert(io.open("LuaStateParams_TypeDescs.inc", "w"))
+ f:write("\n// LuaStateParams_TypeDescs.inc\n\n// This file is generated along with the Lua bindings by ToLua. Do not edit manually, do not commit to repo.\n")
+ f:write("// Implements a TypeDescription<type>::desc() specialization for each class exported to the Lua API.\n")
+ f:write("// This file expects to be included from inside the cLuaStateParams class definition\n")
+ f:write("\n\n\n\n\n")
+ for _, item in ipairs(types) do
+ f:write("template <> struct TypeDescription<" .. item.lname .. "> { static const char * desc() { return \"" .. item.lname .. "\"; } };\n")
+ end
+ f:close()
+ end
end