compiler/libec: Added missing classExp Copy rule
authorJerome St-Louis <jerome@ecere.com>
Tue, 6 May 2014 11:08:24 +0000 (07:08 -0400)
committerJerome St-Louis <jerome@ecere.com>
Tue, 6 May 2014 11:08:24 +0000 (07:08 -0400)
- This was breaking: Iterator<int> i { [ 1, 2, 3 ] };

compiler/bootstrap/libec/bootstrap/copy.c
compiler/libec/src/copy.ec

index 79bbcfe..7afeaa5 100644 (file)
@@ -1048,6 +1048,10 @@ static struct Statement * CopyStatement(struct Statement * stmt);
 
 extern struct Expression * MkExpExtensionInitializer(struct TypeName * typeName, struct Initializer * initializer);
 
+extern struct Expression * MkExpClass(struct __ecereNameSpace__ecere__sys__OldList *  specifiers, struct Declarator * decl);
+
+struct Declarator * CopyDeclarator(struct Declarator * declarator);
+
 struct Expression * CopyExpression(struct Expression * exp)
 {
 struct Expression * result = (((void *)0));
@@ -1142,6 +1146,9 @@ break;
 case 33:
 result = MkExpExtensionInitializer(CopyTypeName(exp->initializer.typeName), CopyInitializer(exp->initializer.initializer));
 break;
+case 24:
+result = MkExpClass(CopyList(exp->_classExp.specifiers, CopySpecifier), CopyDeclarator(exp->_classExp.decl));
+break;
 }
 if(result)
 {
@@ -1343,8 +1350,6 @@ return (((void *)0));
 
 extern struct TypeName * MkTypeName(struct __ecereNameSpace__ecere__sys__OldList * qualifiers, struct Declarator * declarator);
 
-struct Declarator * CopyDeclarator(struct Declarator * declarator);
-
 struct TypeName * CopyTypeName(struct TypeName * typeName)
 {
 struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
index 122eac3..e9dc1fa 100644 (file)
@@ -195,6 +195,9 @@ static Instantiation CopyInstantiation(Instantiation inst)
          case extensionInitializerExp:
             result = MkExpExtensionInitializer(CopyTypeName(exp.initializer.typeName), CopyInitializer(exp.initializer.initializer));
             break;
+         case classExp:
+            result = MkExpClass(CopyList(exp._classExp.specifiers, CopySpecifier), CopyDeclarator(exp._classExp.decl));
+            break;
       }
    if(result)
    {