Remove infinite loop on MatchGroup without common prefix.
In that case, the exact same MatchGroup would be fed to simplifyTerms again. Now, it is returned immediately, and only the rest of the terms are simplified.
This commit is contained in:
parent
3d3f70619c
commit
59fafe0596
|
@ -118,6 +118,7 @@ simplifyTerms (MatchGroup []:as) = simplifyTerms as
|
||||||
simplifyTerms (MatchGroup gs:as) =
|
simplifyTerms (MatchGroup gs:as) =
|
||||||
case commonPrefix gs of
|
case commonPrefix gs of
|
||||||
(p ,[]) -> simplifyTerms (MatchLiteral p : as)
|
(p ,[]) -> simplifyTerms (MatchLiteral p : as)
|
||||||
|
("",ss) -> MatchGroup ss : simplifyTerms as
|
||||||
(p ,ss) -> simplifyTerms (MatchLiteral p : MatchGroup ss : as)
|
(p ,ss) -> simplifyTerms (MatchLiteral p : MatchGroup ss : as)
|
||||||
simplifyTerms (a:as) = a:simplifyTerms as
|
simplifyTerms (a:as) = a:simplifyTerms as
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue