]> git.tdb.fi Git - libs/gl.git/commitdiff
Visit generated assignments in InterfaceGenerator
authorMikko Rasa <tdb@tdb.fi>
Sat, 14 Apr 2018 07:50:09 +0000 (10:50 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 14 Apr 2018 07:51:59 +0000 (10:51 +0300)
source/programcompiler.cpp

index e03e64cd288708c8e476a56a9e921a3f5cbd3b59..9761177a8086be6ac0e16f69fa29974398548e57 100644 (file)
@@ -860,6 +860,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 +892,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")