ghc-modi browse.

This commit is contained in:
Kazu Yamamoto 2014-04-21 17:33:53 +09:00
parent 4764ff1acb
commit 334283a4cf
1 changed files with 19 additions and 12 deletions

View File

@ -8,8 +8,9 @@
-- type <file> <line> <column>
-- lint [hlint options] <file>
-- the format of hlint options is [String] because they may contain
-- spaces and aslo <file> may contain spaces.
-- spaces and also <file> may contain spaces.
-- boot
-- browse <module>
--
-- Session separators:
-- OK -- success
@ -162,11 +163,9 @@ loop opt set mvar readLog = do
"info" -> showInfo opt set arg readLog
"type" -> showType opt set arg readLog
"boot" -> bootIt opt set
"browse" -> browseIt opt set arg
_ -> return ([], False, set)
let put = case outputStyle opt of
LispStyle -> putStr
PlainStyle -> putStrLn
liftIO $ put ret
liftIO $ putStr ret
liftIO $ putStrLn $ if ok then "OK" else "NG"
liftIO $ hFlush stdout
when ok $ loop opt set' mvar readLog
@ -282,3 +281,11 @@ bootIt :: Options
bootIt opt set = do
ret <- boot' opt
return (ret, True, set)
browseIt :: Options
-> Set FilePath
-> ModuleString
-> Ghc (String, Bool, Set FilePath)
browseIt opt set mdl = do
ret <- browse opt mdl
return (ret, True, set)