Changed the TLP and PrettyShow modules to use CSMR instead of CSM

This commit is contained in:
Neil Brown 2008-02-08 11:29:09 +00:00
parent c56cc6022a
commit 035c526bef
2 changed files with 6 additions and 6 deletions

View File

@ -35,9 +35,9 @@ data TLPChannel = TLPIn | TLPOut | TLPError
-- | Get the name of the TLP and the channels it uses.
-- Fail if the process isn't using a valid interface.
tlpInterface :: (CSM m, Die m) => m ( A.Name, [(A.Direction, TLPChannel)] )
tlpInterface :: (CSMR m, Die m) => m ( A.Name, [(A.Direction, TLPChannel)] )
tlpInterface
= do ps <- get
= do ps <- getCompState
when (null $ csMainLocals ps) (dieReport (Nothing,"No main process found"))
let mainName = snd $ head $ csMainLocals ps
st <- specTypeOfName mainName
@ -48,7 +48,7 @@ tlpInterface
when ((nub (map snd chans)) /= (map snd chans)) $ dieP (findMeta mainName) "Channels used more than once in TLP"
return (mainName, chans)
where
tlpChannel :: (CSM m, Die m) => Meta -> A.Formal -> m (A.Direction, TLPChannel)
tlpChannel :: (CSMR m, Die m) => Meta -> A.Formal -> m (A.Direction, TLPChannel)
tlpChannel m (A.Formal _ (A.Chan dir _ _) n)
= do def <- lookupName n
let origN = A.ndOrigName def

View File

@ -38,7 +38,7 @@ import qualified Data.Set as Set
import Text.PrettyPrint.HughesPJ
import qualified AST as A
import CompState
import CompState hiding (CSM) -- everything here is read-only
import Metadata
import Pattern
import ShowCode
@ -153,8 +153,8 @@ doAny extFunc = extFunc (
pshow :: Data a => a -> String
pshow x = render $ doAny id x
pshowCode :: (Data a, CSM m) => a -> m String
pshowCode c = do st <- get
pshowCode :: (Data a, CSMR m) => a -> m String
pshowCode c = do st <- getCompState
case csFrontend st of
FrontendOccam -> return $ render $ (extOccam $ doAny extOccam) c
FrontendRain -> return $ render $ (extRain $ doAny extRain) c