on master help sign in
cosmetic: modernize whitespace
a79d2d4Evan Czaplicki
src/AST/Declaration.hs+14−4
@@ -11,8 +11,10 @@ import qualified AST.Type as Type
11import qualified Reporting.Annotation as A
11import qualified Reporting.Annotation as A
12
12
13
13
14+
14-- DECLARATIONS
15-- DECLARATIONS
15
16
17+
16data Declaration' port def tipe expr
18data Declaration' port def tipe expr
17 = Definition def
19 = Definition def
18 | Datatype String [String] [(String, [tipe])]
20 | Datatype String [String] [(String, [tipe])]
@@ -21,22 +23,26 @@ data Declaration' port def tipe expr
21 | Fixity Assoc Int String
23 | Fixity Assoc Int String
22
24
23
25
26+
24-- INFIX STUFF
27-- INFIX STUFF
25
28
29+
26data Assoc = L | N | R
30data Assoc = L | N | R
27 deriving (Eq)
31 deriving (Eq)
28
32
29
33
30assocToString :: Assoc -> String
34assocToString :: Assoc -> String
31assocToString assoc =
35assocToString assoc =
32− case assoc of
36+ case assoc of
33− L -> "left"
37+ L -> "left"
34− N -> "non"
38+ N -> "non"
35− R -> "right"
39+ R -> "right"
40+
36
41
37
42
38-- DECLARATION PHASES
43-- DECLARATION PHASES
39
44
45+
40type SourceDecl' =
46type SourceDecl' =
41 Declaration' SourcePort Source.Def Type.Raw Source.Expr
47 Declaration' SourcePort Source.Def Type.Raw Source.Expr
42
48
@@ -54,8 +60,10 @@ type CanonicalDecl =
54 A.Commented (Declaration' CanonicalPort Canonical.Def Type.Canonical Canonical.Expr)
60 A.Commented (Declaration' CanonicalPort Canonical.Def Type.Canonical Canonical.Expr)
55
61
56
62
63+
57-- PORTS
64-- PORTS
58
65
66+
59data SourcePort
67data SourcePort
60 = PortAnnotation String Type.Raw
68 = PortAnnotation String Type.Raw
61 | PortDefinition String Source.Expr
69 | PortDefinition String Source.Expr
@@ -77,8 +85,10 @@ validPortName port =
77 Out name _ _ -> name
85 Out name _ _ -> name
78
86
79
87
88+
80-- BINARY CONVERSION
89-- BINARY CONVERSION
81
90
91+
82instance Binary Assoc where
92instance Binary Assoc where
83 get =
93 get =
84 do n <- getWord8
94 do n <- getWord8