summaryrefslogtreecommitdiff
path: root/utils/hpc/HpcDraft.hs
diff options
context:
space:
mode:
authorandy@galois.com <unknown>2007-09-08 05:16:00 +0000
committerandy@galois.com <unknown>2007-09-08 05:16:00 +0000
commitc8742f253f0c0b38f977530eceaaecac55578b4b (patch)
tree2e724db5ca6d1b359512e00bfb415848661b9f15 /utils/hpc/HpcDraft.hs
parent5f4e77a5a2ea03286b795da4051272ac7c774bd7 (diff)
downloadhaskell-c8742f253f0c0b38f977530eceaaecac55578b4b.tar.gz
updating hpc toolkit
The hpc overlay has been ported from hpc-0.4 The new API for readMix is now used.
Diffstat (limited to 'utils/hpc/HpcDraft.hs')
-rw-r--r--utils/hpc/HpcDraft.hs15
1 files changed, 2 insertions, 13 deletions
diff --git a/utils/hpc/HpcDraft.hs b/utils/hpc/HpcDraft.hs
index cd72753ece..36e7a60de4 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 tix
+ 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)