forked from enlightenment/efl
elua: eo_prefix fix + add method name deduplication to lua generator
This commit is contained in:
parent
471b4435b4
commit
7ea7542e9e
|
@ -122,6 +122,20 @@ local typeconv = function(tps, expr, isin)
|
||||||
return build_calln(tps, expr, false)
|
return build_calln(tps, expr, false)
|
||||||
end
|
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 {
|
local Node = util.Object:clone {
|
||||||
generate = function(self, s)
|
generate = function(self, s)
|
||||||
end,
|
end,
|
||||||
|
@ -170,7 +184,7 @@ local Method = Node:clone {
|
||||||
local allocs = {}
|
local allocs = {}
|
||||||
proto.allocs = allocs
|
proto.allocs = allocs
|
||||||
|
|
||||||
proto.full_name = self.parent_node.prefix .. "_" .. proto.name
|
proto.full_name = dedup_name(self.parent_node.prefix, proto.name)
|
||||||
|
|
||||||
local dirs = eolian.parameter_dir
|
local dirs = eolian.parameter_dir
|
||||||
|
|
||||||
|
@ -266,7 +280,7 @@ local Property = Method:clone {
|
||||||
local allocs = {}
|
local allocs = {}
|
||||||
proto.allocs = allocs
|
proto.allocs = allocs
|
||||||
|
|
||||||
proto.full_name = self.parent_node.prefix .. "_" .. proto.name
|
proto.full_name = dedup_name(self.parent_node.prefix, proto.name)
|
||||||
.. proto.suffix
|
.. proto.suffix
|
||||||
|
|
||||||
local dirs = eolian.parameter_dir
|
local dirs = eolian.parameter_dir
|
||||||
|
|
|
@ -400,7 +400,7 @@ M.Class = ffi.metatype("Eolian_Class", {
|
||||||
if v == nil then
|
if v == nil then
|
||||||
local buf = self:namespaces_list_get()
|
local buf = self:namespaces_list_get()
|
||||||
buf[#buf + 1] = self:name_get()
|
buf[#buf + 1] = self:name_get()
|
||||||
return table.concat(buf, "_")
|
return table.concat(buf, "_"):lower()
|
||||||
end
|
end
|
||||||
return ffi.string(v)
|
return ffi.string(v)
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in New Issue