on master help sign in
Switch to `module X exposing (..)` style for module declarations
commit47f165713ed4b46dc4946d7ab1cf182b80e5815c authorEvan Czaplicki <info@elm-lang.org> dateTue 15 Mar 2016, 12:16 (11 years ago) parentd8272d0
1 file changed+14−8
src/Parse/Module.hs+14−8
src/Parse/Module.hs+14−8
@@ -60,14 +60,18 @@ moduleDecl =
6060 expecting "a module declaration" $
6161 do
6262 tag <- parseTag
63+ whitespace
6364
64− names <- padded (dotSep1 capVar) <?> "the name of this module"
65+ names <- dotSep1 capVar <?> "the name of this module"
66+ whitespace
6567
6668 settings <- option Module.emptySettings parseSetting
69+ whitespace
6770
68− exports <- padded (listing (addLocation value))
71+ reserved "exposing"
72+ whitespace
6973
70− reserved "where"
74+ exports <- listing (addLocation value)
7175
7276 return (ModuleDecl tag names exports settings)
7377
@@ -99,11 +103,13 @@ parseTag =
99103
100104parseSetting :: IParser Module.SourceSettings
101105parseSetting =
102− addLocation $ brackets $ commaSep $
103− do name <- addLocation lowVar
104− padded equals
105− typeName <- addLocation capVar
106− return (name, typeName)
106+ do try (reserved "where")
107+ whitespace
108+ addLocation $ brackets $ commaSep $
109+ do name <- addLocation lowVar
110+ padded equals
111+ typeName <- addLocation capVar
112+ return (name, typeName)
107113
108114
109115imports :: IParser [Module.UserImport]