eolian gen: do not use EOLIAN_UNRESOLVED/PROPERTY for lookups

This commit is contained in:
Daniel Kolesa 2017-01-12 15:08:46 +01:00
parent 11432d42a7
commit deb1e58e06
3 changed files with 7 additions and 8 deletions

View File

@ -69,6 +69,7 @@ _generate_ref(const char *refn, Eina_Strbuf *wbuf, Eina_Bool use_legacy)
const Eolian_Class *cl = eolian_class_get_by_name(bname); const Eolian_Class *cl = eolian_class_get_by_name(bname);
const Eolian_Function *fn = NULL; const Eolian_Function *fn = NULL;
/* match methods and properties; we're only figuring out existence */
Eolian_Function_Type ftype = EOLIAN_UNRESOLVED; Eolian_Function_Type ftype = EOLIAN_UNRESOLVED;
if (!cl) if (!cl)
{ {
@ -416,9 +417,6 @@ eo_gen_docs_func_gen(const Eolian_Function *fid, Eolian_Function_Type ftype,
const char *group = eolian_class_full_name_get(eolian_function_class_get(fid)); const char *group = eolian_class_full_name_get(eolian_function_class_get(fid));
if (ftype == EOLIAN_UNRESOLVED)
ftype = EOLIAN_METHOD;
if (ftype == EOLIAN_METHOD) if (ftype == EOLIAN_METHOD)
{ {
doc = eolian_function_documentation_get(fid, EOLIAN_METHOD); doc = eolian_function_documentation_get(fid, EOLIAN_METHOD);

View File

@ -42,8 +42,9 @@ _gen_func(const Eolian_Function *fid, Eolian_Function_Type ftype,
if (!legacy && (fsc == EOLIAN_SCOPE_PROTECTED)) if (!legacy && (fsc == EOLIAN_SCOPE_PROTECTED))
eina_strbuf_append_printf(buf, "#ifdef %s_PROTECTED\n", cnameu); eina_strbuf_append_printf(buf, "#ifdef %s_PROTECTED\n", cnameu);
Eina_Bool hasdoc = eolian_function_documentation_get(fid, EOLIAN_UNRESOLVED) || Eina_Bool hasdoc = !!eolian_function_documentation_get(fid, ftype);
eolian_function_documentation_get(fid, ftype); if (!hasdoc && ((ftype == EOLIAN_PROP_GET) || (ftype == EOLIAN_PROP_SET)))
hasdoc = !!eolian_function_documentation_get(fid, EOLIAN_PROPERTY);
if (hasdoc) if (hasdoc)
{ {
Eina_Strbuf *dbuf = eo_gen_docs_func_gen(fid, ftype, 0, legacy); Eina_Strbuf *dbuf = eo_gen_docs_func_gen(fid, ftype, 0, legacy);
@ -239,7 +240,7 @@ eo_gen_header_gen(const Eolian_Class *cl, Eina_Strbuf *buf, Eina_Bool legacy)
_gen_func(fid, EOLIAN_PROP_GET, buf, cname, cnameu, legacy); _gen_func(fid, EOLIAN_PROP_GET, buf, cname, cnameu, legacy);
break; break;
default: default:
_gen_func(fid, EOLIAN_UNRESOLVED, buf, cname, cnameu, legacy); _gen_func(fid, EOLIAN_METHOD, buf, cname, cnameu, legacy);
} }
} }
eina_iterator_free(itr); eina_iterator_free(itr);

View File

@ -673,7 +673,7 @@ eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf)
_gen_func(cl, fid, EOLIAN_PROP_GET, buf, imp, lbuf); _gen_func(cl, fid, EOLIAN_PROP_GET, buf, imp, lbuf);
break; break;
default: default:
_gen_func(cl, fid, EOLIAN_UNRESOLVED, buf, imp, lbuf); _gen_func(cl, fid, EOLIAN_METHOD, buf, imp, lbuf);
} }
} }
eina_iterator_free(itr); eina_iterator_free(itr);
@ -991,7 +991,7 @@ eo_gen_impl_gen(const Eolian_Class *cl, Eina_Strbuf *buf)
_gen_proto(cl, fid, EOLIAN_PROP_GET, buf, imp, dt, cnamel); _gen_proto(cl, fid, EOLIAN_PROP_GET, buf, imp, dt, cnamel);
break; break;
default: default:
_gen_proto(cl, fid, EOLIAN_UNRESOLVED, buf, imp, dt, cnamel); _gen_proto(cl, fid, EOLIAN_METHOD, buf, imp, dt, cnamel);
} }
} }
eina_iterator_free(itr); eina_iterator_free(itr);