@@ -177,9 +177,9 @@ processNetCmd :: IState -> IState -> Handle -> FilePath -> String ->
177 IO (IState, FilePath)
177 IO (IState, FilePath)
178processNetCmd orig i h fn cmd
178processNetCmd orig i h fn cmd
179 = do res <- case parseCmd i "(net)" cmd of
179 = do res <- case parseCmd i "(net)" cmd of
180− P.Failure (P.ErrInfo err _) -> return (Left (Msg " invalid command"))
180+ Left (P.ErrInfo err _) -> return (Left (Msg " invalid command"))
181− P.Success (Right c) -> runExceptT $ evalStateT (processNet fn c) i
181+ Right (Right c) -> runExceptT $ evalStateT (processNet fn c) i
182− P.Success (Left err) -> return (Left (Msg err))
182+ Right (Left err) -> return (Left (Msg err))
183 case res of
183 case res of
184 Right x -> return x
184 Right x -> return x
185 Left err -> do hPutStrLn h (show err)
185 Left err -> do hPutStrLn h (show err)
@@ -295,8 +295,8 @@ runIdeModeCommand h id orig fn mods (IdeMode.Interpret cmd) =
295 do c <- colourise
295 do c <- colourise
296 i <- getIState
296 i <- getIState
297 case parseCmd i "(input)" cmd of
297 case parseCmd i "(input)" cmd of
298− P.Failure (P.ErrInfo err _) -> iPrintError $ show (fixColour False err)
298+ Left (P.ErrInfo err _) -> iPrintError $ show (fixColour False err)
299− P.Success (Right (Prove mode n')) ->
299+ Right (Right (Prove mode n')) ->
300 idrisCatch
300 idrisCatch
301 (do process fn (Prove mode n')
301 (do process fn (Prove mode n')
302 isetPrompt (mkPrompt mods)
302 isetPrompt (mkPrompt mods)
@@ -315,10 +315,10 @@ runIdeModeCommand h id orig fn mods (IdeMode.Interpret cmd) =
315 IdeMode.convSExp "abandon-proof" "Abandoned" n
315 IdeMode.convSExp "abandon-proof" "Abandoned" n
316 _ -> return ()
316 _ -> return ()
317 iRenderError $ pprintErr ist e)
317 iRenderError $ pprintErr ist e)
318− P.Success (Right cmd) -> idrisCatch
318+ Right (Right cmd) -> idrisCatch
319 (idemodeProcess fn cmd)
319 (idemodeProcess fn cmd)
320 (\e -> getIState >>= iRenderError . flip pprintErr e)
320 (\e -> getIState >>= iRenderError . flip pprintErr e)
321− P.Success (Left err) -> iPrintError err
321+ Right (Left err) -> iPrintError err
322runIdeModeCommand h id orig fn mods (IdeMode.REPLCompletions str) =
322runIdeModeCommand h id orig fn mods (IdeMode.REPLCompletions str) =
323 do (unused, compls) <- replCompletion (reverse str, "")
323 do (unused, compls) <- replCompletion (reverse str, "")
324 let good = IdeMode.SexpList [IdeMode.SymbolAtom "ok",
324 let good = IdeMode.SexpList [IdeMode.SymbolAtom "ok",
@@ -353,8 +353,8 @@ runIdeModeCommand h id orig fn mods (IdeMode.TypeOf name) =
353 (Check (PRef (FC "(idemode)" (0,0) (0,0)) [] n))
353 (Check (PRef (FC "(idemode)" (0,0) (0,0)) [] n))
354runIdeModeCommand h id orig fn mods (IdeMode.DocsFor name w) =
354runIdeModeCommand h id orig fn mods (IdeMode.DocsFor name w) =
355 case parseConst orig name of
355 case parseConst orig name of
356− P.Success c -> process "(idemode)" (DocStr (Right c) (howMuch w))
356+ Right c -> process "(idemode)" (DocStr (Right c) (howMuch w))
357− P.Failure _ ->
357+ Left _ ->
358 case splitName name of
358 case splitName name of
359 Left err -> iPrintError err
359 Left err -> iPrintError err
360 Right n -> process "(idemode)" (DocStr (Left n) (howMuch w))
360 Right n -> process "(idemode)" (DocStr (Left n) (howMuch w))
@@ -727,10 +727,10 @@ processInput cmd orig inputs efile
727 let fn = fromMaybe "" (listToMaybe inputs)
727 let fn = fromMaybe "" (listToMaybe inputs)
728 c <- colourise
728 c <- colourise
729 case parseCmd i "(input)" cmd of
729 case parseCmd i "(input)" cmd of
730− P.Failure (P.ErrInfo err _) -> Just inputs <$ iputStrLn (show (fixColour c err))
730+ Left (P.ErrInfo err _) -> Just inputs <$ iputStrLn (show (fixColour c err))
731− P.Success (Right Reload) ->
731+ Right (Right Reload) ->
732 reload orig inputs
732 reload orig inputs
733− P.Success (Right Watch) ->
733+ Right (Right Watch) ->
734 if null inputs then
734 if null inputs then
735 do iputStrLn "No loaded files to watch."
735 do iputStrLn "No loaded files to watch."
736 return (Just inputs)
736 return (Just inputs)
@@ -738,7 +738,7 @@ processInput cmd orig inputs efile
738 do iputStrLn efile
738 do iputStrLn efile
739 iputStrLn $ "Watching for .idr changes in " ++ show inputs ++ ", press enter to cancel."
739 iputStrLn $ "Watching for .idr changes in " ++ show inputs ++ ", press enter to cancel."
740 watch orig inputs
740 watch orig inputs
741− P.Success (Right (Load f toline)) ->
741+ Right (Right (Load f toline)) ->
742 -- The $!! here prevents a space leak on reloading.
742 -- The $!! here prevents a space leak on reloading.
743 -- This isn't a solution - but it's a temporary stopgap.
743 -- This isn't a solution - but it's a temporary stopgap.
744 -- See issue #2386
744 -- See issue #2386
@@ -748,20 +748,20 @@ processInput cmd orig inputs efile
749 mod <- loadInputs [f] toline
749 mod <- loadInputs [f] toline
750 return (Just mod)
750 return (Just mod)
751− P.Success (Right (ModImport f)) ->
751+ Right (Right (ModImport f)) ->
752 do clearErr
752 do clearErr
753 fmod <- loadModule f (IBC_REPL True)
753 fmod <- loadModule f (IBC_REPL True)
754 return (Just (inputs ++ maybe [] (:[]) fmod))
754 return (Just (inputs ++ maybe [] (:[]) fmod))
755− P.Success (Right Edit) -> do -- takeMVar stvar
755+ Right (Right Edit) -> do -- takeMVar stvar
756 edit efile orig
756 edit efile orig
757 return (Just inputs)
757 return (Just inputs)
758− P.Success (Right Proofs) -> Just inputs <$ proofs orig
758+ Right (Right Proofs) -> Just inputs <$ proofs orig
759− P.Success (Right Quit) -> Nothing <$ when (not quiet) (iputStrLn "Bye bye")
759+ Right (Right Quit) -> Nothing <$ when (not quiet) (iputStrLn "Bye bye")
760− P.Success (Right cmd ) -> do idrisCatch (process fn cmd)
760+ Right (Right cmd ) -> do idrisCatch (process fn cmd)
761 (\e -> do msg <- showErr e ; iputStrLn msg)
761 (\e -> do msg <- showErr e ; iputStrLn msg)
762− return (Just inputs)
762+ return (Just inputs)
763− P.Success (Left err) -> do runIO $ putStrLn err
763+ Right (Left err) -> do runIO $ putStrLn err
764− return (Just inputs)
764+ return (Just inputs)
766resolveProof :: Name -> Idris Name
766resolveProof :: Name -> Idris Name
767resolveProof n'
767resolveProof n'
@@ -1426,7 +1426,7 @@ process fn (Browse ns) =
1426process fn (MakeDoc s) =
1426process fn (MakeDoc s) =
1427 do istate <- getIState
1427 do istate <- getIState
1428 let names = words s
1428 let names = words s
1429− parse n | P.Success x <- runparser (fmap fst name) istate fn n = Right x
1429+ parse n | Right x <- runparser (fmap fst name) istate fn n = Right x
1430 parse n = Left n
1430 parse n = Left n
1431 (bad, nss) = partitionEithers $ map parse names
1431 (bad, nss) = partitionEithers $ map parse names
1432 cd <- runIO getCurrentDirectory
1432 cd <- runIO getCurrentDirectory