equal
deleted
inserted
replaced
12 |
12 |
13 extractUnits :: PascalUnit -> (String, [String]) |
13 extractUnits :: PascalUnit -> (String, [String]) |
14 extractUnits (Program (Identificator name) (Implementation (Uses idents) _ _) _) = ("program " ++ name, map unident idents) |
14 extractUnits (Program (Identificator name) (Implementation (Uses idents) _ _) _) = ("program " ++ name, map unident idents) |
15 extractUnits (Unit (Identificator name) (Interface (Uses idents1) _) (Implementation (Uses idents2) _ _) _ _) = (name, map unident $ idents1 ++ idents2) |
15 extractUnits (Unit (Identificator name) (Interface (Uses idents1) _) (Implementation (Uses idents2) _ _) _ _) = (name, map unident $ idents1 ++ idents2) |
16 |
16 |
17 -- stronglyConnComp :: Ord key => [(node, key, [key])] -> [SCC node] |
|
18 |
|
19 f :: [(String, [String])] -> String |
17 f :: [(String, [String])] -> String |
20 f = unlines . map showSCC . stronglyConnComp . map (\(a, b) -> (a, a, b)) |
18 f = unlines . map showSCC . stronglyConnComp . map (\(a, b) -> (a, a, b)) |
21 where |
19 where |
22 showSCC (AcyclicSCC v) = v |
20 showSCC (AcyclicSCC v) = v |
23 showSCC (CyclicSCC vs) = intercalate ", " vs |
21 showSCC (CyclicSCC vs) = intercalate ", " vs |