ghc-modi browse.

This commit is contained in:
Kazu Yamamoto 2014-04-21 17:33:53 +09:00
parent 4764ff1acb
commit 334283a4cf

View File

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