aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-22 18:01:31 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2018-03-22 18:01:31 +0100
commit3bddb2b6c4b3bfd8e812ed31a583c7593e44a4f3 (patch)
treebe6b388ab85216344a3a6969671d78caf612650b
parenteolian: complete staging area merge logic (diff)
downloadefl-3bddb2b6c4b3bfd8e812ed31a583c7593e44a4f3.tar.gz
eolian: commit all changes into staging area first
-rw-r--r--src/lib/eolian/database_type.c12
-rw-r--r--src/lib/eolian/database_var.c8
-rw-r--r--src/lib/eolian/eo_lexer.c2
-rw-r--r--src/lib/eolian/eo_parser.c4
-rw-r--r--src/lib/eolian/eolian_database.c4
5 files changed, 16 insertions, 14 deletions
diff --git a/src/lib/eolian/database_type.c b/src/lib/eolian/database_type.c
index ffdf5ebf3d..eec9621efe 100644
--- a/src/lib/eolian/database_type.c
+++ b/src/lib/eolian/database_type.c
@@ -36,8 +36,8 @@ void
database_type_add(Eolian_Unit *unit, Eolian_Typedecl *tp)
{
EOLIAN_OBJECT_ADD(unit, tp->base.name, tp, aliases);
- eina_hash_set(unit->state->main.aliases_f, tp->base.file, eina_list_append
- ((Eina_List*)eina_hash_find(unit->state->main.aliases_f, tp->base.file),
+ eina_hash_set(unit->state->staging.aliases_f, tp->base.file, eina_list_append
+ ((Eina_List*)eina_hash_find(unit->state->staging.aliases_f, tp->base.file),
tp));
database_object_add(unit, &tp->base);
}
@@ -46,8 +46,8 @@ void
database_struct_add(Eolian_Unit *unit, Eolian_Typedecl *tp)
{
EOLIAN_OBJECT_ADD(unit, tp->base.name, tp, structs);
- eina_hash_set(unit->state->main.structs_f, tp->base.file, eina_list_append
- ((Eina_List*)eina_hash_find(unit->state->main.structs_f, tp->base.file), tp));
+ eina_hash_set(unit->state->staging.structs_f, tp->base.file, eina_list_append
+ ((Eina_List*)eina_hash_find(unit->state->staging.structs_f, tp->base.file), tp));
database_object_add(unit, &tp->base);
}
@@ -55,8 +55,8 @@ void
database_enum_add(Eolian_Unit *unit, Eolian_Typedecl *tp)
{
EOLIAN_OBJECT_ADD(unit, tp->base.name, tp, enums);
- eina_hash_set(unit->state->main.enums_f, tp->base.file, eina_list_append
- ((Eina_List*)eina_hash_find(unit->state->main.enums_f, tp->base.file), tp));
+ eina_hash_set(unit->state->staging.enums_f, tp->base.file, eina_list_append
+ ((Eina_List*)eina_hash_find(unit->state->staging.enums_f, tp->base.file), tp));
database_object_add(unit, &tp->base);
}
diff --git a/src/lib/eolian/database_var.c b/src/lib/eolian/database_var.c
index c14859b246..a6eea20cdf 100644
--- a/src/lib/eolian/database_var.c
+++ b/src/lib/eolian/database_var.c
@@ -22,16 +22,16 @@ static void
database_var_global_add(Eolian_Unit *unit, Eolian_Variable *var)
{
EOLIAN_OBJECT_ADD(unit, var->base.name, var, globals);
- eina_hash_set(unit->state->main.globals_f, var->base.file, eina_list_append
- ((Eina_List*)eina_hash_find(unit->state->main.globals_f, var->base.file), var));
+ eina_hash_set(unit->state->staging.globals_f, var->base.file, eina_list_append
+ ((Eina_List*)eina_hash_find(unit->state->staging.globals_f, var->base.file), var));
}
static void
database_var_constant_add(Eolian_Unit *unit, Eolian_Variable *var)
{
EOLIAN_OBJECT_ADD(unit, var->base.name, var, constants);
- eina_hash_set(unit->state->main.constants_f, var->base.file, eina_list_append
- ((Eina_List*)eina_hash_find(unit->state->main.constants_f, var->base.file), var));
+ eina_hash_set(unit->state->staging.constants_f, var->base.file, eina_list_append
+ ((Eina_List*)eina_hash_find(unit->state->staging.constants_f, var->base.file), var));
}
void
diff --git a/src/lib/eolian/eo_lexer.c b/src/lib/eolian/eo_lexer.c
index d4e6815ff3..507d18aef5 100644
--- a/src/lib/eolian/eo_lexer.c
+++ b/src/lib/eolian/eo_lexer.c
@@ -1089,7 +1089,7 @@ eo_lexer_set_input(Eo_Lexer *ls, Eolian_State *state, const char *source)
}
ls->unit = ncunit;
database_unit_init(state, ncunit, ls->filename);
- eina_hash_add(state->main.units, ls->filename, ncunit);
+ eina_hash_add(state->staging.units, ls->filename, ncunit);
if (ls->current != 0xEF)
return;
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 0c92288c9d..626acaf62a 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -2207,6 +2207,8 @@ eo_parser_database_fill(Eolian_Unit *parent, const char *filename, Eina_Bool eot
fname = eina_stringshare_add(filename);
Eolian_Unit *ret = eina_hash_find(parent->state->main.units, fname);
+ if (!ret)
+ ret = eina_hash_find(parent->state->staging.units, fname);
if (ret)
{
@@ -2241,7 +2243,7 @@ eo_parser_database_fill(Eolian_Unit *parent, const char *filename, Eina_Bool eot
}
ls->klass = NULL;
EOLIAN_OBJECT_ADD(ls->unit, cl->base.name, cl, classes);
- eina_hash_set(ls->state->main.classes_f, cl->base.file, cl);
+ eina_hash_set(ls->state->staging.classes_f, cl->base.file, cl);
eo_lexer_node_release(ls, &cl->base);
done:
diff --git a/src/lib/eolian/eolian_database.c b/src/lib/eolian/eolian_database.c
index 19e6ef7f9a..5ae0cc83bd 100644
--- a/src/lib/eolian/eolian_database.c
+++ b/src/lib/eolian/eolian_database.c
@@ -14,8 +14,8 @@ database_object_add(Eolian_Unit *unit, const Eolian_Object *obj)
/* object storage */
eina_hash_add(unit->objects, obj->name, obj);
eina_hash_add(unit->state->staging.unit.objects, obj->name, obj);
- eina_hash_set(unit->state->main.objects_f, obj->file, eina_list_append
- ((Eina_List *)eina_hash_find(unit->state->main.objects_f, obj->file), obj));
+ eina_hash_set(unit->state->staging.objects_f, obj->file, eina_list_append
+ ((Eina_List *)eina_hash_find(unit->state->staging.objects_f, obj->file), obj));
}
EAPI Eolian_Object_Type