summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-06-24 17:23:13 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-06-30 17:20:07 +0100
commitd8701252311751d8383c743d7d4ea37fad2ca113 (patch)
tree7536898ebf2e758b96797955018ebb005b492ac9
parent8a82e0fdf4bf531a1d778c5cbf1860e2b00e0cd1 (diff)
downloadefl-d8701252311751d8383c743d7d4ea37fad2ca113.tar.gz
elua: use the new dedup API in lualiandevs/q66/eolian_experimental
-rw-r--r--src/bin/elua/modules/lualian.lua18
-rw-r--r--src/bindings/luajit/eolian.lua7
2 files changed, 9 insertions, 16 deletions
diff --git a/src/bin/elua/modules/lualian.lua b/src/bin/elua/modules/lualian.lua
index 311e5c05be..c2d0cb170b 100644
--- a/src/bin/elua/modules/lualian.lua
+++ b/src/bin/elua/modules/lualian.lua
@@ -122,20 +122,6 @@ local typeconv = function(tps, expr, isin)
return build_calln(tps, expr, false)
end
-local dedup_name = function(classn, funcn)
- local suffix = classn:match(".+_(.+)" ) or classn
- local prefix = funcn:match("([^_]+)_.+") or funcn
- if prefix == suffix then
- if classn == suffix then
- return funcn
- else
- return classn:match("(.+_).+") .. funcn
- end
- else
- return classn .. "_" .. funcn
- end
-end
-
local Node = util.Object:clone {
generate = function(self, s)
end,
@@ -184,7 +170,7 @@ local Method = Node:clone {
local allocs = {}
proto.allocs = allocs
- proto.full_name = dedup_name(self.parent_node.prefix, proto.name)
+ proto.full_name = meth:full_c_name_get(self.parent_node.prefix)
local dirs = eolian.parameter_dir
@@ -280,7 +266,7 @@ local Property = Method:clone {
local allocs = {}
proto.allocs = allocs
- proto.full_name = dedup_name(self.parent_node.prefix, proto.name)
+ proto.full_name = prop:full_c_name_get(self.parent_node.prefix)
.. proto.suffix
local dirs = eolian.parameter_dir
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 01d7f99a49..1baf0368b0 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -71,6 +71,7 @@ ffi.cdef [[
Eolian_Function_Type eolian_function_type_get(Eolian_Function *function_id);
Eolian_Function_Scope eolian_function_scope_get(Eolian_Function *function_id);
const char *eolian_function_name_get(Eolian_Function *function_id);
+ const char *eolian_function_full_c_name_get(Eolian_Function function_id, const char *prefix);
Eolian_Function *eolian_class_function_find_by_name(const Eolian_Class *klass, const char *func_name, Eolian_Function_Type f_type);
const char *eolian_function_data_get(Eolian_Function *function_id, const char *key);
Eina_Bool eolian_function_is_virtual_pure(Eolian_Function *function_id, Eolian_Function_Type f_type);
@@ -190,6 +191,12 @@ M.Function = ffi.metatype("Eolian_Function", {
return ffi.string(v)
end,
+ full_c_name_get = function(self)
+ local v = eolian.eolian_function_full_c_name_get(self)
+ if v == nil then return nil end
+ return ffi.string(v)
+ end,
+
data_get = function(self, key)
local v = eolian.eolian_function_data_get(self, key)
if v == nil then return nil end