projects
/
matthijs
/
master-project
/
cλash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6615a04
)
Print the list of signals sorted by id.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Thu, 19 Feb 2009 14:31:14 +0000
(15:31 +0100)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Thu, 19 Feb 2009 14:31:14 +0000
(15:31 +0100)
Pretty.hs
patch
|
blob
|
history
diff --git
a/Pretty.hs
b/Pretty.hs
index 433c15a7abdc29914c2a6f84d0cd89a9f2cb2512..3c007f9c8931116b3c7d3ecd43e689c86806d3d3 100644
(file)
--- a/
Pretty.hs
+++ b/
Pretty.hs
@@
-47,7
+47,7
@@
instance Pretty FlatFunction where
(text "Args: ") $$ nest 10 (pPrint args)
$+$ (text "Result: ") $$ nest 10 (pPrint res)
$+$ (text "Defs: ") $$ nest 10 (ppdefs defs)
(text "Args: ") $$ nest 10 (pPrint args)
$+$ (text "Result: ") $$ nest 10 (pPrint res)
$+$ (text "Defs: ") $$ nest 10 (ppdefs defs)
- $+$ text "Signals: " $$ nest 10 (p
rintList ppsig
sigs)
+ $+$ text "Signals: " $$ nest 10 (p
psigs
sigs)
where
ppsig (id, info) = pPrint id <> pPrint info
ppdefs defs = vcat (map pPrint sorted)
where
ppsig (id, info) = pPrint id <> pPrint info
ppdefs defs = vcat (map pPrint sorted)
@@
-57,6
+57,9
@@
instance Pretty FlatFunction where
sigDefDst (FApp _ _ dst) = head $ Foldable.toList dst
sigDefDst (CondDef _ _ _ dst) = dst
sigDefDst (UncondDef _ dst) = dst
sigDefDst (FApp _ _ dst) = head $ Foldable.toList dst
sigDefDst (CondDef _ _ _ dst) = dst
sigDefDst (UncondDef _ dst) = dst
+ ppsigs sigs = vcat (map pPrint sorted)
+ where
+ sorted = List.sortBy (\a b -> compare (fst a) (fst b)) sigs
instance Pretty SigDef where
instance Pretty SigDef where