@@ -1465,7 +1465,6 @@ end printSimpleArcs;
14651465public function matchContinueToSwitch
14661466 input Absyn . MatchType matchType;
14671467 input RenamedPatMatrix2 patMat;
1468- input list< list< Absyn . ElementItem >> caseLocalDecls;
14691468 input list< Absyn . Exp > inputVarList; // matchcontinue (var1,var2,...)
14701469 input list< Absyn . ElementItem > declList;
14711470 input list< Absyn . Exp > resVarList;
@@ -1485,15 +1484,14 @@ protected
14851484algorithm
14861485 (dfaEnv, invalidDecls, cache) := getMatchContinueInvalidDeclsAndInitialEnv(inputVarList, resVarList, cache, localEnv, info);
14871486 Util . SUCCESS () := checkShadowing(declList,invalidDecls,Util . SUCCESS ());
1488- (outCache, cases) := matchContinueToSwitch2(patMat, caseLocalDecls, inputVarList, resVarList, rhlist, elseRhSide, cache, localEnv, invalidDecls, dfaEnv, info);
1487+ (outCache, cases) := matchContinueToSwitch2(patMat, inputVarList, resVarList, rhlist, elseRhSide, cache, localEnv, invalidDecls, dfaEnv, info);
14891488 alg := Absyn . ALG_MATCHCASES (matchType,inputVarList,cases);
14901489 algItem := Absyn . ALGORITHMITEM (alg, NONE (), info);
14911490 expr := Absyn . VALUEBLOCK (declList,Absyn . VALUEBLOCKALGORITHMS ({algItem}),Absyn . BOOL (true ));
14921491end matchContinueToSwitch;
14931492
14941493protected function matchContinueToSwitch2
14951494 input RenamedPatMatrix2 patMat;
1496- input list< list< Absyn . ElementItem >> caseLocalDecls;
14971495 input list< Absyn . Exp > inputVarList;
14981496 input list< Absyn . Exp > resVarList;
14991497 input RightHandList rhlist;
@@ -1506,7 +1504,7 @@ protected function matchContinueToSwitch2
15061504 output Env . Cache outCache;
15071505 output list< Absyn . Exp > exprs;
15081506algorithm
1509- (outCache, exprs) := matchcontinue (patMat, caseLocalDecls, inputVarList, resVarList, rhlist, elseRhSide, cache, localEnv, invalidDecls, initialDfaEnv, info)
1507+ (outCache, exprs) := matchcontinue (patMat, inputVarList, resVarList, rhlist, elseRhSide, cache, localEnv, invalidDecls, initialDfaEnv, info)
15101508 local
15111509 RenamedPatList firstCase;
15121510 RenamedPatMatrix2 restCase;
@@ -1524,34 +1522,34 @@ algorithm
15241522 list< list< Absyn . AlgorithmItem >> caseAlgs;
15251523 list< String > dfaEnvIdents;
15261524
1527- case ({}, {}, _, _, {}, NONE (), localCache, _, _, _, _) then (localCache, {});
1525+ case ({}, _, _, {}, NONE (), localCache, _, _, _, _) then (localCache, {});
15281526
1529- case ({}, {firstDecls}, _, _, {}, SOME (RIGHTHANDSIDE (_ ,body,result,_)), localCache, _, _, _, info)
1527+ case ({}, _, _, {}, SOME (RIGHTHANDSIDE (localList ,body,result,_)), localCache, _, _, _, info)
15301528 equation
1531- Util . SUCCESS () = checkShadowing(firstDecls ,invalidDecls,Util . SUCCESS ());
1529+ Util . SUCCESS () = checkShadowing(localList ,invalidDecls,Util . SUCCESS ());
15321530 exp2 = createListFromExpression(result,resVarList);
15331531 algs3 = createLastAssignments(resVarList,exp2,info);
15341532 algs = {};
1535- els = firstDecls ;
1533+ els = localList ;
15361534 expr = Absyn . VALUEBLOCK (els,Absyn . VALUEBLOCKMATCHCASE (algs,body,algs3),Absyn . BOOL (true ));
15371535 then (localCache, {expr});
15381536
1539- case (firstCase :: restCase, firstDecls :: restDecls, inputVarList, resVarList, RIGHTHANDSIDE (localList,body,result,_) :: restRh, elseRhSide, localCache, localEnv, invalidDecls, initialDfaEnv, info)
1537+ case (firstCase :: restCase, inputVarList, resVarList, RIGHTHANDSIDE (localList,body,result,_) :: restRh, elseRhSide, localCache, localEnv, invalidDecls, initialDfaEnv, info)
15401538 equation
15411539 dfaEnv = initialDfaEnv;
1542- Util . SUCCESS () = checkShadowing(firstDecls ,invalidDecls,Util . SUCCESS ());
1540+ Util . SUCCESS () = checkShadowing(localList ,invalidDecls,Util . SUCCESS ());
15431541
15441542 exp2 = createListFromExpression(result,resVarList);
15451543
15461544 // Create the assignments that assign the return variables
15471545 algs3 = createLastAssignments(resVarList,exp2,info);
15481546 (localCache, dfaEnv, els, algs) = generatePathVarDeclarationsList(firstCase, inputVarList, localCache, localEnv, dfaEnv, info);
1549- els = listAppend(els, firstDecls );
1547+ els = listAppend(els, localList );
15501548 expr = Absyn . VALUEBLOCK (els,Absyn . VALUEBLOCKMATCHCASE (algs,body,algs3),Absyn . BOOL (true ));
1551- (cache, exp2) = matchContinueToSwitch2(restCase, restDecls, inputVarList, resVarList, restRh, elseRhSide, localCache, localEnv, invalidDecls, initialDfaEnv, info);
1549+ (cache, exp2) = matchContinueToSwitch2(restCase, inputVarList, resVarList, restRh, elseRhSide, localCache, localEnv, invalidDecls, initialDfaEnv, info);
15521550 then (cache, expr :: exp2);
15531551
1554- case (_,_,_,_,_,_,_,_,_,_,_ )
1552+ case (_,_,_,_,_,_,_,_,_,_)
15551553 equation
15561554 Debug . fprintln("matchcase" , "- DFA.matchContinueToSwitch2 failed" );
15571555 then fail();
0 commit comments