X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mate.git;a=blobdiff_plain;f=Mate%2FBasicBlocks.hs;fp=Mate%2FBasicBlocks.hs;h=e81282022ceb9ba2b7f423bb54ea7934f0d5017e;hp=3fa4a6c699b73931ec8045d50db8a458e07af622;hb=c2cb52c1fb9f86a4b5d2bc584ce8a7f07a03f014;hpb=022b945b3f13f7f855fa304fcf0ece0967fa508d diff --git a/Mate/BasicBlocks.hs b/Mate/BasicBlocks.hs index 3fa4a6c..e812820 100644 --- a/Mate/BasicBlocks.hs +++ b/Mate/BasicBlocks.hs @@ -17,6 +17,7 @@ import qualified Data.ByteString.Lazy as B import Data.Maybe import Control.Monad.State import Control.Applicative +import Control.Arrow import JVM.ClassFile import JVM.Converter @@ -173,7 +174,7 @@ parseBasicBlock i insns = BasicBlock insonly endblock takeWhilePlusOne _ _ [] = (Nothing, []) takeWhilePlusOne p omit (x:xs) | omit x = next - | p x = (\(ys, xs') -> (ys, x:xs')) next + | p x = second (x:) next | otherwise = (Just x, [x]) where next = takeWhilePlusOne p omit xs