q66 pushed a commit to branch master.

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

commit b3867ce395f9a65dfebcfe9b05d4c1fe6861d2cf
Author: Daniel Kolesa <d.kol...@osg.samsung.com>
Date:   Thu Nov 19 14:04:37 2015 +0000

    eolian: turn "undefined type" into its own EOLIAN_TYPE
---
 src/bin/eolian/types_generator.c   | 5 ++---
 src/bindings/luajit/eolian.lua     | 3 ++-
 src/lib/eolian/Eolian.h            | 3 ++-
 src/lib/eolian/database_validate.c | 3 +--
 src/lib/eolian/eo_lexer.h          | 2 +-
 src/lib/eolian/eo_parser.c         | 5 +++++
 6 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/bin/eolian/types_generator.c b/src/bin/eolian/types_generator.c
index 5fee46b..32864fd 100644
--- a/src/bin/eolian/types_generator.c
+++ b/src/bin/eolian/types_generator.c
@@ -198,9 +198,8 @@ types_header_generate(const char *eo_filename, Eina_Strbuf 
*buf, Eina_Bool full,
         if (eolian_type_type_get(tp) == EOLIAN_TYPE_ALIAS)
           {
              const Eolian_Type *btp = eolian_type_base_type_get(tp);
-             if (eolian_type_type_get(btp) == EOLIAN_TYPE_REGULAR)
-               if (!strcmp(eolian_type_full_name_get(btp), "__undefined_type"))
-                 continue;
+             if (eolian_type_type_get(btp) == EOLIAN_TYPE_UNDEFINED)
+               continue;
           }
 
         Eina_Strbuf *tbuf = _type_generate(tp, full, use_legacy);
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index e71eaad..96be587 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -424,7 +424,8 @@ M.type_type = {
     STRUCT_OPAQUE  = 7,
     ENUM           = 8,
     ALIAS          = 9,
-    CLASS          = 10
+    CLASS          = 10,
+    UNDEFINED      = 11
 }
 
 ffi.metatype("Eolian_Struct_Type_Field", {
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 2aeb664..44b4e9a 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -208,7 +208,8 @@ typedef enum
    EOLIAN_TYPE_STRUCT_OPAQUE,
    EOLIAN_TYPE_ENUM,
    EOLIAN_TYPE_ALIAS,
-   EOLIAN_TYPE_CLASS
+   EOLIAN_TYPE_CLASS,
+   EOLIAN_TYPE_UNDEFINED
 } Eolian_Type_Type;
 
 typedef enum
diff --git a/src/lib/eolian/database_validate.c 
b/src/lib/eolian/database_validate.c
index 43ab8bc..938d6c8 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -176,6 +176,7 @@ _validate_type(const Eolian_Type *tp)
    switch (tp->type)
      {
       case EOLIAN_TYPE_VOID:
+      case EOLIAN_TYPE_UNDEFINED:
       case EOLIAN_TYPE_COMPLEX:
         return EINA_TRUE;
       case EOLIAN_TYPE_REGULAR:
@@ -185,8 +186,6 @@ _validate_type(const Eolian_Type *tp)
            int id = eo_lexer_keyword_str_to_id(tp->full_name);
            if (id)
              return eo_lexer_is_type_keyword(id);
-           if (!strcmp(tp->full_name, "__undefined_type"))
-             return EINA_TRUE;
            /* user defined */
            tpp = eolian_type_base_type_get(tp);
            if (!tpp)
diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h
index 8bb8f68..9508765 100644
--- a/src/lib/eolian/eo_lexer.h
+++ b/src/lib/eolian/eo_lexer.h
@@ -52,7 +52,7 @@ enum Tokens
     \
     KW(accessor), KW(array), KW(iterator), KW(hash), KW(list), 
KW(generic_value), \
     \
-    KW(__builtin_event_cb), \
+    KW(__builtin_event_cb), KW(__undefined_type), \
     \
     KW(true), KW(false), KW(null)
 
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 53dbe32..43fb30f 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -752,6 +752,11 @@ parse_type_void_base(Eo_Lexer *ls, Eina_Bool noptr)
         def->type = EOLIAN_TYPE_VOID;
         eo_lexer_get(ls);
      }
+   else if (ls->t.kw == KW___undefined_type)
+     {
+        def->type = EOLIAN_TYPE_UNDEFINED;
+        eo_lexer_get(ls);
+     }
    else
      {
         int tpid = ls->t.kw;

-- 


Reply via email to