summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-09-15 16:24:46 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-09-15 16:24:46 +0200
commit792855a1fac723e13efb11acd9287053e18a2ec9 (patch)
tree538f43c0f1bacfbae93f88eb9354372f1cfc2d5e /src/lib
parent4c4c641c4b62f72cd4d807279bc1831b6af8b4a2 (diff)
eolian: parsing of new @owned syntax for complex types
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/eolian/eo_parser.c7
-rw-r--r--src/lib/eolian/eolian_database.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index ee0289b..791fcce 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -517,8 +517,7 @@ parse_struct(Eo_Lexer *ls, const char *name, Eina_Bool is_extern,
517 fdef->type = tp; 517 fdef->type = tp;
518 fdef->name = eina_stringshare_ref(fname); 518 fdef->name = eina_stringshare_ref(fname);
519 pop_type(ls); 519 pop_type(ls);
520 fdef->owned = (ls->t.kw == KW_at_owned); 520 if ((fdef->owned = (ls->t.kw == KW_at_owned)))
521 if (fdef->owned)
522 eo_lexer_get(ls); 521 eo_lexer_get(ls);
523 check_next(ls, ';'); 522 check_next(ls, ';');
524 FILL_DOC(ls, fdef, doc); 523 FILL_DOC(ls, fdef, doc);
@@ -827,11 +826,15 @@ parse_type_void(Eo_Lexer *ls, Eina_Bool allow_ref, Eina_Bool allow_sarray)
827 else 826 else
828 def->base_type = parse_type(ls, EINA_FALSE, EINA_FALSE); 827 def->base_type = parse_type(ls, EINA_FALSE, EINA_FALSE);
829 pop_type(ls); 828 pop_type(ls);
829 if ((def->base_type->owned = (ls->t.kw == KW_at_owned)))
830 eo_lexer_get(ls);
830 if (tpid == KW_hash) 831 if (tpid == KW_hash)
831 { 832 {
832 check_next(ls, ','); 833 check_next(ls, ',');
833 def->base_type->next_type = parse_type(ls, EINA_FALSE, EINA_FALSE); 834 def->base_type->next_type = parse_type(ls, EINA_FALSE, EINA_FALSE);
834 pop_type(ls); 835 pop_type(ls);
836 if ((def->base_type->next_type->owned = (ls->t.kw == KW_at_owned)))
837 eo_lexer_get(ls);
835 } 838 }
836 else if((tpid == KW_future) && test_next(ls, ',')) 839 else if((tpid == KW_future) && test_next(ls, ','))
837 { 840 {
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index 16a2a97..313779c 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -169,6 +169,7 @@ struct _Eolian_Type
169 Eina_Bool is_const :1; 169 Eina_Bool is_const :1;
170 Eina_Bool is_own :1; 170 Eina_Bool is_own :1;
171 Eina_Bool is_ptr :1; 171 Eina_Bool is_ptr :1;
172 Eina_Bool owned :1;
172}; 173};
173 174
174struct _Eolian_Typedecl 175struct _Eolian_Typedecl