Skip to content

Commit

Permalink
remove superfluous matchcontinue
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2787
  • Loading branch information
hkiel authored and OpenModelica-Hudson committed Nov 15, 2018
1 parent 565b72f commit 8fe98ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
13 changes: 5 additions & 8 deletions Compiler/FrontEnd/SCode.mo
Expand Up @@ -4492,35 +4492,32 @@ protected function getElementWithId
input String inId;
output Element outElement;
algorithm
outElement := matchcontinue(inProgram, inId)
outElement := match(inProgram, inId)
local
Program sp, rest;
Element c, e;
Absyn.Path p;
Absyn.Ident i, n;

case ((e as CLASS(name = n))::_, i)
equation
true = stringEq(n, i);
guard stringEq(n, i)
then
e;

case ((e as COMPONENT(name = n))::_, i)
equation
true = stringEq(n, i);
guard stringEq(n, i)
then
e;

case ((e as EXTENDS(baseClassPath = p))::_, i)
equation
true = stringEq(Absyn.pathString(p), i);
guard stringEq(Absyn.pathString(p), i)
then
e;

case (_::rest, i)
then getElementWithId(rest, i);

end matchcontinue;
end match;
end getElementWithId;

public function getElementWithPath
Expand Down
4 changes: 2 additions & 2 deletions Compiler/Script/CevalScriptBackend.mo
Expand Up @@ -7243,7 +7243,7 @@ function getClassComment "Returns the class comment of a Absyn.ClassDef"
output String outString;
algorithm
outString:=
matchcontinue (inClassDef)
match (inClassDef)
local
String str,res;
Option<Absyn.Comment> cmt;
Expand All @@ -7258,7 +7258,7 @@ algorithm
then Interactive.getStringComment(cmt);
case (Absyn.CLASS_EXTENDS(comment = SOME(str))) then str;
else "";
end matchcontinue;
end match;
end getClassComment;

protected function getAnnotationInEquation
Expand Down

0 comments on commit 8fe98ae

Please sign in to comment.