use shortcut visitor in whileexp condition evaluation 93/16493/4
Antoine ELIAS [Wed, 20 May 2015 08:30:15 +0000 (10:30 +0200)]
Change-Id: I384038dcc77ff55307199740ce6bf15af9fd6c2b

scilab/modules/ast/src/cpp/ast/runvisitor.cpp

index 13242f6..55b42ed 100644 (file)
@@ -315,9 +315,17 @@ void RunVisitorT<T>::visitprivate(const IfExp  &e)
 template <class T>
 void RunVisitorT<T>::visitprivate(const WhileExp  &e)
 {
+
+    //Create local exec visitor
+    ShortCutVisitor SCTest;
+
+    //manage & and | like && and ||
+    e.getTest().accept(SCTest);
     //condition
     e.getTest().accept(*this);
+
     InternalType* pIT = getResult();
+
     while (pIT->isTrue())
     {
         pIT->killMe();