forked from enlightenment/efl
parent
4406d7098c
commit
10fd3c32e8
|
@ -259,7 +259,6 @@ ffi.cdef [[
|
|||
const Eolian_Implement *eolian_function_implement_get(const Eolian_Function *function_id);
|
||||
Eina_Bool eolian_function_is_legacy_only(const Eolian_Function *function_id, Eolian_Function_Type ftype);
|
||||
Eina_Bool eolian_function_is_class(const Eolian_Function *function_id);
|
||||
Eina_Bool eolian_function_is_c_only(const Eolian_Function *function_id);
|
||||
Eina_Iterator *eolian_property_keys_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
|
||||
Eina_Iterator *eolian_property_values_get(const Eolian_Function *foo_id, Eolian_Function_Type ftype);
|
||||
Eina_Iterator *eolian_function_parameters_get(const Eolian_Function *function_id);
|
||||
|
@ -806,10 +805,6 @@ M.Function = ffi.metatype("Eolian_Function", {
|
|||
return eolian.eolian_function_is_class(self) ~= 0
|
||||
end,
|
||||
|
||||
is_c_only = function(self)
|
||||
return eolian.eolian_function_is_c_only(self) ~= 0
|
||||
end,
|
||||
|
||||
property_keys_get = function(self, ftype)
|
||||
return Ptr_Iterator("const Eolian_Function_Parameter*",
|
||||
eolian.eolian_property_keys_get(self, ftype))
|
||||
|
|
|
@ -798,16 +798,6 @@ EAPI Eina_Bool eolian_function_is_legacy_only(const Eolian_Function *function_id
|
|||
*/
|
||||
EAPI Eina_Bool eolian_function_is_class(const Eolian_Function *function_id);
|
||||
|
||||
/*
|
||||
* @brief Get whether a function is C only (i.e. not bindable).
|
||||
*
|
||||
* @param[in] function_id Id of the function
|
||||
* @return EINA_TRUE and EINA_FALSE respectively
|
||||
*
|
||||
* @ingroup Eolian
|
||||
*/
|
||||
EAPI Eina_Bool eolian_function_is_c_only(const Eolian_Function *function_id);
|
||||
|
||||
/*
|
||||
* @brief Get whether a function is beta.
|
||||
*
|
||||
|
|
|
@ -401,13 +401,6 @@ eolian_function_class_get(const Eolian_Function *fid)
|
|||
return fid->klass;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
eolian_function_is_c_only(const Eolian_Function *fid)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, EINA_FALSE);
|
||||
return fid->is_c_only;
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
eolian_function_is_beta(const Eolian_Function *fid)
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ enum Tokens
|
|||
KW(get), KW(implements), KW(import), KW(interface), KW(keys), KW(legacy), \
|
||||
KW(legacy_prefix), KW(methods), KW(mixin), KW(own), KW(params), KW(ptr), \
|
||||
KW(set), KW(type), KW(values), KW(var), KWAT(auto), KWAT(beta), \
|
||||
KWAT(c_only), KWAT(class), KWAT(const), KWAT(empty), KWAT(extern), \
|
||||
KWAT(class), KWAT(const), KWAT(empty), KWAT(extern), \
|
||||
KWAT(free), KWAT(hot), KWAT(in), KWAT(inout), KWAT(nonull), KWAT(nullable), \
|
||||
KWAT(optional), KWAT(out), KWAT(private), KWAT(property), \
|
||||
KWAT(protected), KWAT(restart), KWAT(pure_virtual), KWAT(warn_unused), \
|
||||
|
|
|
@ -1290,8 +1290,7 @@ parse_property(Eo_Lexer *ls)
|
|||
Eina_Bool has_get = EINA_FALSE, has_set = EINA_FALSE,
|
||||
has_keys = EINA_FALSE, has_values = EINA_FALSE,
|
||||
has_protected = EINA_FALSE, has_class = EINA_FALSE,
|
||||
has_c_only = EINA_FALSE, has_beta = EINA_FALSE,
|
||||
has_virtp = EINA_FALSE;
|
||||
has_beta = EINA_FALSE, has_virtp = EINA_FALSE;
|
||||
prop = calloc(1, sizeof(Eolian_Function));
|
||||
prop->klass = ls->tmp.kls;
|
||||
prop->type = EOLIAN_UNRESOLVED;
|
||||
|
@ -1325,11 +1324,6 @@ parse_property(Eo_Lexer *ls)
|
|||
prop->is_class = EINA_TRUE;
|
||||
eo_lexer_get(ls);
|
||||
break;
|
||||
case KW_at_c_only:
|
||||
CASE_LOCK(ls, c_only, "c_only qualifier");
|
||||
prop->is_c_only = EINA_TRUE;
|
||||
eo_lexer_get(ls);
|
||||
break;
|
||||
case KW_at_beta:
|
||||
CASE_LOCK(ls, beta, "beta qualifier");
|
||||
prop->is_beta = EINA_TRUE;
|
||||
|
@ -1391,9 +1385,7 @@ parse_function_pointer(Eo_Lexer *ls)
|
|||
Eolian_Function *meth = NULL;
|
||||
|
||||
Eina_Bool has_params = EINA_FALSE,
|
||||
has_return = EINA_FALSE,
|
||||
has_c_only = EINA_FALSE,
|
||||
has_beta = EINA_FALSE;
|
||||
has_return = EINA_FALSE;
|
||||
|
||||
eo_lexer_get(ls);
|
||||
|
||||
|
@ -1416,22 +1408,10 @@ parse_function_pointer(Eo_Lexer *ls)
|
|||
|
||||
def->function_pointer = meth;
|
||||
|
||||
for (;;) switch (ls->t.kw)
|
||||
{
|
||||
case KW_at_c_only:
|
||||
CASE_LOCK(ls, c_only, "c_only qualifier");
|
||||
meth->is_c_only = EINA_TRUE;
|
||||
eo_lexer_get(ls);
|
||||
break;
|
||||
case KW_at_beta:
|
||||
CASE_LOCK(ls, beta, "beta qualifier");
|
||||
meth->is_beta = EINA_TRUE;
|
||||
eo_lexer_get(ls);
|
||||
break;
|
||||
default:
|
||||
goto body;
|
||||
}
|
||||
body:
|
||||
meth->is_beta = (ls->t.kw == KW_at_beta);
|
||||
if (meth->is_beta)
|
||||
eo_lexer_get(ls);
|
||||
|
||||
bline = ls->line_number;
|
||||
bcol = ls->column;
|
||||
check_next(ls, '{');
|
||||
|
@ -1472,8 +1452,8 @@ parse_method(Eo_Lexer *ls)
|
|||
Eina_Bool has_const = EINA_FALSE, has_params = EINA_FALSE,
|
||||
has_return = EINA_FALSE, has_legacy = EINA_FALSE,
|
||||
has_protected = EINA_FALSE, has_class = EINA_FALSE,
|
||||
has_eo = EINA_FALSE, has_c_only = EINA_FALSE,
|
||||
has_beta = EINA_FALSE, has_virtp = EINA_FALSE;
|
||||
has_eo = EINA_FALSE, has_beta = EINA_FALSE,
|
||||
has_virtp = EINA_FALSE;
|
||||
meth = calloc(1, sizeof(Eolian_Function));
|
||||
meth->klass = ls->tmp.kls;
|
||||
meth->type = EOLIAN_METHOD;
|
||||
|
@ -1512,11 +1492,6 @@ parse_method(Eo_Lexer *ls)
|
|||
meth->is_class = EINA_TRUE;
|
||||
eo_lexer_get(ls);
|
||||
break;
|
||||
case KW_at_c_only:
|
||||
CASE_LOCK(ls, c_only, "c_only qualifier");
|
||||
meth->is_c_only = EINA_TRUE;
|
||||
eo_lexer_get(ls);
|
||||
break;
|
||||
case KW_at_beta:
|
||||
CASE_LOCK(ls, beta, "beta qualifier");
|
||||
meth->is_beta = EINA_TRUE;
|
||||
|
|
|
@ -134,7 +134,6 @@ struct _Eolian_Function
|
|||
Eina_Bool get_only_legacy: 1;
|
||||
Eina_Bool set_only_legacy: 1;
|
||||
Eina_Bool is_class :1;
|
||||
Eina_Bool is_c_only :1;
|
||||
Eina_Bool is_beta :1;
|
||||
Eina_List *ctor_of;
|
||||
Eolian_Class *klass;
|
||||
|
|
|
@ -391,10 +391,6 @@ M.Function = Node:clone {
|
|||
return self.func:is_class()
|
||||
end,
|
||||
|
||||
is_c_only = function(self)
|
||||
return self.func:is_c_only()
|
||||
end,
|
||||
|
||||
property_keys_get = function(self, ft)
|
||||
local ret = {}
|
||||
for par in self.func:property_keys_get(ft) do
|
||||
|
|
|
@ -116,9 +116,6 @@ local gen_func_namesig = function(fn, cl, buf, isprop, isget, isset)
|
|||
if fn:is_const() then
|
||||
buf[#buf + 1] = "@const "
|
||||
end
|
||||
if fn:is_c_only() then
|
||||
buf[#buf + 1] = "@c_only "
|
||||
end
|
||||
end
|
||||
|
||||
local gen_func_param = function(fp, buf, nodir)
|
||||
|
|
|
@ -630,7 +630,7 @@ local gen_contents = function(klass)
|
|||
for i, v in ipairs(props) do
|
||||
local gscope = v:scope_get(func_type.PROP_GET)
|
||||
local sscope = v:scope_get(func_type.PROP_SET)
|
||||
if (gscope == obj_scope.PUBLIC or sscope == obj_scope.PUBLIC) and not v:is_c_only() then
|
||||
if (gscope == obj_scope.PUBLIC or sscope == obj_scope.PUBLIC) then
|
||||
local ftype = v:type_get()
|
||||
local fread = (ftype == func_type.PROPERTY or ftype == func_type.PROP_GET)
|
||||
local fwrite = (ftype == func_type.PROPERTY or ftype == func_type.PROP_SET)
|
||||
|
@ -645,7 +645,7 @@ local gen_contents = function(klass)
|
|||
-- then methods
|
||||
local meths = klass:functions_get(func_type.METHOD):to_array()
|
||||
for i, v in ipairs(meths) do
|
||||
if v:scope_get(func_type.METHOD) == obj_scope.PUBLIC and not v:is_c_only() then
|
||||
if v:scope_get(func_type.METHOD) == obj_scope.PUBLIC then
|
||||
cnt[#cnt + 1] = Method(v)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ class Class_Simple {
|
|||
value: int (100); [[Value description]]
|
||||
}
|
||||
}
|
||||
@property b @c_only {
|
||||
@property b {
|
||||
set {
|
||||
eo: null;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class Class_Simple {
|
|||
}
|
||||
return: ptr(char) (null); [[comment for method return]]
|
||||
}
|
||||
bar @c_only {
|
||||
bar {
|
||||
eo: null;
|
||||
params {
|
||||
x: int;
|
||||
|
|
|
@ -582,7 +582,6 @@ START_TEST(eolian_simple_parsing)
|
|||
fail_if(!(fid = eolian_class_function_get_by_name(class, "b", EOLIAN_PROP_SET)));
|
||||
fail_if(eolian_function_is_legacy_only(fid, EOLIAN_PROP_GET));
|
||||
fail_if(!eolian_function_is_legacy_only(fid, EOLIAN_PROP_SET));
|
||||
fail_if(!eolian_function_is_c_only(fid));
|
||||
fail_if(eolian_function_is_beta(fid));
|
||||
|
||||
/* Method */
|
||||
|
@ -633,7 +632,6 @@ START_TEST(eolian_simple_parsing)
|
|||
/* legacy only + c only */
|
||||
fail_if(!(fid = eolian_class_function_get_by_name(class, "bar", EOLIAN_METHOD)));
|
||||
fail_if(!eolian_function_is_legacy_only(fid, EOLIAN_METHOD));
|
||||
fail_if(!eolian_function_is_c_only(fid));
|
||||
fail_if(eolian_function_is_beta(fid));
|
||||
fail_if(!eolian_type_is_ptr(eolian_function_return_type_get(fid, EOLIAN_METHOD)));
|
||||
|
||||
|
|
Loading…
Reference in New Issue