Skip to content

Commit

Permalink
Fix for bug #1516:
Browse files Browse the repository at this point in the history
- Fixed bad indentation in Dump.
- Updated test suite.


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9003 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed May 13, 2011
1 parent a3ddf9c commit e1dccc4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
28 changes: 13 additions & 15 deletions Compiler/FrontEnd/Dump.mo
Expand Up @@ -1200,7 +1200,7 @@ algorithm
s1 = unparseElementitemStrLst(i, el);
i_1 = i - 1;
is = indentStr(i_1);
str = stringAppendList({is,"public \n",s1});
str = stringAppendList({is,"public\n",s1});
then
str;

Expand All @@ -1209,7 +1209,7 @@ algorithm
s1 = unparseElementitemStrLst(i, el);
i_1 = i - 1;
is = indentStr(i_1);
str = stringAppendList({is,"protected \n",s1});
str = stringAppendList({is,"protected\n",s1});
then
str;

Expand All @@ -1218,7 +1218,7 @@ algorithm
s1 = unparseEquationitemStrLst(i, eqs, ";\n");
i_1 = i - 1;
is = indentStr(i_1);
str = stringAppendList({"\n",is,"constraint \n",s1});
str = stringAppendList({is,"constraint\n",s1});
then
str;

Expand All @@ -1227,7 +1227,7 @@ algorithm
s1 = unparseEquationitemStrLst(i, eqs, ";\n");
i_1 = i - 1;
is = indentStr(i_1);
str = stringAppendList({"\n",is,"equation \n",s1});
str = stringAppendList({is,"equation\n",s1});
then
str;

Expand All @@ -1236,7 +1236,7 @@ algorithm
s1 = unparseEquationitemStrLst(i, eqs, ";\n");
i_1 = i - 1;
is = indentStr(i_1);
str = stringAppendList({"\n",is,"initial equation \n",s1});
str = stringAppendList({is,"initial equation\n",s1});
then
str;

Expand All @@ -1245,7 +1245,7 @@ algorithm
s1 = unparseAlgorithmStrLst(i, als, "\n");
i_1 = i - 1;
is = indentStr(i_1);
str = stringAppendList({is,"algorithm \n",s1});
str = stringAppendList({is,"algorithm\n",s1});
then
str;

Expand All @@ -1254,7 +1254,7 @@ algorithm
s1 = unparseAlgorithmStrLst(i, als, "\n");
i_1 = i - 1;
is = indentStr(i_1);
str = stringAppendList({is,"initial algorithm \n",s1});
str = stringAppendList({is,"initial algorithm\n",s1});
then
str;

Expand Down Expand Up @@ -2711,7 +2711,7 @@ algorithm
i_1 = i + 1;
s2 = unparseEquationitemStrLst(i_1, tb, ";\n");
is = indentStr(i);
str = stringAppendList({"if ",s1," then\n",is,s2,is,"end if"});
str = stringAppendList({is,"if ",s1," then\n",s2,is,"end if"});
then
str;

Expand All @@ -2724,8 +2724,7 @@ algorithm
s4 = unparseEquationitemStrLst(i_1, fb, ";\n");
is = indentStr(i);
str = stringAppendList(
{is,"if ",s1," then\n",s2,s3,"\n",is,"else\n",s4,"\n",is,
"end if"});
{is,"if ",s1," then\n",s2,s3,is,"else\n",s4,is, "end if"});
then
str;

Expand Down Expand Up @@ -2886,24 +2885,23 @@ algorithm

case (i,{x1},sep)
equation
s1 = unparseEqElseifStr(i, x1);
res = stringAppendList({s1,sep});
res = unparseEqElseifStr(i, x1);
then
res;

case (i,(x :: (xs as (_ :: _))),sep)
equation
s2 = unparseEqElseifStrLst(i, xs, sep);
s1 = unparseEqElseifStr(i, x);
res = stringAppendList({s1,sep,s2});
res = stringAppendList({s1,s2});
then
res;

case (i,{x1,x2},sep)
equation
s1 = unparseEqElseifStr(i, x1);
s2 = unparseEqElseifStr(i, x2);
res = stringAppendList({s1,sep,s2});
res = stringAppendList({s1,s2});
then
res;
end matchcontinue;
Expand All @@ -2928,7 +2926,7 @@ algorithm
s2 = unparseEquationitemStrLst(i, el, ";\n");
i_1 = i - 1;
is = indentStr(i_1);
res = stringAppendList({"\n",is,"elseif ",s1," then\n",s2});
res = stringAppendList({is,"elseif ",s1," then\n",s2});
then
res;
end match;
Expand Down
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/Static.mo
Expand Up @@ -3034,7 +3034,7 @@ algorithm
(cache, exp, prop);

// The previous case failed, return a call to the size function instead.
case (cache,env,{arraycr,dim},_,impl,pre,info)
case (cache, env, {arraycr, dim}, _, impl, pre, info)
equation
(cache,dimp,_,_) = elabExp(cache, env, dim, impl,NONE(), true,pre,info);
(cache,arraycrefe,_,_) = elabExp(cache, env, arraycr, impl,NONE(), true,pre,info);
Expand Down Expand Up @@ -12910,7 +12910,7 @@ algorithm
case (_, _, _, Absyn.NOSUB(), _, _, _, _, _)
then (inCache, DAE.DIM_UNKNOWN());

// Size expression that referes to the array itself, such as
// Size expression that refers to the array itself, such as
// Real x(:, size(x, 1)).
case (_, _, _, Absyn.SUBSCRIPT(subScript = Absyn.CALL(function_ =
Absyn.CREF_IDENT(name = "size"), functionArgs = Absyn.FUNCTIONARGS(args =
Expand Down

0 comments on commit e1dccc4

Please sign in to comment.