}
else
{
- const char *nm, *fpath;
- char *fname;
+ const char *bnm, *nm;
+ char *fnm;
buf = push_strbuf(ls);
parse_name(ls, buf);
nm = eina_strbuf_string_get(buf);
- fname = database_class_to_filename(nm);
- fpath = eina_hash_find(_filenames, fname);
- free(fname);
- if (fpath)
+ bnm = get_filename(ls);
+ fnm = database_class_to_filename(nm);
+ if (strncmp(bnm, fnm, strlen(bnm) - 3))
{
- def->type = EOLIAN_TYPE_CLASS;
- if (strcmp(ls->source, fpath))
+ const char *fname = eina_hash_find(_filenames, fnm);
+ eina_stringshare_del(bnm);
+ free(fnm);
+ if (fname)
{
- if (!eolian_class_get_by_name(nm) && !eolian_eo_file_parse(fpath))
+ if (!eolian_class_get_by_name(nm) && !eolian_eo_file_parse(fname))
eo_lexer_syntax_error(ls, "failed to parse dependency");
+ def->type = EOLIAN_TYPE_CLASS;
}
}
+ else
+ {
+ eina_stringshare_del(bnm);
+ free(fnm);
+ def->type = EOLIAN_TYPE_CLASS;
+ }
_fill_type_name(def, eina_stringshare_add(nm));
pop_strbuf(ls);
}
parse_name(ls, buf);
bnm = get_filename(ls);
fnm = database_class_to_filename(eina_strbuf_string_get(buf));
- same = !!strcmp(bnm, fnm);
+ same = !strncmp(bnm, fnm, strlen(bnm) - 3);
eina_stringshare_del(bnm);
free(fnm);
if (!same)
eolian_init();
/* Parsing */
- fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/namespace.eo"));
+ fail_if(!eolian_directory_scan(PACKAGE_DATA_DIR"/data"));
+ fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/nmsp1_class1.eo"));
/* Classes existence */
fail_if(!(class11 = eolian_class_get_by_name("nmsp1.class1")));
fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/override.eo"));
/* Class */
- fail_if(!(class = eolian_class_get_by_name("Simple")));
+ fail_if(!(class = eolian_class_get_by_name("Override")));
fail_if(!(base = eolian_class_get_by_name("Base")));
/* Base ctor */
eolian_init();
/* Parsing */
fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/consts.eo"));
- fail_if(!(class = eolian_class_get_by_name("Const")));
+ fail_if(!(class = eolian_class_get_by_name("Consts")));
/* Property */
fail_if(!(fid = eolian_class_function_get_by_name(class, "a", EOLIAN_PROPERTY)));
fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/typedef.eo"));
/* Check that the class Dummy is still readable */
- fail_if(!(class = eolian_class_get_by_name("Dummy")));
+ fail_if(!(class = eolian_class_get_by_name("Typedef")));
fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
/* Basic type */
eolian_init();
/* Parsing */
fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/scope.eo"));
- fail_if(!(class = eolian_class_get_by_name("Simple")));
+ fail_if(!(class = eolian_class_get_by_name("Scope")));
/* Property scope */
fail_if(!(fid = eolian_class_function_get_by_name(class, "a", EOLIAN_PROPERTY)));
eolian_init();
/* Parsing */
fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/class_simple.eo"));
- fail_if(!(class = eolian_class_get_by_name("Simple")));
+ fail_if(!(class = eolian_class_get_by_name("Class_Simple")));
fail_if(eolian_class_get_by_file("class_simple.eo") != class);
fail_if(strcmp(eolian_class_file_get(class), "class_simple.eo"));
fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/struct.eo"));
/* Check that the class Dummy is still readable */
- fail_if(!(class = eolian_class_get_by_name("Dummy")));
+ fail_if(!(class = eolian_class_get_by_name("Struct")));
fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
/* named struct */
fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/extern.eo"));
/* Check that the class Dummy is still readable */
- fail_if(!(class = eolian_class_get_by_name("Dummy")));
+ fail_if(!(class = eolian_class_get_by_name("Extern")));
fail_if(!eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD));
/* regular type */
eolian_init();
/* Parsing */
fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/class_funcs.eo"));
- fail_if(!(class = eolian_class_get_by_name("Simple")));
+ fail_if(!(class = eolian_class_get_by_name("Class_Funcs")));
/* Class properties */
fail_if(!(fid = eolian_class_function_get_by_name(class, "a", EOLIAN_PROPERTY)));