Skip to content

Commit ed4191b

Browse files
committed
- get rid of local case/else declarations.
- minor formatting changes. git-svn-id: https://openmodelica.org/svn/OpenModelica/branches/sjoelund-functiontree@6786 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent e5c5ca7 commit ed4191b

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

Compiler/Convert.mo

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,20 @@
3030
*/
3131

3232
package Convert
33-
" file: Convert.mo
34-
package: Convert
33+
" file: Convert.mo
34+
package: Convert
3535
description: This file is part of a work-around implemented for the
36-
valueblock construct in order to avoid ciruclar file dependencies.
37-
It converts uniontypes located in Exp to similiar uniontypes located in DAE
38-
and vise versa.
36+
valueblock construct in order to avoid ciruclar file dependencies.
37+
It converts uniontypes located in Exp to similiar uniontypes located
38+
in DAE and vice-versa.
3939

4040
RCS: $Id$"
4141

42+
// public imports
4243
public import Absyn;
4344
public import DAE;
4445

46+
// protected imports
4547
protected import ComponentReference;
4648
protected import Expression;
4749

@@ -74,22 +76,23 @@ algorithm
7476
list<Absyn.AlgorithmItem> localAccList1;
7577
list<DAE.Element> restLd,localAccList2;
7678
DAE.FunctionTree funcs;
79+
Absyn.AlgorithmItem stmt;
80+
DAE.Exp exp1,exp2;
81+
Absyn.Exp left,right;
82+
DAE.Element firstLd;
83+
7784
case ({},localAccList1,localAccList2) then (listReverse(localAccList1),listReverse(localAccList2));
85+
7886
case (DAE.EQUATION(exp1,exp2,_) :: restLd,localAccList1,localAccList2)
79-
local
80-
Absyn.AlgorithmItem stmt;
81-
DAE.Exp exp1,exp2;
82-
Absyn.Exp left,right;
8387
equation
8488
left = fromExpExpToAbsynExp(exp1);
8589
right = fromExpExpToAbsynExp(exp2);
8690
stmt = Absyn.ALGORITHMITEM(Absyn.ALG_ASSIGN(left,right),NONE(),Absyn.dummyInfo /* TODO: Use the elementsource from the DAE.EQUATION? */);
8791
localAccList1 = stmt::localAccList1;
8892
(localAccList1,localAccList2) = fromDAEEqsToAbsynAlgElts(restLd,localAccList1,localAccList2);
8993
then (localAccList1,localAccList2);
94+
9095
case (firstLd :: restLd,localAccList1,localAccList2)
91-
local
92-
DAE.Element firstLd;
9396
equation
9497
localAccList2 = firstLd::localAccList2;
9598
(localAccList1,localAccList2) = fromDAEEqsToAbsynAlgElts(restLd,localAccList1,localAccList2);
@@ -113,8 +116,3 @@ algorithm
113116
end fromExpCrefToAbsynCref;
114117

115118
end Convert;
116-
117-
118-
119-
120-

0 commit comments

Comments
 (0)