summaryrefslogtreecommitdiffstats
path: root/lib/tolua++/src/bin/lua/basic.lua
diff options
context:
space:
mode:
authordaniel0916 <theschokolps@gmail.com>2014-04-07 20:12:17 +0200
committerdaniel0916 <theschokolps@gmail.com>2014-04-07 20:12:17 +0200
commit2e9754ac1cf0537c12ab7974cf55c451c0724540 (patch)
tree713c5b8c8f22f77893b30b9c8cefca4a7c491483 /lib/tolua++/src/bin/lua/basic.lua
parentFixed merge conflict (diff)
parentFixed some more minor issues with the redstone simulator. (diff)
downloadcuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.gz
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.bz2
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.lz
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.xz
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.tar.zst
cuberite-2e9754ac1cf0537c12ab7974cf55c451c0724540.zip
Diffstat (limited to 'lib/tolua++/src/bin/lua/basic.lua')
-rw-r--r--lib/tolua++/src/bin/lua/basic.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/tolua++/src/bin/lua/basic.lua b/lib/tolua++/src/bin/lua/basic.lua
index f651f1fe6..4bff5276b 100644
--- a/lib/tolua++/src/bin/lua/basic.lua
+++ b/lib/tolua++/src/bin/lua/basic.lua
@@ -23,6 +23,7 @@ _basic = {
['unsigned'] = 'number',
['float'] = 'number',
['double'] = 'number',
+ ['size_t'] = 'number',
['_cstring'] = 'string',
['_userdata'] = 'userdata',
['char*'] = 'string',
@@ -66,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
@@ -145,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 ','')
@@ -382,6 +390,7 @@ end
_push_functions = {}
_is_functions = {}
+_enums = {}
_to_functions = {}
_base_push_functions = {}
@@ -410,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