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