summaryrefslogtreecommitdiffstats
path: root/lib/tolua++/src/bin/lua/basic.lua
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-03-22 15:48:16 +0100
committerTycho <work.tycho+git@gmail.com>2014-03-22 15:48:16 +0100
commit2266c2150daad68c19d320683f6bf5abd7f2ebb2 (patch)
tree111fe0c36643afd27317b8d9a4c7912b6899ec4a /lib/tolua++/src/bin/lua/basic.lua
parentPatched tolua to understand size_t (diff)
parentImplemented faster upscaling using templates. (diff)
downloadcuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.gz
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.bz2
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.lz
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.xz
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.tar.zst
cuberite-2266c2150daad68c19d320683f6bf5abd7f2ebb2.zip
Diffstat (limited to 'lib/tolua++/src/bin/lua/basic.lua')
-rw-r--r--lib/tolua++/src/bin/lua/basic.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/tolua++/src/bin/lua/basic.lua b/lib/tolua++/src/bin/lua/basic.lua
index 10cb5b18b..4bff5276b 100644
--- a/lib/tolua++/src/bin/lua/basic.lua
+++ b/lib/tolua++/src/bin/lua/basic.lua
@@ -67,6 +67,8 @@ _global_enums = {}
-- List of auto renaming
_renaming = {}
+
+_enums = {}
function appendrenaming (s)
local b,e,old,new = strfind(s,"%s*(.-)%s*@%s*(.-)%s*$")
if not b then
@@ -146,6 +148,11 @@ function typevar(type)
end
end
+-- is enum
+function isenumtype (type)
+ return _enums[type]
+end
+
-- check if basic type
function isbasic (type)
local t = gsub(type,'const ','')
@@ -383,6 +390,7 @@ end
_push_functions = {}
_is_functions = {}
+_enums = {}
_to_functions = {}
_base_push_functions = {}
@@ -411,5 +419,8 @@ function get_to_function(t)
end
function get_is_function(t)
+ if _enums[t] then
+ return "tolua_is" .. t
+ end
return _is_functions[t] or search_base(t, _base_is_functions) or "tolua_isusertype"
end