eolian: remove obsolete code dealing with multiple classes per file
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Fri, 22 May 2015 15:46:07 +0000 (16:46 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Fri, 22 May 2015 15:46:07 +0000 (16:46 +0100)
src/lib/eolian/database_fill.c
src/lib/eolian/eo_lexer.c
src/lib/eolian/eo_lexer.h
src/lib/eolian/eo_parser.c
src/lib/eolian/eolian_database.c

index 38ff1a3..9a24a11 100644 (file)
@@ -235,20 +235,15 @@ eo_parser_database_fill(const char *filename, Eina_Bool eot)
 
    if (eot) goto done;
 
-   if (!eina_list_count(ls->tmp.classes))
+   if (!(cl = ls->tmp.kls))
      {
-        fprintf(stderr, "eolian: no classes for file '%s'\n", filename);
+        fprintf(stderr, "eolian: no class for file '%s'\n", filename);
         goto error;
      }
+   ls->tmp.kls = NULL;
 
-   while (ls->tmp.classes)
-     {
-        cl = eina_list_data_get(ls->tmp.classes);
-        if (!_db_fill_class(cl))
-          goto error;
-        ls->tmp.classes = eina_list_remove_list(ls->tmp.classes,
-                                                ls->tmp.classes);
-     }
+   if (!_db_fill_class(cl))
+     goto error;
 
 done:
    if (eot)
index c84df4b..e838564 100644 (file)
@@ -677,7 +677,6 @@ _temps_free(Eo_Lexer_Temps *tmp)
 {
    Eina_Strbuf *buf;
    Eolian_Type *tp;
-   Eolian_Class *cl;
    const char *s;
 
    if (tmp->kls)
@@ -697,9 +696,6 @@ _temps_free(Eo_Lexer_Temps *tmp)
 
    EINA_LIST_FREE(tmp->strs, s)
      if (s) eina_stringshare_del(s);
-
-   EINA_LIST_FREE(tmp->classes, cl)
-     database_class_del(cl);
 }
 
 void
index 60c13a6..0ffda4a 100644 (file)
@@ -98,7 +98,6 @@ typedef struct _Eo_Lexer_Temps
 {
    Eolian_Class *kls;
    Eolian_Variable *var;
-   Eina_List *classes;
    Eina_List *str_bufs;
    Eina_List *type_defs;
    Eina_List *expr_defs;
index d8e37ce..5323cf4 100644 (file)
@@ -1942,8 +1942,6 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot)
    return EINA_FALSE;
 found_class:
    database_decl_add(ls->tmp.kls->full_name, EOLIAN_DECL_CLASS, ls->tmp.kls);
-   ls->tmp.classes = eina_list_append(ls->tmp.classes, ls->tmp.kls);
-   ls->tmp.kls = NULL;
    return EINA_TRUE;
 }
 
index d9eb110..7a03487 100644 (file)
@@ -228,20 +228,17 @@ eolian_eo_file_parse(const char *filepath)
    Eolian_Constructor *ctor;
    if (!class)
      {
-        const char *full_filepath = eina_hash_find(_filenames, bfilename);
-        if (!full_filepath) full_filepath = filepath;
-        if (!eo_parser_database_fill(full_filepath, EINA_FALSE))
+        if (!eo_parser_database_fill(filepath, EINA_FALSE))
           {
              free(bfiledup);
              goto error;
           }
         class = eolian_class_get_by_file(bfilename);
-        if (!class)
-          {
-             fprintf(stderr, "eolian: no class for file '%s'\n", bfilename);
-             free(bfiledup);
-             goto error;
-          }
+     }
+   else
+     {
+        free(bfiledup);
+        return EINA_TRUE;
      }
    free(bfiledup);
    itr = eolian_class_implements_get(class);