eolian: turn "undefined type" into its own EOLIAN_TYPE
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 19 Nov 2015 14:04:37 +0000 (14:04 +0000)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 19 Nov 2015 14:05:16 +0000 (14:05 +0000)
src/bin/eolian/types_generator.c
src/bindings/luajit/eolian.lua
src/lib/eolian/Eolian.h
src/lib/eolian/database_validate.c
src/lib/eolian/eo_lexer.h
src/lib/eolian/eo_parser.c

index 5fee46b..32864fd 100644 (file)
@@ -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);
index e71eaad..96be587 100644 (file)
@@ -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", {
index 2aeb664..44b4e9a 100644 (file)
@@ -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
index 43ab8bc..938d6c8 100644 (file)
@@ -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)
index 8bb8f68..9508765 100644 (file)
@@ -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)
 
index 53dbe32..43fb30f 100644 (file)
@@ -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;