eolian: get rid of a list

This commit is contained in:
Daniel Kolesa 2014-09-12 15:01:10 +01:00
parent f8cef784a8
commit 87559458f2
3 changed files with 10 additions and 24 deletions

View File

@ -705,22 +705,21 @@ _temps_free(Eo_Lexer_Temps *tmp)
{
Eina_Strbuf *buf;
Eolian_Type *tp;
Eolian_Variable *var;
Eolian_Class *cl;
const char *s;
EINA_LIST_FREE(tmp->str_bufs, buf)
eina_strbuf_free(buf);
if (tmp->kls)
database_class_del(tmp->kls);
if (tmp->var)
database_var_del(tmp->var);
EINA_LIST_FREE(tmp->str_bufs, buf)
eina_strbuf_free(buf);
EINA_LIST_FREE(tmp->type_defs, tp)
database_type_del(tp);
EINA_LIST_FREE(tmp->var_defs, var)
database_var_del(var);
EINA_LIST_FREE(tmp->str_items, s)
if (s) eina_stringshare_del(s);

View File

@ -96,10 +96,10 @@ typedef struct _Lexer_Ctx
typedef struct _Eo_Lexer_Temps
{
Eolian_Class *kls;
Eolian_Variable *var;
Eina_List *classes;
Eina_List *str_bufs;
Eina_List *type_defs;
Eina_List *var_defs;
Eina_List *str_items;
Eina_List *expr_defs;
Eina_List *strs;

View File

@ -114,20 +114,6 @@ pop_type(Eo_Lexer *ls)
ls->tmp.type_defs = eina_list_remove_list(ls->tmp.type_defs, ls->tmp.type_defs);
}
static Eolian_Variable *
push_var(Eo_Lexer *ls)
{
Eolian_Variable *def = calloc(1, sizeof(Eolian_Variable));
ls->tmp.var_defs = eina_list_prepend(ls->tmp.var_defs, def);
return def;
}
static void
pop_var(Eo_Lexer *ls)
{
ls->tmp.var_defs = eina_list_remove_list(ls->tmp.var_defs, ls->tmp.var_defs);
}
static Eina_Stringshare *
push_str(Eo_Lexer *ls, const char *val)
{
@ -1053,9 +1039,10 @@ parse_typedef(Eo_Lexer *ls)
static Eolian_Variable *
parse_variable(Eo_Lexer *ls, Eina_Bool global)
{
Eolian_Variable *def = push_var(ls);
Eolian_Variable *def = calloc(1, sizeof(Eolian_Variable));
Eina_Bool has_extern = EINA_FALSE;
Eina_Strbuf *buf;
ls->tmp.var = def;
eo_lexer_get(ls);
if (ls->t.kw == KW_at_extern)
{
@ -1910,7 +1897,7 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot)
case KW_var:
{
database_var_add(parse_variable(ls, ls->t.kw == KW_var));
pop_var(ls);
ls->tmp.var = NULL;
break;
}
case KW_struct: