PrettyPrint and listener clear 90/19390/2
Cedric Delamarre [Fri, 18 Aug 2017 10:07:59 +0000 (12:07 +0200)]
Change-Id: Ic9ae4f3efabfe284b329dfa00ce1a57e7319fed2

scilab/modules/ast/includes/analysis/AnalysisVisitor.hxx
scilab/modules/core/src/cpp/tasks.cpp

index 326c602..e8e8754 100644 (file)
@@ -196,6 +196,11 @@ public:
         }
     }
 
+    inline void resetFBlockEmittedListener()
+    {
+        fblockListeners.clear();
+    }
+
     inline void emitFunctionBlock(FunctionBlock & fblock)
     {
         for (auto listener : fblockListeners)
index a673b2b..9daf6a3 100644 (file)
@@ -188,9 +188,12 @@ void execAstTask(ast::Exp* tree, bool serialize, bool timed, bool ASTtimed, bool
         {
             FBlockListener listener;
             analysis::AnalysisVisitor& analysis = analysis::AnalysisVisitor::getInstance();
-            analysis.reset();
+            analysis.resetFBlockEmittedListener();
             analysis.registerFBlockEmittedListener(&listener);
             newTree->accept(analysis);
+
+            ast::PrettyPrintVisitor dv(std::wcerr, true, true);
+            newTree->accept(dv);
         }
 
         exec = (ast::RunVisitor*)ConfigVariable::getDefaultVisitor();