eolian: allow new property impl syntax with auto/empty

This commit is contained in:
Daniel Kolesa 2016-12-27 19:33:12 +01:00
parent 6d9d15d35c
commit 3797a269b6
4 changed files with 20 additions and 29 deletions

View File

@ -1547,22 +1547,7 @@ parse_implement(Eo_Lexer *ls, Eina_Bool iface)
eo_lexer_syntax_error(ls, "name expected");
impl->full_name = eina_stringshare_printf(".%s", ls->t.value.s);
eo_lexer_get(ls);
if (ls->t.token == '.')
{
eo_lexer_get(ls);
if (ls->t.kw == KW_set)
{
impl->is_prop_set = EINA_TRUE;
eo_lexer_get(ls);
}
else
{
check_kw_next(ls, KW_get);
impl->is_prop_get = EINA_TRUE;
}
}
check_next(ls, ';');
return;
goto propbeg;
}
fullclass:
if ((ls->t.token != TOK_VALUE) || (ls->t.kw == KW_get || ls->t.kw == KW_set))
@ -1614,6 +1599,7 @@ fullclass:
if (ls->t.token != '.') break;
eo_lexer_get(ls);
}
propbeg:
if (ls->t.token == '{')
{
Eina_Bool has_get = EINA_FALSE, has_set = EINA_FALSE;
@ -1641,8 +1627,11 @@ propend:
else
check_next(ls, ';');
end:
impl->full_name = eina_stringshare_add(eina_strbuf_string_get(buf));
pop_strbuf(ls);
if (buf)
{
impl->full_name = eina_stringshare_add(eina_strbuf_string_get(buf));
pop_strbuf(ls);
}
}
static void

View File

@ -1,7 +1,7 @@
class nmsp1.class1 (nmsp1.nmsp11.class2, nmsp2.class1, no_nmsp)
{
implements {
nmsp1.nmsp11.class2.a.set;
nmsp1.nmsp11.class2.a { set; }
no_nmsp.foo;
}
}

View File

@ -44,10 +44,9 @@ class Override (Base) {
}
implements {
Base.constructor;
@auto .b.set;
@auto .b { set; }
@empty .bar;
@auto .c.get;
@auto Base.z.get;
@empty Base.z.set;
@auto .c { get; }
@auto Base.z { get; set; }
}
}

View File

@ -26,6 +26,14 @@ static int __eolian_override_c_get(Eo *obj EINA_UNUSED, Override_Data *pd EINA_U
EOAPI EFL_FUNC_BODYV_CONST(override_c_get, int, 50, EFL_FUNC_CALL(idx), int idx);
static void __eolian_override_base_z_set(Eo *obj EINA_UNUSED, Override_Data *pd, int a, char b, float c)
{
a = pd->a;
b = pd->b;
c = pd->c;
}
static void __eolian_override_base_z_get(Eo *obj EINA_UNUSED, Override_Data *pd, int *a, char *b, float *c)
{
if (a) *a = pd->a;
@ -33,11 +41,6 @@ static void __eolian_override_base_z_get(Eo *obj EINA_UNUSED, Override_Data *pd,
if (c) *c = pd->c;
}
static void __eolian_override_base_z_set(Eo *obj EINA_UNUSED, Override_Data *pd EINA_UNUSED, int a EINA_UNUSED, char b EINA_UNUSED, float c EINA_UNUSED)
{
}
EOAPI EFL_VOID_FUNC_BODY(override_a_set);
void _override_a_get(Eo *obj, Override_Data *pd);
@ -61,8 +64,8 @@ _override_class_initializer(Efl_Class *klass)
EFL_OBJECT_OP_FUNC(override_b_set, __eolian_override_b_set),
EFL_OBJECT_OP_FUNC(override_bar, __eolian_override_bar),
EFL_OBJECT_OP_FUNC(override_c_get, __eolian_override_c_get),
EFL_OBJECT_OP_FUNC(base_z_get, __eolian_override_base_z_get),
EFL_OBJECT_OP_FUNC(base_z_set, __eolian_override_base_z_set),
EFL_OBJECT_OP_FUNC(base_z_get, __eolian_override_base_z_get),
EFL_OBJECT_OP_FUNC(override_a_set, NULL),
EFL_OBJECT_OP_FUNC(override_a_get, _override_a_get),
EFL_OBJECT_OP_FUNC(override_b_get, _override_b_get),