summaryrefslogtreecommitdiff
path: root/src/lib/eolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-06-26 13:54:12 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-06-26 14:05:46 +0200
commit5b00dc344febd4004f268d8d76a05f7579d08288 (patch)
treedb6b2cb5cbf3f23c3af31eeb51abbbeb75d3c69c /src/lib/eolian
parent4ff8c5f7b25ee539c930e5aaa6352cc0304d3908 (diff)
eolian: allow value types in view containers (iterators etc.)
This restricts disallowing value types to containers that can own them. It also disallows usage of @owned on those view-only containers, as that makes no sense.
Diffstat (limited to 'src/lib/eolian')
-rw-r--r--src/lib/eolian/database_validate.c2
-rw-r--r--src/lib/eolian/eo_parser.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 8deea6d595..c7254ed220 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -273,7 +273,7 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
273 { 273 {
274 if (!_validate_type(vals, itp)) 274 if (!_validate_type(vals, itp))
275 return EINA_FALSE; 275 return EINA_FALSE;
276 if ((kwid >= KW_accessor) && (kwid <= KW_list) && (kwid != KW_future)) 276 if (kwid == KW_array || kwid == KW_hash || kwid == KW_list)
277 { 277 {
278 if (!database_type_is_ownable(src, itp, EINA_TRUE)) 278 if (!database_type_is_ownable(src, itp, EINA_TRUE))
279 { 279 {
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index f33db75f67..6b5d920409 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -768,8 +768,10 @@ parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ptr)
768 def->base_type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE)); 768 def->base_type = eo_lexer_type_release(ls, parse_type_void(ls, EINA_TRUE));
769 else 769 else
770 def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE)); 770 def->base_type = eo_lexer_type_release(ls, parse_type(ls, EINA_TRUE));
771 if ((def->base_type->owned = (ls->t.kw == KW_at_owned))) 771 /* view-only types are not allowed to own the contents */
772 eo_lexer_get(ls); 772 if (tpid == KW_array || tpid == KW_hash || tpid == KW_list || tpid == KW_future)
773 if ((def->base_type->owned = (ls->t.kw == KW_at_owned)))
774 eo_lexer_get(ls);
773 if (tpid == KW_hash) 775 if (tpid == KW_hash)
774 { 776 {
775 check_next(ls, ','); 777 check_next(ls, ',');