on master help sign in
Switch to modern vertical indentation
7aafdecEvan Czaplicki
src/Parse/Declaration.hs+9
@@ -9,6 +9,7 @@ import Parse.Helpers as Help
9import qualified Parse.Type as Type
9import qualified Parse.Type as Type
10
10
11
11
12+
12declaration :: IParser D.SourceDecl
13declaration :: IParser D.SourceDecl
13declaration =
14declaration =
14 choice
15 choice
@@ -17,8 +18,10 @@ declaration =
17 ]
18 ]
18
19
19
20
21+
20-- TYPE ANNOTATIONS and DEFINITIONS
22-- TYPE ANNOTATIONS and DEFINITIONS
21
23
24+
22definition :: IParser D.SourceDecl'
25definition :: IParser D.SourceDecl'
23definition =
26definition =
24 D.Definition
27 D.Definition
@@ -26,8 +29,10 @@ definition =
26 <?> "a value definition"
29 <?> "a value definition"
27
30
28
31
32+
29-- TYPE ALIAS and UNION TYPES
33-- TYPE ALIAS and UNION TYPES
30
34
35+
31typeDecl :: IParser D.SourceDecl'
36typeDecl :: IParser D.SourceDecl'
32typeDecl =
37typeDecl =
33 do try (reserved "type") <?> "a type declaration"
38 do try (reserved "type") <?> "a type declaration"
@@ -48,8 +53,10 @@ typeDecl =
48 return $ D.Datatype name args tcs
53 return $ D.Datatype name args tcs
49
54
50
55
56+
51-- INFIX
57-- INFIX
52
58
59+
53infixDecl :: IParser D.SourceDecl'
60infixDecl :: IParser D.SourceDecl'
54infixDecl =
61infixDecl =
55 expecting "an infix declaration" $
62 expecting "an infix declaration" $
@@ -65,8 +72,10 @@ infixDecl =
65 D.Fixity assoc (read [n]) <$> anyOp
72 D.Fixity assoc (read [n]) <$> anyOp
66
73
67
74
75+
68-- PORT
76-- PORT
69
77
78+
70port :: IParser D.SourceDecl'
79port :: IParser D.SourceDecl'
71port =
80port =
72 expecting "a port declaration" $
81 expecting "a port declaration" $