commit e58e000f02f4ed8c9655eb587cc6f817b84af1f1
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Thu Sep 10 22:33:37 2015 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Thu Sep 10 22:33:37 2015 +0200

    Integrate initlist in initiliazer()

diff --git a/cc1/expr.c b/cc1/expr.c
index ea7916e..3b92485 100644
--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -980,31 +980,18 @@ condexpr(void)
 
 /* TODO: check correctness of the initializator  */
 /* TODO: emit initializer */
-static void
-initlist(void)
-{
-       Node *np;
-
-       if (yytoken == '}')
-               return;
-
-       do {
-               if (accept('{'))
-                       initlist();
-               assign();
-       } while (accept(','));
-
-       expect('}');
-}
-
 void
 initializer(Symbol *sym)
 {
        Node *np;
+       Type *tp = sym->type;
        int flags = sym->flags;
 
        if (accept('{')) {
-               initlist();
+               do {
+                       initializer(sym);
+               } while (accept(','));
+               expect('}');    
                return;
        }
        np = assignop(OINIT, varnode(sym), assign());

Reply via email to