Commit 296c75f7 authored by Andrew Gibiansky's avatar Andrew Gibiansky

Allow :load to take multiple filenames or module names

parent 1bb67fef
......@@ -556,15 +556,16 @@ evalCommand _ (Directive GetKind expr) state = wrapExecution state $ do
let typeStr = showSDocUnqual flags $ ppr kind
return $ formatType $ expr ++ " :: " ++ typeStr
evalCommand _ (Directive LoadFile name) state = wrapExecution state $ do
write state $ "Load: " ++ name
let filename = if endswith ".hs" name
then name
else name ++ ".hs"
contents <- readFile $ fpFromString filename
modName <- intercalate "." <$> getModuleName contents
doLoadModule filename modName
evalCommand _ (Directive LoadFile names) state = wrapExecution state $ do
write state $ "Load: " ++ names
forM_ (words names) $ \name -> do
let filename = if endswith ".hs" name
then name
else name ++ ".hs"
contents <- readFile $ fpFromString filename
modName <- intercalate "." <$> getModuleName contents
doLoadModule filename modName
evalCommand publish (Directive ShellCmd ('!':cmd)) state = wrapExecution state $
case words cmd of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment