From 2a18fcda722114a099fee0ca373115478f47474b Mon Sep 17 00:00:00 2001 From: Mauro Iazzi Date: Mon, 19 May 2008 15:29:58 +0200 Subject: [PATCH] added typesystem table filled tpesystem table with enum --- new/generator.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/new/generator.lua b/new/generator.lua index 00d7955..ffa2b24 100644 --- a/new/generator.lua +++ b/new/generator.lua @@ -894,6 +894,25 @@ local fill_special_methods = function(index, functions) return index end +local fill_typesystem_with_enums = function(enums, types) + local ret = {} + for e in pairs(enums) do + if not types[e.xarg.fullname] then + ret[e] = true + types[e.xarg.fullname] = { + push = function(n) + return 'lqtL_pushenum(L, '..n..', "'..e.xarg.fullname..'")', 1 + end, + get = function(n) + return 'static_cast<'..e.xarg.fullname..'>' + ..'(lqtL_getenum(L, '..n..', "'..e.xarg.fullname..'"))', 1 + end, + } + end + end + return ret +end + local functions = copy_functions(idindex) local functions = fix_functions(functions) @@ -906,6 +925,9 @@ local classes = fill_special_methods(classes) local ntable = function(t) local ret=0 for _ in pairs(t) do ret=ret+1 end return ret end +local typesystem = {} + + print(ntable(functions)) print(ntable(enums)) print(ntable(classes)) -- 2.11.4.GIT