eolian: integrate event type requirement into eo file grammar

This commit is contained in:
Daniel Kolesa 2018-05-19 01:49:06 +02:00
parent f747df69f9
commit 175b25ab2e
2 changed files with 4 additions and 14 deletions

View File

@ -479,14 +479,7 @@ _validate_event(Validate_State *vals, Eolian_Event *event, Eina_Hash *nhash)
return EINA_TRUE;
}
if (!event->type)
{
snprintf(buf, sizeof(buf), "event '%s' has no type", event->base.name);
_obj_error(&event->base, buf);
vals->warned = EINA_TRUE;
}
if (event->type && !_validate_type(vals, event->type))
if (!_validate_type(vals, event->type))
return EINA_FALSE;
if (!_validate_doc(event->doc))

View File

@ -1748,12 +1748,9 @@ parse_event(Eo_Lexer *ls)
goto end;
}
end:
if (ls->t.token == ':')
{
eo_lexer_get(ls);
ev->type = eo_lexer_type_release(ls, parse_type_void(ls));
ev->type->owned = has_owned;
}
check_next(ls, ':');
ev->type = eo_lexer_type_release(ls, parse_type_void(ls));
ev->type->owned = has_owned;
check(ls, ';');
eo_lexer_get(ls);
FILL_DOC(ls, ev, doc);