Improve performance for loop and insertion
[scilab.git] / scilab / modules / ast / includes / ast / deserializervisitor.hxx
index c348efe..d557606 100644 (file)
@@ -306,7 +306,7 @@ private :
                 if ( hasElse )
                 {
                     Exp* _else = get_exp();
-                    ifexp = new IfExp(loc, *test, *_then, *_else);
+                    ifexp = new IfExp(loc, *test, *_then->getAs<SeqExp>(), *_else->getAs<SeqExp>());
                 }
                 else
                 {
@@ -330,7 +330,7 @@ private :
             {
                 Exp* test = get_exp();
                 Exp* body = get_exp();
-                exp = new WhileExp(loc, *test, *body);
+                exp = new WhileExp(loc, *test, *body->getAs<SeqExp>());
                 break;
             }
             case 17:
@@ -338,7 +338,7 @@ private :
                 Location vardec_location = get_location();
                 VarDec* vardec = get_VarDec(vardec_location);
                 Exp* body = get_exp();
-                exp = new ForExp(loc, *vardec, *body);
+                exp = new ForExp(loc, *vardec, *body->getAs<SeqExp>());
                 break;
             }
             case 18:
@@ -456,7 +456,7 @@ private :
                 exps_t* returns_list = get_vars();
                 ArrayListVar *args = new ArrayListVar(args_loc, *args_list);
                 ArrayListVar *returns = new ArrayListVar(returns_loc, *returns_list);
-                exp = new FunctionDec(loc, *name, *args, *returns, *body);
+                exp = new FunctionDec(loc, *name, *args, *returns, *body->getAs<SeqExp>());
                 delete name;
                 break;
             }