summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-09-19 17:26:48 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-09-19 18:20:56 +0200
commitbc793753cb5c7764b5766720c16177fcd1656517 (patch)
treed0706eb2301194579ced3b67635f1a3166b41523 /src
parent46a6949b2e29bddacd523d96564492957faecc34 (diff)
eolian: allow composites keyword in place of composite
Fixes T8218.
Diffstat (limited to 'src')
-rw-r--r--src/lib/eolian/eo_lexer.h2
-rw-r--r--src/lib/eolian/eo_parser.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h
index 876f1c7..0746e79 100644
--- a/src/lib/eolian/eo_lexer.h
+++ b/src/lib/eolian/eo_lexer.h
@@ -27,7 +27,7 @@ enum Tokens
27 */ 27 */
28#define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \ 28#define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \
29 \ 29 \
30 KW(abstract), KW(c_prefix), KW(composite), KW(constructor), KW(constructors), \ 30 KW(abstract), KW(c_prefix), KW(composite), KW(composites), KW(constructor), KW(constructors), \
31 KW(data), KW(destructor), KW(error), KW(event_prefix), KW(events), KW(extends), \ 31 KW(data), KW(destructor), KW(error), KW(event_prefix), KW(events), KW(extends), \
32 KW(free), KW(get), KW(implements), KW(import), KW(interface), \ 32 KW(free), KW(get), KW(implements), KW(import), KW(interface), \
33 KW(keys), KW(legacy), KW(methods), KW(mixin), KW(params), \ 33 KW(keys), KW(legacy), KW(methods), KW(mixin), KW(params), \
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 1f5a678..c403305 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -2210,8 +2210,8 @@ _composite_add(Eo_Lexer *ls, Eina_Strbuf *buf)
2210 eo_lexer_syntax_error(ls, ebuf); 2210 eo_lexer_syntax_error(ls, ebuf);
2211 return; 2211 return;
2212 } 2212 }
2213 /* do not introduce a dependency */ 2213 /* composite == definitely a dependency */
2214 database_defer(ls->state, fnm, EINA_FALSE); 2214 database_defer(ls->state, fnm, EINA_TRUE);
2215 free(fnm); 2215 free(fnm);
2216 ls->klass->composite = eina_list_append(ls->klass->composite, nm); 2216 ls->klass->composite = eina_list_append(ls->klass->composite, nm);
2217 eo_lexer_context_pop(ls); 2217 eo_lexer_context_pop(ls);
@@ -2306,7 +2306,7 @@ tags_done:
2306 /* regular class can have a parent, but just one */ 2306 /* regular class can have a parent, but just one */
2307 _inherit_dep(ls, ibuf, EINA_TRUE); 2307 _inherit_dep(ls, ibuf, EINA_TRUE);
2308 /* if not followed by implements, we're done */ 2308 /* if not followed by implements, we're done */
2309 if (ls->t.kw != KW_implements) 2309 if ((ls->t.kw != KW_implements) && (ls->t.kw != KW_composites))
2310 { 2310 {
2311 eo_lexer_dtor_pop(ls); 2311 eo_lexer_dtor_pop(ls);
2312 goto inherit_done; 2312 goto inherit_done;
@@ -2318,10 +2318,10 @@ tags_done:
2318 while (test_next(ls, ',')); 2318 while (test_next(ls, ','));
2319 } 2319 }
2320 2320
2321 if (ls->t.kw == KW_composite) 2321 if (ls->t.kw == KW_composite || ls->t.kw == KW_composites)
2322 { 2322 {
2323 if (type == EOLIAN_CLASS_INTERFACE) 2323 if (type == EOLIAN_CLASS_INTERFACE)
2324 eo_lexer_syntax_error(ls, "composite not allowed in interfaces"); 2324 eo_lexer_syntax_error(ls, "interfaces cannot composite");
2325 eo_lexer_get(ls); 2325 eo_lexer_get(ls);
2326 do 2326 do
2327 _composite_add(ls, ibuf); 2327 _composite_add(ls, ibuf);