Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 8fe98ae

Browse files
hkielOpenModelica-Hudson
authored andcommitted
remove superfluous matchcontinue
Belonging to [master]: - #2787
1 parent 565b72f commit 8fe98ae

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

Compiler/FrontEnd/SCode.mo

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4492,35 +4492,32 @@ protected function getElementWithId
44924492
input String inId;
44934493
output Element outElement;
44944494
algorithm
4495-
outElement := matchcontinue(inProgram, inId)
4495+
outElement := match(inProgram, inId)
44964496
local
44974497
Program sp, rest;
44984498
Element c, e;
44994499
Absyn.Path p;
45004500
Absyn.Ident i, n;
45014501

45024502
case ((e as CLASS(name = n))::_, i)
4503-
equation
4504-
true = stringEq(n, i);
4503+
guard stringEq(n, i)
45054504
then
45064505
e;
45074506

45084507
case ((e as COMPONENT(name = n))::_, i)
4509-
equation
4510-
true = stringEq(n, i);
4508+
guard stringEq(n, i)
45114509
then
45124510
e;
45134511

45144512
case ((e as EXTENDS(baseClassPath = p))::_, i)
4515-
equation
4516-
true = stringEq(Absyn.pathString(p), i);
4513+
guard stringEq(Absyn.pathString(p), i)
45174514
then
45184515
e;
45194516

45204517
case (_::rest, i)
45214518
then getElementWithId(rest, i);
45224519

4523-
end matchcontinue;
4520+
end match;
45244521
end getElementWithId;
45254522

45264523
public function getElementWithPath

Compiler/Script/CevalScriptBackend.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7243,7 +7243,7 @@ function getClassComment "Returns the class comment of a Absyn.ClassDef"
72437243
output String outString;
72447244
algorithm
72457245
outString:=
7246-
matchcontinue (inClassDef)
7246+
match (inClassDef)
72477247
local
72487248
String str,res;
72497249
Option<Absyn.Comment> cmt;
@@ -7258,7 +7258,7 @@ algorithm
72587258
then Interactive.getStringComment(cmt);
72597259
case (Absyn.CLASS_EXTENDS(comment = SOME(str))) then str;
72607260
else "";
7261-
end matchcontinue;
7261+
end match;
72627262
end getClassComment;
72637263

72647264
protected function getAnnotationInEquation

0 commit comments

Comments
 (0)