eolian: turn "undefined type" into its own EOLIAN_TYPE

This commit is contained in:
Daniel Kolesa 2015-11-19 14:04:37 +00:00
parent b2202a5064
commit b3867ce395
6 changed files with 13 additions and 8 deletions

View 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);

View 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", {

View 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

View 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)

View 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)

View 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;