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:
parent
c8d5a4ff40
commit
65d5fc450d
2
Main.hs
2
Main.hs
|
@ -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
|
||||
|
|
7
Parse.hs
7
Parse.hs
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user