]> git.tdb.fi Git - libs/gl.git/blobdiff - source/programcompiler.cpp
Make Animation::Iterator assignable
[libs/gl.git] / source / programcompiler.cpp
index e03e64cd288708c8e476a56a9e921a3f5cbd3b59..cafedc8f03180d9be4285d7e189d7a9a1e4de975 100644 (file)
@@ -35,6 +35,8 @@ namespace GL {
 
 using namespace ProgramSyntax;
 
+// XXX For some reason global declarations are emitted for otherwise undeclared local variables
+
 ProgramCompiler::ProgramCompiler():
        resources(0),
        module(0)
@@ -860,6 +862,7 @@ void ProgramCompiler::InterfaceGenerator::insert_assignment(const string &left,
 
        ExpressionStatement *stmt = new ExpressionStatement;
        stmt->expression = assign;
+       stmt->visit(*this);
        insert_nodes.push_back(stmt);
 }
 
@@ -891,7 +894,10 @@ void ProgramCompiler::InterfaceGenerator::visit(VariableDeclaration &var)
                {
                        remove_node = true;
                        if(var.init_expression)
+                       {
                                insert_assignment(var.name, var.init_expression->clone());
+                               return;
+                       }
                }
        }
        else if(var.interface=="in")