diff options
author | andy@galois.com <unknown> | 2007-09-08 05:16:00 +0000 |
---|---|---|
committer | andy@galois.com <unknown> | 2007-09-08 05:16:00 +0000 |
commit | c8742f253f0c0b38f977530eceaaecac55578b4b (patch) | |
tree | 2e724db5ca6d1b359512e00bfb415848661b9f15 /utils/hpc/HpcMarkup.hs | |
parent | 5f4e77a5a2ea03286b795da4051272ac7c774bd7 (diff) | |
download | haskell-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/HpcMarkup.hs')
-rw-r--r-- | utils/hpc/HpcMarkup.hs | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/utils/hpc/HpcMarkup.hs b/utils/hpc/HpcMarkup.hs index 9b920c600e..3be17c8da6 100644 --- a/utils/hpc/HpcMarkup.hs +++ b/utils/hpc/HpcMarkup.hs @@ -10,6 +10,7 @@ import Trace.Hpc.Tix import Trace.Hpc.Util import HpcFlags +import HpcUtils import System.Environment import System.Directory @@ -143,7 +144,7 @@ genHtmlFromMod dest_dir flags tix theFunTotals invertOutput = do let theHsPath = srcDirs flags let modName0 = tixModuleName tix - (Mix origFile _ mixHash tabStop mix') <- readMixWithFlags flags tix + (Mix origFile _ mixHash tabStop mix') <- readMixWithFlags flags (Right tix) let arr_tix :: Array Int Integer arr_tix = listArray (0,length (tixModuleTixs tix) - 1) @@ -206,7 +207,7 @@ genHtmlFromMod dest_dir flags tix theFunTotals invertOutput = do } -- add prefix to modName argument - content <- readFileFromPath origFile theHsPath + content <- readFileFromPath (hpcError markup_plugin) origFile theHsPath let content' = markup tabStop info content let show' = reverse . take 5 . (++ " ") . reverse . show @@ -450,17 +451,3 @@ red = "#f20913" green = "#60de51" yellow = "yellow" ------------------------------------------------------------------------------- - -readFileFromPath :: String -> [String] -> IO String -readFileFromPath filename@('/':_) _ = readFile filename -readFileFromPath filename path0 = readTheFile path0 - where - readTheFile :: [String] -> IO String - readTheFile [] = hpcError markup_plugin - $ "could not find " ++ show filename - ++ " in path " ++ show path0 - readTheFile (dir:dirs) = - catch (do str <- readFile (dir ++ "/" ++ filename) - return str) - (\ _ -> readTheFile dirs) |