Skip to content

Commit

Permalink
- properly fold (don't loose stuff) when traversing SCode.ALG_IF in S…
Browse files Browse the repository at this point in the history
…Code.traverseStatements2

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19890 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Mar 31, 2014
1 parent 016bd45 commit 2cac3ca
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Compiler/FrontEnd/SCode.mo
Expand Up @@ -2776,12 +2776,11 @@ algorithm
String iter;
Option<Absyn.Exp> range;

case (ALG_IF(e, stmts1, branches, stmts2, comment, info), (traverser, arg))
case (ALG_IF(e, stmts1, branches, stmts2, comment, info), tup)
equation
(stmts1, tup) = traverseStatementsList(stmts1, (traverser, arg));
(branches, tup) = List.mapFold(branches,
traverseBranchStatements, tup);
(stmts2, tup) = traverseStatementsList(stmts2, (traverser, arg));
(stmts1, tup) = traverseStatementsList(stmts1, tup);
(branches, tup) = List.mapFold(branches, traverseBranchStatements, tup);
(stmts2, tup) = traverseStatementsList(stmts2, tup);
then
(ALG_IF(e, stmts1, branches, stmts2, comment, info), tup);

Expand All @@ -2797,16 +2796,15 @@ algorithm
then
(ALG_PARFOR(iter, range, stmts1, comment, info), tup);

case (ALG_WHILE(e, stmts1, comment, info), (traverser, arg))
case (ALG_WHILE(e, stmts1, comment, info), tup)
equation
(stmts1, tup) = traverseStatementsList(stmts1, (traverser, arg));
(stmts1, tup) = traverseStatementsList(stmts1, tup);
then
(ALG_WHILE(e, stmts1, comment, info), tup);

case (ALG_WHEN_A(branches, comment, info), tup)
equation
(branches, tup) = List.mapFold(branches,
traverseBranchStatements, tup);
(branches, tup) = List.mapFold(branches, traverseBranchStatements, tup);
then
(ALG_WHEN_A(branches, comment, info), tup);

Expand Down

0 comments on commit 2cac3ca

Please sign in to comment.