on master help sign in
Switch to `module X exposing (..)` style for module declarations
47f1657Evan Czaplicki
src/Parse/Module.hs+14−8
@@ -60,14 +60,18 @@ moduleDecl =
60 expecting "a module declaration" $
60 expecting "a module declaration" $
61 do
61 do
62 tag <- parseTag
62 tag <- parseTag
63+ whitespace
63
64
64− names <- padded (dotSep1 capVar) <?> "the name of this module"
65+ names <- dotSep1 capVar <?> "the name of this module"
66+ whitespace
65
67
66 settings <- option Module.emptySettings parseSetting
68 settings <- option Module.emptySettings parseSetting
69+ whitespace
67
70
68− exports <- padded (listing (addLocation value))
71+ reserved "exposing"
72+ whitespace
69
73
70− reserved "where"
74+ exports <- listing (addLocation value)
71
75
72 return (ModuleDecl tag names exports settings)
76 return (ModuleDecl tag names exports settings)
73
77
@@ -99,11 +103,13 @@ parseTag =
99
103
100parseSetting :: IParser Module.SourceSettings
104parseSetting :: IParser Module.SourceSettings
101parseSetting =
105parseSetting =
106+ do try (reserved "where")
107+ whitespace
102− addLocation $ brackets $ commaSep $
108+ addLocation $ brackets $ commaSep $
103− do name <- addLocation lowVar
109+ do name <- addLocation lowVar
104− padded equals
110+ padded equals
105− typeName <- addLocation capVar
111+ typeName <- addLocation capVar
106− return (name, typeName)
112+ return (name, typeName)
107
113
108
114
109imports :: IParser [Module.UserImport]
115imports :: IParser [Module.UserImport]