Commit fa9909fd authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Adapted renaming from MessageMonad

parent e8788ca1
...@@ -11,7 +11,7 @@ import Control.Monad (unless) ...@@ -11,7 +11,7 @@ import Control.Monad (unless)
import System.IO (hPutStrLn, stderr) import System.IO (hPutStrLn, stderr)
import System.Exit (exitFailure) import System.Exit (exitFailure)
import Curry.Base.MessageMonad (Message, posMessage, ppMessage, ppMessages) import Curry.Base.Message (Message, posMessage, ppMessage, ppMessages)
import CompilerOpts (Options (optVerbosity), Verbosity (..)) import CompilerOpts (Options (optVerbosity), Verbosity (..))
......
...@@ -29,7 +29,7 @@ import Data.List (intercalate, isSuffixOf, nub) ...@@ -29,7 +29,7 @@ import Data.List (intercalate, isSuffixOf, nub)
import qualified Data.Map as Map (Map, empty, insert, lookup, toList) import qualified Data.Map as Map (Map, empty, insert, lookup, toList)
import Curry.Base.Ident import Curry.Base.Ident
import Curry.Base.MessageMonad import Curry.Base.Message
import Curry.Files.Filenames import Curry.Files.Filenames
import Curry.Files.PathUtils import Curry.Files.PathUtils
import Curry.Syntax (Module (..), ImportDecl (..), parseHeader, patchModuleId) import Curry.Syntax (Module (..), ImportDecl (..), parseHeader, patchModuleId)
......
...@@ -19,7 +19,7 @@ import Data.Maybe (mapMaybe) ...@@ -19,7 +19,7 @@ import Data.Maybe (mapMaybe)
import qualified Data.Map as Map (empty) import qualified Data.Map as Map (empty)
import Curry.Base.MessageMonad import Curry.Base.Message
import Curry.Files.Filenames import Curry.Files.Filenames
import Curry.Files.PathUtils import Curry.Files.PathUtils
import Curry.Syntax (Module (..), parseModule) import Curry.Syntax (Module (..), parseModule)
...@@ -34,7 +34,7 @@ import Modules (checkModule, checkModuleHeader, compileModule, loadModule) ...@@ -34,7 +34,7 @@ import Modules (checkModule, checkModuleHeader, compileModule, loadModule)
The result is the syntax tree of the program (type 'Module'; see Module The result is the syntax tree of the program (type 'Module'; see Module
"CurrySyntax"). "CurrySyntax").
-} -}
parse :: FilePath -> String -> MsgMonad Module parse :: FilePath -> String -> MessageM Module
parse fn src = parseModule True fn src >>= genCurrySyntax parse fn src = parseModule True fn src >>= genCurrySyntax
where where
genCurrySyntax mod1 genCurrySyntax mod1
...@@ -49,10 +49,10 @@ parse fn src = parseModule True fn src >>= genCurrySyntax ...@@ -49,10 +49,10 @@ parse fn src = parseModule True fn src >>= genCurrySyntax
environment variable "PAKCSLIBPATH". Additional search paths can environment variable "PAKCSLIBPATH". Additional search paths can
be defined using the argument 'paths'. be defined using the argument 'paths'.
-} -}
fullParse :: Options -> FilePath -> String -> IO (MsgMonad Module) fullParse :: Options -> FilePath -> String -> IO (MessageM Module)
fullParse opts fn src = genFullCurrySyntax opts fn $ parse fn src fullParse opts fn src = genFullCurrySyntax opts fn $ parse fn src
genFullCurrySyntax :: Options -> FilePath -> MsgMonad Module -> IO (MsgMonad Module) genFullCurrySyntax :: Options -> FilePath -> MessageM Module -> IO (MessageM Module)
genFullCurrySyntax opts fn m = runMsgIO m $ \mod1 -> do genFullCurrySyntax opts fn m = runMsgIO m $ \mod1 -> do
errs <- makeInterfaces opts fn mod1 errs <- makeInterfaces opts fn mod1
if null errs if null errs
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
-} -}
module Generators where module Generators where
import Curry.Base.MessageMonad (Message) import Curry.Base.Message (Message)
import qualified Curry.AbstractCurry as AC (CurryProg) import qualified Curry.AbstractCurry as AC (CurryProg)
import qualified Curry.ExtendedFlat.Type as EF (Prog) import qualified Curry.ExtendedFlat.Type as EF (Prog)
......
...@@ -18,7 +18,7 @@ import Data.Maybe (catMaybes, fromJust, fromMaybe, isJust) ...@@ -18,7 +18,7 @@ import Data.Maybe (catMaybes, fromJust, fromMaybe, isJust)
import Text.PrettyPrint import Text.PrettyPrint
-- curry-base -- curry-base
import Curry.Base.MessageMonad import Curry.Base.Message
import Curry.Base.Ident as Id import Curry.Base.Ident as Id
import Curry.ExtendedFlat.Type import Curry.ExtendedFlat.Type
import Curry.ExtendedFlat.TypeInference import Curry.ExtendedFlat.TypeInference
......
...@@ -17,7 +17,7 @@ import Control.Exception (SomeException (..), catch) ...@@ -17,7 +17,7 @@ import Control.Exception (SomeException (..), catch)
import Data.Maybe (fromMaybe, isJust) import Data.Maybe (fromMaybe, isJust)
import Curry.Base.Ident (QualIdent (..), unqualify) import Curry.Base.Ident (QualIdent (..), unqualify)
import Curry.Base.MessageMonad (MsgMonad, failWith, runMsg) import Curry.Base.Message (MessageM, failWith, runMsg)
import Curry.Files.PathUtils (readModule, writeModule, lookupCurryFile import Curry.Files.PathUtils (readModule, writeModule, lookupCurryFile
, dropExtension, takeFileName) , dropExtension, takeFileName)
import Curry.Syntax (lexFile) import Curry.Syntax (lexFile)
...@@ -70,7 +70,7 @@ filename2program opts filename = do ...@@ -70,7 +70,7 @@ filename2program opts filename = do
-- FIXME This is ugly. Avoid exceptions and report failure via MsgMonad -- FIXME This is ugly. Avoid exceptions and report failure via MsgMonad
-- instead! (hsi) -- instead! (hsi)
catchError :: Show a => IO (MsgMonad a) -> IO (MsgMonad a) catchError :: Show a => IO (MessageM a) -> IO (MessageM a)
catchError toDo = Control.Exception.catch (toDo >>= returnNF) handler catchError toDo = Control.Exception.catch (toDo >>= returnNF) handler
where where
handler (SomeException e) = return (failWith (show e)) handler (SomeException e) = return (failWith (show e))
......
...@@ -12,7 +12,7 @@ import Debug.Trace (trace) ...@@ -12,7 +12,7 @@ import Debug.Trace (trace)
import Curry.Base.Ident import Curry.Base.Ident
import Curry.Base.Position import Curry.Base.Position
import Curry.Base.MessageMonad import Curry.Base.Message
import Curry.Syntax hiding (infixOp) import Curry.Syntax hiding (infixOp)
import Base.Messages import Base.Messages
...@@ -77,7 +77,7 @@ data FunctionKind ...@@ -77,7 +77,7 @@ data FunctionKind
--- e.g. [typingParse, fullParse, parse] --- e.g. [typingParse, fullParse, parse]
--- @param lex-Result --- @param lex-Result
--- @return program --- @return program
genProgram :: String -> [MsgMonad Module] -> MsgMonad [(Position, Token)] -> Program genProgram :: String -> [MessageM Module] -> MessageM [(Position, Token)] -> Program
genProgram plainText parseResults m = case runMsg m of genProgram plainText parseResults m = case runMsg m of
(Left e, msgs) -> buildMessagesIntoPlainText (e : msgs) plainText (Left e, msgs) -> buildMessagesIntoPlainText (e : msgs) plainText
(Right posNtokList, mess) -> (Right posNtokList, mess) ->
...@@ -151,7 +151,7 @@ flatCode code = code ...@@ -151,7 +151,7 @@ flatCode code = code
-- ----------Message--------------------------------------- -- ----------Message---------------------------------------
getMessages :: MsgMonad a -> [Message] getMessages :: MessageM a -> [Message]
getMessages = snd . runMsg --(Result mess _) = mess getMessages = snd . runMsg --(Result mess _) = mess
-- getMessages (Failure mess) = mess -- getMessages (Failure mess) = mess
...@@ -193,7 +193,7 @@ buildMessagesIntoPlainText messages text = ...@@ -193,7 +193,7 @@ buildMessagesIntoPlainText messages text =
isLeq _ = True isLeq _ = True
--- @param parse-Modules [typingParse,fullParse,parse] --- @param parse-Modules [typingParse,fullParse,parse]
catIdentifiers :: [MsgMonad Module] -> ([(ModuleIdent,ModuleIdent)],[Code]) catIdentifiers :: [MessageM Module] -> ([(ModuleIdent,ModuleIdent)],[Code])
catIdentifiers = catIds . rights_sc . map (fst . runMsg) catIdentifiers = catIds . rights_sc . map (fst . runMsg)
where where
catIds [] = ([],[]) catIds [] = ([],[])
......
...@@ -22,7 +22,7 @@ import Control.Monad (unless, when) ...@@ -22,7 +22,7 @@ import Control.Monad (unless, when)
import Data.Maybe (fromMaybe) import Data.Maybe (fromMaybe)
import Text.PrettyPrint import Text.PrettyPrint
import Curry.Base.MessageMonad import Curry.Base.Message
import Curry.Base.Position import Curry.Base.Position
import Curry.Base.Ident import Curry.Base.Ident
import Curry.ExtendedFlat.InterfaceEquality (eqInterface) import Curry.ExtendedFlat.InterfaceEquality (eqInterface)
......
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