From 445d45752d2d77bc29381f7944e1eb7817e35246 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 5 Feb 2008 22:36:37 +0000 Subject: [PATCH] Fixed the mode for printing out the flow-graph --- Main.hs | 8 ++------ common/FlowGraph.hs | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Main.hs b/Main.hs index afb83e0..19fe3d2 100644 --- a/Main.hs +++ b/Main.hs @@ -261,11 +261,9 @@ compile mode fn outHandle do procs <- findAllProcesses let fs :: Data t => t -> PassM String fs = ((liftM $ (take 20) . (filter ((/=) '\"'))) . pshowCode) - -- TODO fix this mode - {- let labelFuncs = mkLabelFuncsGeneric fs graphs <- mapM - ((liftM $ either (const Nothing) Just) . (buildFlowGraph labelFuncs) ) + ((liftM $ either (const Nothing) Just) . (buildFlowGraphP labelFuncs) ) (map (A.Only emptyMeta) (snd $ unzip $ procs)) @@ -273,11 +271,9 @@ compile mode fn outHandle -- since it is never used. Then we used graphsTyped (rather than graphs) -- to prevent a compiler warning at graphsTyped being unused; -- graphs is of course identical to graphsTyped, as you can see here: - let (graphsTyped :: [Maybe (FlowGraph Identity String)]) = map (transformMaybe fst) graphs + let (graphsTyped :: [Maybe (FlowGraph' Identity String A.Process)]) = map (transformMaybe fst) graphs --TODO output each process to a separate file, rather than just taking the first: return $ head $ map makeFlowGraphInstr (catMaybes graphsTyped) - -} - return "" ModeCompile -> do progress "Passes:" diff --git a/common/FlowGraph.hs b/common/FlowGraph.hs index 8ef1fef..e162772 100644 --- a/common/FlowGraph.hs +++ b/common/FlowGraph.hs @@ -148,7 +148,7 @@ makeTestNode :: Monad m => Meta -> a -> FNode m a makeTestNode m d = Node (m,d,undefined) -- | Builds the instructions to send to GraphViz -makeFlowGraphInstr :: (Monad m, Show a) => FlowGraph m a -> String +makeFlowGraphInstr :: (Monad m, Show a, Data b) => FlowGraph' m a b -> String makeFlowGraphInstr = graphviz' -- | Joins two labelling functions together. They must use the same monad.