@@ -221,10 +221,10 @@ decl' syn = fixity
222syntaxDecl :: SyntaxInfo -> IdrisParser PDecl
222syntaxDecl :: SyntaxInfo -> IdrisParser PDecl
223syntaxDecl syn = do s <- syntaxRule syn
223syntaxDecl syn = do s <- syntaxRule syn
224− i <- get
224+ i <- get
225 put (i `addSyntax` s)
225 put (i `addSyntax` s)
226 fc <- getFC
226 fc <- getFC
227− return (PSyntax fc s)
227+ return (PSyntax fc s)
229-- | Extend an 'IState' with a new syntax extension. See also 'addReplSyntax'.
229-- | Extend an 'IState' with a new syntax extension. See also 'addReplSyntax'.
230addSyntax :: IState -> Syntax -> IState
230addSyntax :: IState -> Syntax -> IState
@@ -1203,14 +1203,14 @@ parseProg syn fname input mrk
1203{- | Load idris module and show error if something wrong happens -}
1203{- | Load idris module and show error if something wrong happens -}
1204loadModule :: FilePath -> Idris (Maybe String)
1204loadModule :: FilePath -> Idris (Maybe String)
1205loadModule f
1205loadModule f
1206− = idrisCatch (fmap Just (loadModule' f))
1206+ = idrisCatch (loadModule' f)
1207 (\e -> do setErrSpan (getErrSpan e)
1207 (\e -> do setErrSpan (getErrSpan e)
1208 ist <- getIState
1208 ist <- getIState
1209 iWarn (getErrSpan e) $ pprintErr ist e
1209 iWarn (getErrSpan e) $ pprintErr ist e
1210 return Nothing)
1210 return Nothing)
1212{- | Load idris module -}
1212{- | Load idris module -}
1213−loadModule' :: FilePath -> Idris String
1213+loadModule' :: FilePath -> Idris (Maybe String)
1214loadModule' f
1214loadModule' f
1215 = do i <- getIState
1215 = do i <- getIState
1216 let file = takeWhile (/= ' ') f
1216 let file = takeWhile (/= ' ') f
@@ -1218,7 +1218,8 @@ loadModule' f
1218 ids <- allImportDirs
1218 ids <- allImportDirs
1219 fp <- findImport ids ibcsd file
1219 fp <- findImport ids ibcsd file
1220 if file `elem` imported i
1220 if file `elem` imported i
1221− then iLOG $ "Already read " ++ file
1221+ then do iLOG $ "Already read " ++ file
1222 else do putIState (i { imported = file : imported i })
1223 else do putIState (i { imported = file : imported i })
1223 case fp of
1224 case fp of
1224 IDR fn -> loadSource False fn Nothing
1225 IDR fn -> loadSource False fn Nothing
@@ -1229,9 +1230,7 @@ loadModule' f
1229 case src of
1230 case src of
1230 IDR sfn -> loadSource False sfn Nothing
1231 IDR sfn -> loadSource False sfn Nothing
1231 LIDR sfn -> loadSource True sfn Nothing)
1232 LIDR sfn -> loadSource True sfn Nothing)
1232− let (dir, fh) = splitFileName file
1233+ return $ Just file
1233− return (dropExtension fh)
1236{- | Load idris code from file -}
1235{- | Load idris code from file -}
1237loadFromIFile :: Bool -> IFileType -> Maybe Int -> Idris ()
1236loadFromIFile :: Bool -> IFileType -> Maybe Int -> Idris ()
@@ -1270,7 +1269,7 @@ loadSource lidr f toline
1270 let imports = map (\n -> (True, n, Just n, emptyFC)) ai ++ imports_in
1269 let imports = map (\n -> (True, n, Just n, emptyFC)) ai ++ imports_in
1271 ids <- allImportDirs
1270 ids <- allImportDirs
1272 ibcsd <- valIBCSubDir i
1271 ibcsd <- valIBCSubDir i
1273− mapM_ (\(re, f) ->
1272+ mapM_ (\(re, f) ->
1274 do fp <- findImport ids ibcsd f
1273 do fp <- findImport ids ibcsd f
1275 case fp of
1274 case fp of
1276 LIDR fn -> ifail $ "No ibc for " ++ f
1275 LIDR fn -> ifail $ "No ibc for " ++ f