summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-27 11:00:08 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-05-27 11:00:31 +0100
commit0e2dee5b2efcb192d6ff34d5bcf8f470f4cfe691 (patch)
tree61f8afcc3346b32a461a10bf37796d5ca9ea8a64
parentc5f0eea83d3259dd225ed09a805877853a4275e5 (diff)
eolian: make sure CLASS/COMPLEX type is always pointer backed
-rw-r--r--src/lib/eolian/eo_parser.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 5ab85e2144..48a102fd92 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -686,7 +686,7 @@ _parse_dep(Eo_Lexer *ls, const char *fname, const char *name)
686} 686}
687 687
688static Eolian_Type * 688static Eolian_Type *
689parse_type_void(Eo_Lexer *ls) 689parse_type_void_base(Eo_Lexer *ls, Eina_Bool noptr)
690{ 690{
691 Eolian_Type *def; 691 Eolian_Type *def;
692 const char *ctype; 692 const char *ctype;
@@ -701,7 +701,7 @@ parse_type_void(Eo_Lexer *ls)
701 pline = ls->line_number; 701 pline = ls->line_number;
702 pcol = ls->column; 702 pcol = ls->column;
703 check_next(ls, '('); 703 check_next(ls, '(');
704 def = parse_type_void(ls); 704 def = parse_type_void_base(ls, EINA_TRUE);
705 FILL_BASE(def->base, ls, line, col); 705 FILL_BASE(def->base, ls, line, col);
706 def->is_const = EINA_TRUE; 706 def->is_const = EINA_TRUE;
707 check_match(ls, ')', '(', pline, pcol); 707 check_match(ls, ')', '(', pline, pcol);
@@ -715,7 +715,7 @@ parse_type_void(Eo_Lexer *ls)
715 pcolumn = ls->column; 715 pcolumn = ls->column;
716 check_next(ls, '('); 716 check_next(ls, '(');
717 eo_lexer_context_push(ls); 717 eo_lexer_context_push(ls);
718 def = parse_type_void(ls); 718 def = parse_type_void_base(ls, EINA_TRUE);
719 if (def->type != EOLIAN_TYPE_POINTER) 719 if (def->type != EOLIAN_TYPE_POINTER)
720 { 720 {
721 eo_lexer_context_restore(ls); 721 eo_lexer_context_restore(ls);
@@ -735,7 +735,7 @@ parse_type_void(Eo_Lexer *ls)
735 pcolumn = ls->column; 735 pcolumn = ls->column;
736 check_next(ls, '('); 736 check_next(ls, '(');
737 eo_lexer_context_push(ls); 737 eo_lexer_context_push(ls);
738 def = parse_type_void(ls); 738 def = parse_type_void_base(ls, EINA_TRUE);
739 if (def->type != EOLIAN_TYPE_POINTER) 739 if (def->type != EOLIAN_TYPE_POINTER)
740 { 740 {
741 eo_lexer_context_restore(ls); 741 eo_lexer_context_restore(ls);
@@ -823,6 +823,9 @@ parse_type_void(Eo_Lexer *ls)
823 } 823 }
824 } 824 }
825parse_ptr: 825parse_ptr:
826 /* check: complex/class type must always be behind a pointer */
827 if (!noptr && ((def->type == EOLIAN_TYPE_CLASS) || (def->type == EOLIAN_TYPE_COMPLEX)))
828 check(ls, '*');
826 while (ls->t.token == '*') 829 while (ls->t.token == '*')
827 { 830 {
828 Eolian_Type *pdef; 831 Eolian_Type *pdef;
@@ -838,6 +841,12 @@ parse_ptr:
838} 841}
839 842
840static Eolian_Type * 843static Eolian_Type *
844parse_type_void(Eo_Lexer *ls)
845{
846 return parse_type_void_base(ls, EINA_FALSE);
847}
848
849static Eolian_Type *
841parse_typedef(Eo_Lexer *ls) 850parse_typedef(Eo_Lexer *ls)
842{ 851{
843 Eolian_Declaration *decl; 852 Eolian_Declaration *decl;