eolian: re-enable non-dependencied parsing

The issue was that standalone-parsed files (outside of dependencies
of some other unit) were not being included in that dependency tree
(obviously) which resulted in their own dependency tree being
excluded from merging, causing the database hashes to lack the
necessary elements.

To fix this, I trigger merging of the "standalone" dependency trees
separately, by calling _merge_units from defer parsing cb.
This commit is contained in:
Daniel Kolesa 2018-04-19 13:40:41 +02:00
parent 974fa323a1
commit a2ccdb7b21
1 changed files with 12 additions and 4 deletions

View File

@ -876,6 +876,7 @@ database_defer(Eolian_State *state, const char *fname, Eina_Bool isdep)
}
static Eina_Bool _parse_deferred(Eolian_Unit *parent);
static void _merge_units(Eolian_Unit *unit);
typedef struct _Defer_Data
{
@ -885,15 +886,22 @@ typedef struct _Defer_Data
static Eina_Bool
_defer_hash_cb(const Eina_Hash *hash EINA_UNUSED, const void *key,
void *data EINA_UNUSED, void *fdata)
void *data, void *fdata)
{
Defer_Data *d = fdata;
Eina_Bool alone = ((size_t)data <= 1);
Eolian_Unit *parent = d->parent;
/* not a dependency; parse standalone */
/*if ((size_t)data <= 1)
parent = &parent->state->staging.unit;*/
if (alone)
parent = &parent->state->staging.unit;
Eolian_Unit *pdep = _eolian_file_parse_nodep(parent, key);
return (d->succ = (pdep && _parse_deferred(pdep)));
d->succ = (pdep && _parse_deferred(pdep));
/* standalone-parsed stuff forms its own dependency trees,
* so we have to merge the units manually and separately
*/
if (d->succ && alone)
_merge_units(pdep);
return d->succ;
}
static Eina_Bool