elua: check for property/method scope in lualian (don't generate code for protected methods as they're only usable within implementations)

This commit is contained in:
Daniel Kolesa 2014-04-17 11:50:54 +01:00 committed by Daniel Kolesa
parent dca8afb2cc
commit 5b29cc38e1
1 changed files with 13 additions and 9 deletions

View File

@ -360,20 +360,24 @@ local gen_contents = function(classn)
-- first try properties
local props = eolian.class_functions_list_get(classn, ft.PROPERTY)
for i, v in ipairs(props) do
local ftype = v:type_get()
local fread = (ftype == ft.PROPERTY or ftype == ft.PROP_GET)
local fwrite = (ftype == ft.PROPERTY or ftype == ft.PROP_SET)
if fwrite then
cnt[#cnt + 1] = Property(v, ft.PROP_SET)
end
if fread then
cnt[#cnt + 1] = Property(v, ft.PROP_GET)
if v:scope_get() == eolian.function_scope.PUBLIC then
local ftype = v:type_get()
local fread = (ftype == ft.PROPERTY or ftype == ft.PROP_GET)
local fwrite = (ftype == ft.PROPERTY or ftype == ft.PROP_SET)
if fwrite then
cnt[#cnt + 1] = Property(v, ft.PROP_SET)
end
if fread then
cnt[#cnt + 1] = Property(v, ft.PROP_GET)
end
end
end
-- then methods
local meths = eolian.class_functions_list_get(classn, ft.METHOD)
for i, v in ipairs(meths) do
cnt[#cnt + 1] = Method(v)
if v:scope_get() == eolian.function_scope.PUBLIC then
cnt[#cnt + 1] = Method(v)
end
end
-- and constructors
local dflt_ctor = eolian.class_default_constructor_get(classn)