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