diff options
author | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2015-05-22 16:34:48 +0100 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2015-05-22 16:34:48 +0100 |
commit | 9bbc224f966a40f221ae87a4ff0c134be289d3ba (patch) | |
tree | fdb1f880eeb4cb61f43ad6ee6ea464071f7f07c3 | |
parent | 9214fa3db97362b65960c85cad92d85e56bc30ca (diff) |
eolian: initial support for importing eo files
-rw-r--r-- | src/lib/eolian/eo_parser.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index d7c0fde709..d8e37ce8b6 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c | |||
@@ -1827,6 +1827,7 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot) | |||
1827 | goto found_class; | 1827 | goto found_class; |
1828 | case KW_import: | 1828 | case KW_import: |
1829 | { | 1829 | { |
1830 | Eina_Bool is_eo = EINA_FALSE; | ||
1830 | Eina_Strbuf *buf = push_strbuf(ls); | 1831 | Eina_Strbuf *buf = push_strbuf(ls); |
1831 | const char *found = NULL; | 1832 | const char *found = NULL; |
1832 | char errbuf[PATH_MAX]; | 1833 | char errbuf[PATH_MAX]; |
@@ -1836,10 +1837,16 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot) | |||
1836 | eina_strbuf_append(buf, ".eot"); | 1837 | eina_strbuf_append(buf, ".eot"); |
1837 | if (!(found = eina_hash_find(_tfilenames, eina_strbuf_string_get(buf)))) | 1838 | if (!(found = eina_hash_find(_tfilenames, eina_strbuf_string_get(buf)))) |
1838 | { | 1839 | { |
1839 | pop_strbuf(ls); | 1840 | size_t buflen = eina_strbuf_length_get(buf); |
1840 | snprintf(errbuf, sizeof(errbuf), | 1841 | eina_strbuf_remove(buf, buflen - 1, buflen); |
1841 | "unknown import '%s'", ls->t.value.s); | 1842 | if (!(found = eina_hash_find(_filenames, eina_strbuf_string_get(buf)))) |
1842 | eo_lexer_syntax_error(ls, errbuf); | 1843 | { |
1844 | pop_strbuf(ls); | ||
1845 | snprintf(errbuf, sizeof(errbuf), | ||
1846 | "unknown import '%s'", ls->t.value.s); | ||
1847 | eo_lexer_syntax_error(ls, errbuf); | ||
1848 | } | ||
1849 | else is_eo = EINA_TRUE; | ||
1843 | } | 1850 | } |
1844 | if (eina_hash_find(_parsingeos, found)) | 1851 | if (eina_hash_find(_parsingeos, found)) |
1845 | { | 1852 | { |
@@ -1849,7 +1856,7 @@ parse_unit(Eo_Lexer *ls, Eina_Bool eot) | |||
1849 | eo_lexer_syntax_error(ls, errbuf); | 1856 | eo_lexer_syntax_error(ls, errbuf); |
1850 | } | 1857 | } |
1851 | pop_strbuf(ls); | 1858 | pop_strbuf(ls); |
1852 | if (!eo_parser_database_fill(found, EINA_TRUE)) | 1859 | if (!(is_eo ? eolian_eo_file_parse(found) : eolian_eot_file_parse(found))) |
1853 | { | 1860 | { |
1854 | pop_strbuf(ls); | 1861 | pop_strbuf(ls); |
1855 | snprintf(errbuf, sizeof(errbuf), | 1862 | snprintf(errbuf, sizeof(errbuf), |