@@ -82,23 +82,19 @@ algorithm
82
82
end inferBindings;
83
83
84
84
protected function inferBindingClientList
85
- input list< Client_e > client_list "list of nodes for which the binding is inferred" ;
86
- input Absyn . Class vmodel;
87
- input Absyn . Program env;
88
- output Absyn . Class out_vmodel;
89
- // output String bindingExpression;
90
- algorithm
91
- out_vmodel := matchcontinue(client_list)
92
- local
93
- Client_e ce;
94
- list< Client_e > rest;
95
- Absyn . Class upd_vmodel;
96
- case {} then vmodel;
97
- case ce::rest
98
- equation
99
- upd_vmodel = inferBindingClient(ce, vmodel, env);
100
- then inferBindingClientList(rest, upd_vmodel, env);
101
- end matchcontinue;
85
+ input list< Client_e > client_list "list of nodes for which the binding is inferred" ;
86
+ input Absyn . Class vmodel;
87
+ input Absyn . Program env;
88
+ output Absyn . Class out_vmodel = vmodel;
89
+ // output String bindingExpression;
90
+ protected
91
+ Client_e ce;
92
+ list< Client_e > rest = client_list;
93
+ algorithm
94
+ while not listEmpty(rest) loop
95
+ ce::rest := rest;
96
+ out_vmodel := inferBindingClient(ce, out_vmodel, env);
97
+ end while ;
102
98
end inferBindingClientList;
103
99
104
100
protected function inferBindingClient
@@ -305,7 +301,7 @@ protected function applyModifier
305
301
input String instance_name;
306
302
output list< Absyn . ComponentItem > out_comps;
307
303
algorithm
308
- out_comps := matchcontinue (comps)
304
+ out_comps := match (comps)
309
305
local
310
306
list< Absyn . ComponentItem > rest;
311
307
Absyn . ComponentItem cnew;
@@ -323,7 +319,7 @@ protected function applyModifier
323
319
then cnew::applyModifier(rest, exp, instance_name);
324
320
case _::rest
325
321
then applyModifier(rest, exp, instance_name);
326
- end matchcontinue ;
322
+ end match ;
327
323
end applyModifier;
328
324
329
325
@@ -441,7 +437,7 @@ protected function applyTemplate
441
437
input list< Absyn . Exp > in_es;
442
438
output list< Absyn . Exp > out_es;
443
439
algorithm
444
- out_es := matchcontinue (comps)
440
+ out_es := match (comps)
445
441
local
446
442
list< Absyn . ComponentItem > rest;
447
443
Absyn . Ident name;
@@ -451,7 +447,7 @@ protected function applyTemplate
451
447
then applyTemplate(exp, rest, parseExpression(exp, name)::in_es);
452
448
case _::rest
453
449
then applyTemplate(exp, rest, in_es);
454
- end matchcontinue ;
450
+ end match ;
455
451
end applyTemplate;
456
452
457
453
protected function parseExpression
@@ -510,10 +506,10 @@ algorithm
510
506
equation
511
507
new_crf = updateCRF(crf, fargs);
512
508
then (Absyn . CREF (new_crf));
513
- case (_)
514
- equation
515
- // print(Dump.dumpExpStr(in_eq) + "\n");
516
- then (in_eq);
509
+ else
510
+ equation
511
+ // print(Dump.dumpExpStr(in_eq) + "\n");
512
+ then (in_eq);
517
513
end match;
518
514
end parseExpression;
519
515
@@ -535,7 +531,7 @@ protected function updateCRF
535
531
new_cRef = updateCRF(cRef, name);
536
532
then Absyn . CREF_QUAL (id, subscripts, new_cRef);
537
533
case (Absyn . CREF_IDENT ("getPath" , subscripts)) then Absyn . CREF_IDENT (name, subscripts);
538
- case _ then componentRef;
534
+ else componentRef;
539
535
end matchcontinue;
540
536
end updateCRF;
541
537
@@ -682,20 +678,18 @@ output Boolean isClient;
682
678
output String iname;
683
679
algorithm
684
680
685
- (isClient, iname) := matchcontinue (clients)
681
+ (isClient, iname) := match (clients)
686
682
local
687
683
list< Absyn . Class > parents;
688
684
Absyn . Class current_ci;
689
685
String name, inst;
690
686
list< Client > rest;
691
687
case {} then (false , "" );
692
- case CLIENT (name, inst)::rest
693
- equation
694
- true = (name == ci_name);
688
+ case CLIENT (name, inst)::rest guard (name == ci_name)
695
689
then (true , inst);
696
690
case _::rest
697
691
then isClientInMediator(ci_name, rest);
698
- end matchcontinue ;
692
+ end match ;
699
693
end isClientInMediator;
700
694
701
695
@@ -705,19 +699,18 @@ input Ident name;
705
699
input list< Client > clients;
706
700
output Boolean isM;
707
701
algorithm
708
- isM := matchcontinue (clients)
709
- local
710
- String className;
711
- String instance;
712
- list< Client > rest;
702
+ isM := match (clients)
703
+ local
704
+ String className;
705
+ String instance;
706
+ list< Client > rest;
713
707
case {} then false ;
714
708
case CLIENT (className, instance)::rest
715
- equation
716
- className = name;
709
+ guard stringEq(className, name)
717
710
then true ;
718
711
case _::rest
719
712
then specifiesBindingFor(name, rest);
720
- end matchcontinue ;
713
+ end match ;
721
714
end specifiesBindingFor;
722
715
723
716
@@ -834,19 +827,18 @@ input list<Absyn.NamedArg> argNames;
834
827
input String name;
835
828
output String val;
836
829
algorithm
837
- val := matchcontinue (argNames)
830
+ val := match (argNames)
838
831
local
839
832
String str, nname;
840
833
list< Absyn . NamedArg > rest;
841
834
case {}
842
835
then "" ;
843
836
case Absyn . NAMEDARG (nname, Absyn . STRING (str))::rest
844
- equation
845
- true = (nname == name);
837
+ guard (nname == name)
846
838
then str;
847
839
case _::rest
848
840
then getArg(rest, name);
849
- end matchcontinue ;
841
+ end match ;
850
842
end getArg;
851
843
852
844
@@ -855,7 +847,7 @@ input list<SCode.Element> elems;
855
847
output Boolean result;
856
848
output Option < SCode . Mod > mods;
857
849
algorithm
858
- (result, mods) := matchcontinue (elems)
850
+ (result, mods) := match (elems)
859
851
local
860
852
list< SCode . Element > rest;
861
853
SCode . Element el;
@@ -867,7 +859,7 @@ output Option<SCode.Mod> mods;
867
859
then (true , SOME (mod));
868
860
case el::rest
869
861
then isMediator(rest);
870
- end matchcontinue ;
862
+ end match ;
871
863
end isMediator;
872
864
873
865
protected function getValue
0 commit comments