summaryrefslogtreecommitdiff
path: root/src/GF/Visualization/VisualizeGrammar.hs
diff options
context:
space:
mode:
authorbringert <unknown>2004-12-10 14:56:52 +0000
committerbringert <unknown>2004-12-10 14:56:52 +0000
commit1711cac06253246a2f6fa44aa7bd13b3b353b8fc (patch)
treeed11c4c4406bb05f8adc6b3fc46c34d4ea41da5c /src/GF/Visualization/VisualizeGrammar.hs
parent95d434bbd2e3722bdc1259971b25aee011b4f30f (diff)
Minor clean-up and comment in module dep visualization.
Diffstat (limited to 'src/GF/Visualization/VisualizeGrammar.hs')
-rw-r--r--src/GF/Visualization/VisualizeGrammar.hs27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/GF/Visualization/VisualizeGrammar.hs b/src/GF/Visualization/VisualizeGrammar.hs
index f8ca567b6..3fe439e61 100644
--- a/src/GF/Visualization/VisualizeGrammar.hs
+++ b/src/GF/Visualization/VisualizeGrammar.hs
@@ -37,7 +37,7 @@ canon2graph :: CanonGrammar -> [Node]
canon2graph gr = [ toNode i m | (i,M.ModMod m) <- M.modules gr ]
source2graph :: SourceGrammar -> [Node]
-source2graph gr = [ toNode i m | (i,M.ModMod m) <- M.modules gr ] -- FIXME: handle ModWith
+source2graph gr = [ toNode i m | (i,M.ModMod m) <- M.modules gr ] -- FIXME: handle ModWith?
toNode :: Ident -> M.Module Ident f i -> Node
toNode i m = Node {
@@ -51,16 +51,21 @@ toNode i m = Node {
}
where
l = prIdent i
- (t,is) = case M.mtype m of
- M.MTAbstract -> (GrAbstract, Nothing)
- M.MTTransfer _ _ -> error "Can't visualize transfer modules yet" -- FIXME
- M.MTConcrete i -> (GrConcrete, Just (prIdent i))
- M.MTResource -> (GrResource, Nothing)
- M.MTInterface -> (GrInterface, Nothing)
- M.MTInstance i -> (GrInstance, Just (prIdent i))
- M.MTReuse rt -> error "Can't visualize reuse modules yet" -- FIXME
- M.MTUnion _ _ -> error "Can't visualize union modules yet" -- FIXME
-
+ (t,is) = fromModType (M.mtype m)
+
+fromModType :: M.ModuleType Ident -> (GrType, Maybe String)
+fromModType t = case t of
+ M.MTAbstract -> (GrAbstract, Nothing)
+ M.MTTransfer _ _ -> error "Can't visualize transfer modules yet" -- FIXME
+ M.MTConcrete i -> (GrConcrete, Just (prIdent i))
+ M.MTResource -> (GrResource, Nothing)
+ M.MTInterface -> (GrInterface, Nothing)
+ M.MTInstance i -> (GrInstance, Just (prIdent i))
+ M.MTReuse rt -> error "Can't visualize reuse modules yet" -- FIXME
+ M.MTUnion _ _ -> error "Can't visualize union modules yet" -- FIXME
+
+-- FIXME: there is something odd about OQualif with 'with' modules,
+-- both names seem to be the same.
openName :: M.OpenSpec Ident -> String
openName (M.OSimple q i) = prIdent i
openName (M.OQualif q i _) = prIdent i