q66 pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6caf41e28843d87b33b73b970d39eae595d17856

commit 6caf41e28843d87b33b73b970d39eae595d17856
Author: Daniel Kolesa <[email protected]>
Date:   Mon Jul 21 11:47:35 2014 +0100

    eolian: only check redef on actual named structs
---
 src/lib/eolian/eo_parser.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index a5ba28d..81735ad 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -315,6 +315,7 @@ parse_type_struct(Eo_Lexer *ls, Eina_Bool allow_struct, 
Eina_Bool allow_anon)
         if (allow_struct)
           {
              Eina_Bool is_extern = EINA_FALSE;
+             int line, col;
              if (ls->t.kw == KW_at_extern)
                {
                   is_extern = EINA_TRUE;
@@ -330,12 +331,18 @@ parse_type_struct(Eo_Lexer *ls, Eina_Bool allow_struct, 
Eina_Bool allow_anon)
              if (eo_lexer_get_c_type(ls->t.kw))
                eo_lexer_syntax_error(ls, "invalid struct name");
              /* todo: see typedef */
-             if (eina_hash_find(_structs, ls->t.value))
-               eo_lexer_syntax_error(ls, "struct redefinition");
+             line = ls->line_number;
+             col = ls->column;
              sname = eina_stringshare_ref(ls->t.value);
              eo_lexer_get(ls);
              if (ls->t.token == '{')
-               return parse_struct(ls, sname, is_extern);
+               {
+                  ls->line_number = line;
+                  ls->column = col;
+                  if (eina_hash_find(_structs, ls->t.value))
+                    eo_lexer_syntax_error(ls, "struct redefinition");
+                  return parse_struct(ls, sname, is_extern);
+               }
           }
         else
           {

-- 


Reply via email to