Remove readSource in favour of readFile.

It turns out there's a Prelude function that does what readSource does already
-- so just use that. (I was in the process of moving readSource into Utils when
I found it, since I want to use it in other places.)
This commit is contained in:
Adam Sampson 2007-08-19 18:21:23 +00:00
parent c8d5a4ff40
commit 65d5fc450d
2 changed files with 2 additions and 7 deletions

View File

@ -168,7 +168,7 @@ compile fn
-- | Analyse an assembly file.
postCAnalyse :: String -> PassM ()
postCAnalyse fn
= do asm <- liftIO $ readSource fn
= do asm <- liftIO $ readFile fn
progress "Analysing assembly"
output <- analyseAsm asm

View File

@ -2126,11 +2126,6 @@ includedFile
--{{{ preprocessor
-- XXX Doesn't handle conditionals.
readSource :: String -> IO String
readSource file
= do f <- IO.openFile file IO.ReadMode
IO.hGetContents f
-- | Find (via a nasty regex search) all the files that this source file includes.
preFindIncludes :: String -> [String]
preFindIncludes source
@ -2162,7 +2157,7 @@ loadSource file = load file file
Just _ -> return ()
Nothing ->
do progress $ "Loading source file " ++ realName
rawSource <- liftIO $ readSource realName
rawSource <- liftIO $ readFile realName
source <- removeIndentation realName (rawSource ++ "\n" ++ mainMarker ++ "\n")
debug $ "Preprocessed source:"
debug $ numberLines source