eolian implements: prepare API for whole-property implements

This commit is contained in:
Daniel Kolesa 2016-12-23 16:31:37 +01:00
parent 05521763ed
commit df55f75ace
1 changed files with 5 additions and 9 deletions

View File

@ -31,7 +31,9 @@ eolian_implement_function_get(const Eolian_Implement *impl,
if (!func_type)
return impl->foo_id;
if (impl->is_prop_get)
if (impl->is_prop_get && impl->is_prop_set)
*func_type = EOLIAN_PROPERTY;
else if (impl->is_prop_get)
*func_type = EOLIAN_PROP_GET;
else if (impl->is_prop_set)
*func_type = EOLIAN_PROP_SET;
@ -49,6 +51,8 @@ eolian_implement_function_get(const Eolian_Implement *impl,
Eolian_Function_Type tp = EOLIAN_UNRESOLVED;
if (impl->is_prop_get && impl->is_prop_set)
tp = EOLIAN_PROPERTY;
if (impl->is_prop_get)
tp = EOLIAN_PROP_GET;
else if (impl->is_prop_set)
@ -58,14 +62,6 @@ eolian_implement_function_get(const Eolian_Implement *impl,
func_name,
tp);
if (fid && tp == EOLIAN_UNRESOLVED && (fid->type == EOLIAN_PROP_GET
|| fid->type == EOLIAN_PROP_SET))
{
fprintf(stderr, "eolian:%s:%d:%d: both get and set required for property '%s'\n",
impl->base.file, impl->base.line, impl->base.column, func_name);
return NULL;
}
if (func_type)
{
if (tp == EOLIAN_UNRESOLVED)