X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fhpc%2FHpcDraft.hs;h=36e7a60de46cb589f109d1ed5ec21416ee7ac7e1;hb=8b6f1dbd2d68af0652aebb8bc3253c64086305f4;hp=36256fc261f353a67898bf58b69d90c2d8a00c4d;hpb=4799dfb37be922c17451f8e0f7c8d765a7a7eaab;p=ghc-hetmet.git diff --git a/utils/hpc/HpcDraft.hs b/utils/hpc/HpcDraft.hs index 36256fc..36e7a60 100644 --- a/utils/hpc/HpcDraft.hs +++ b/utils/hpc/HpcDraft.hs @@ -59,7 +59,7 @@ makeDraft hpcflags tix = do hash = tixModuleHash tix tixs = tixModuleTixs tix - mix@(Mix filepath timestamp hash tabstop entries) <- readMixWithFlags hpcflags mod + mix@(Mix filepath timestamp hash tabstop entries) <- readMixWithFlags hpcflags (Right tix) let forest = createMixEntryDom [ (span,(box,v > 0)) @@ -71,7 +71,7 @@ makeDraft hpcflags tix = do let non_ticked = findNotTickedFromList forest - hs <- readFileFromPath filepath (srcDirs hpcflags) + hs <- readFileFromPath (hpcError draft_plugin) filepath (srcDirs hpcflags) let hsMap :: Map.Map Int String hsMap = Map.fromList (zip [1..] $ lines hs) @@ -136,14 +136,3 @@ findNotTickedFromTree (Node (pos,[]) children) = findNotTickedFromList children findNotTickedFromList :: [MixEntryDom [(BoxLabel,Bool)]] -> [PleaseTick] findNotTickedFromList = concatMap findNotTickedFromTree -readFileFromPath :: String -> [String] -> IO String -readFileFromPath filename@('/':_) _ = readFile filename -readFileFromPath filename path0 = readTheFile path0 - where - readTheFile :: [String] -> IO String - readTheFile [] = error $ "could not find " ++ show filename - ++ " in path " ++ show path0 - readTheFile (dir:dirs) = - catch (do str <- readFile (dir ++ "/" ++ filename) - return str) - (\ _ -> readTheFile dirs)