q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3797a269b69ced4c66bc50f32b2027cb3bfcdded

commit 3797a269b69ced4c66bc50f32b2027cb3bfcdded
Author: Daniel Kolesa <[email protected]>
Date:   Tue Dec 27 19:33:12 2016 +0100

    eolian: allow new property impl syntax with auto/empty
---
 src/lib/eolian/eo_parser.c            | 25 +++++++------------------
 src/tests/eolian/data/nmsp1_class1.eo |  2 +-
 src/tests/eolian/data/override.eo     |  7 +++----
 src/tests/eolian/data/override_ref.c  | 15 +++++++++------
 4 files changed, 20 insertions(+), 29 deletions(-)

diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 62beee4..451e883 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -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
diff --git a/src/tests/eolian/data/nmsp1_class1.eo 
b/src/tests/eolian/data/nmsp1_class1.eo
index d283aaf..42d6c04 100644
--- a/src/tests/eolian/data/nmsp1_class1.eo
+++ b/src/tests/eolian/data/nmsp1_class1.eo
@@ -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;
    }
 }
diff --git a/src/tests/eolian/data/override.eo 
b/src/tests/eolian/data/override.eo
index 01fa110..abf80b6 100644
--- a/src/tests/eolian/data/override.eo
+++ b/src/tests/eolian/data/override.eo
@@ -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; }
    }
 }
diff --git a/src/tests/eolian/data/override_ref.c 
b/src/tests/eolian/data/override_ref.c
index e8dacf5..9d6fd8c 100644
--- a/src/tests/eolian/data/override_ref.c
+++ b/src/tests/eolian/data/override_ref.c
@@ -26,16 +26,19 @@ 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_get(Eo *obj EINA_UNUSED, Override_Data 
*pd, int *a, char *b, float *c)
+static void __eolian_override_base_z_set(Eo *obj EINA_UNUSED, Override_Data 
*pd, int a, char b, float c)
 {
-   if (a) *a = pd->a;
-   if (b) *b = pd->b;
-   if (c) *c = pd->c;
+   a = pd->a;
+   b = pd->b;
+   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)
+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;
+   if (b) *b = pd->b;
+   if (c) *c = pd->c;
 }
 
 EOAPI EFL_VOID_FUNC_BODY(override_a_set);
@@ -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),

-- 


Reply via email to