q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1c78d2196bf018f1cfc84f4668be0fe3fb4a7ca1

commit 1c78d2196bf018f1cfc84f4668be0fe3fb4a7ca1
Author: Daniel Kolesa <d.kol...@osg.samsung.com>
Date:   Tue Aug 23 13:43:46 2016 +0100

    eolian: enforce no get/set as method/property name rule
    
    Fixes T3849.
---
 src/lib/efl/interfaces/efl_vpath_core.c  |  2 +-
 src/lib/efl/interfaces/efl_vpath_core.eo |  2 +-
 src/lib/eolian/eo_parser.c               | 10 ++++++++++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/lib/efl/interfaces/efl_vpath_core.c 
b/src/lib/efl/interfaces/efl_vpath_core.c
index e3678ad..f82e75a 100644
--- a/src/lib/efl/interfaces/efl_vpath_core.c
+++ b/src/lib/efl/interfaces/efl_vpath_core.c
@@ -216,7 +216,7 @@ _efl_vpath_core_efl_object_destructor(Eo *obj, 
Efl_Vpath_Core_Data *pd)
 }
 
 EOLIAN static Efl_Vpath_Core *
-_efl_vpath_core_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
+_efl_vpath_core_core_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
 {
    // no locks here as we expect efl to init this early in main "thread"
    if (!vpath_core) vpath_core = efl_add(EFL_VPATH_CORE_CLASS, NULL);
diff --git a/src/lib/efl/interfaces/efl_vpath_core.eo 
b/src/lib/efl/interfaces/efl_vpath_core.eo
index 9c959c6..98a667b 100644
--- a/src/lib/efl/interfaces/efl_vpath_core.eo
+++ b/src/lib/efl/interfaces/efl_vpath_core.eo
@@ -6,7 +6,7 @@ class Efl.Vpath.Core (Efl.Object, Efl.Vpath)
    ]]
    eo_prefix: efl_vpath_core;
    methods {
-      get @class {
+      core_get @class {
          [[ This gets the global EFL Core Vpath class - only 1 - singleton ]]
          return: Efl.Vpath.Core; [[ Get the singleton core vpath ]]
       }
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index d81b8d7..0f302c1 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -1351,6 +1351,11 @@ parse_property(Eo_Lexer *ls)
    FILL_BASE(prop->base, ls, ls->line_number, ls->column);
    ls->tmp.kls->properties = eina_list_append(ls->tmp.kls->properties, prop);
    check(ls, TOK_VALUE);
+   if (ls->t.kw == KW_get || ls->t.kw == KW_set)
+     {
+        eo_lexer_syntax_error(ls, "reserved keyword as property name");
+        return;
+     }
    prop->name = eina_stringshare_ref(ls->t.value.s);
    eo_lexer_get(ls);
    for (;;) switch (ls->t.kw)
@@ -1431,6 +1436,11 @@ parse_method(Eo_Lexer *ls)
    FILL_BASE(meth->base, ls, ls->line_number, ls->column);
    ls->tmp.kls->methods = eina_list_append(ls->tmp.kls->methods, meth);
    check(ls, TOK_VALUE);
+   if (ls->t.kw == KW_get || ls->t.kw == KW_set)
+     {
+        eo_lexer_syntax_error(ls, "reserved keyword as method name");
+        return;
+     }
    meth->name = eina_stringshare_ref(ls->t.value.s);
    eo_lexer_get(ls);
    for (;;) switch (ls->t.kw)

-- 


Reply via email to