forked from enlightenment/efl
eolian: cleaner cyclic import checks
This commit is contained in:
parent
b647448f84
commit
30515bc946
|
@ -218,6 +218,8 @@ eo_parser_database_fill(const char *filename, Eina_Bool eot)
|
|||
if (eot && eina_hash_find(_parsedeots, filename))
|
||||
return EINA_TRUE;
|
||||
|
||||
if (eot) eina_hash_set(_parsingeots, filename, (void *)EINA_TRUE);
|
||||
|
||||
ls = eo_lexer_new(filename);
|
||||
if (!ls)
|
||||
{
|
||||
|
@ -254,12 +256,16 @@ eo_parser_database_fill(const char *filename, Eina_Bool eot)
|
|||
|
||||
done:
|
||||
if (eot)
|
||||
eina_hash_set(_parsedeots, filename, (void *)EINA_TRUE);
|
||||
{
|
||||
eina_hash_set(_parsedeots, filename, (void *)EINA_TRUE);
|
||||
eina_hash_set(_parsingeots, filename, (void *)EINA_FALSE);
|
||||
}
|
||||
|
||||
eo_lexer_free(ls);
|
||||
return EINA_TRUE;
|
||||
|
||||
error:
|
||||
if (eot) eina_hash_set(_parsingeots, filename, (void *)EINA_FALSE);
|
||||
eo_lexer_free(ls);
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
|
|
@ -1798,13 +1798,6 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot)
|
|||
check(ls, TOK_VALUE);
|
||||
eina_strbuf_append(buf, ls->t.value.s);
|
||||
eina_strbuf_append(buf, ".eot");
|
||||
if (eina_hash_find(_parsingeots, ls->t.value.s))
|
||||
{
|
||||
pop_strbuf(ls);
|
||||
snprintf(errbuf, sizeof(errbuf),
|
||||
"cyclic import '%s'", ls->t.value.s);
|
||||
eo_lexer_syntax_error(ls, errbuf);
|
||||
}
|
||||
if (!(found = eina_hash_find(_tfilenames, eina_strbuf_string_get(buf))))
|
||||
{
|
||||
pop_strbuf(ls);
|
||||
|
@ -1812,8 +1805,14 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot)
|
|||
"unknown import '%s'", ls->t.value.s);
|
||||
eo_lexer_syntax_error(ls, errbuf);
|
||||
}
|
||||
if (eina_hash_find(_parsingeots, found))
|
||||
{
|
||||
pop_strbuf(ls);
|
||||
snprintf(errbuf, sizeof(errbuf),
|
||||
"cyclic import '%s'", ls->t.value.s);
|
||||
eo_lexer_syntax_error(ls, errbuf);
|
||||
}
|
||||
pop_strbuf(ls);
|
||||
eina_hash_set(_parsingeots, ls->t.value.s, (void *)EINA_TRUE);
|
||||
if (!eo_parser_database_fill(found, EINA_TRUE))
|
||||
{
|
||||
pop_strbuf(ls);
|
||||
|
@ -1821,7 +1820,6 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot)
|
|||
"error while parsing import '%s'", ls->t.value.s);
|
||||
eo_lexer_syntax_error(ls, errbuf);
|
||||
}
|
||||
eina_hash_set(_parsingeots, ls->t.value.s, (void *)EINA_FALSE);
|
||||
pop_strbuf(ls);
|
||||
eo_lexer_get(ls);
|
||||
check_next(ls, ';');
|
||||
|
|
Loading…
Reference in New Issue