on master help sign in
Make error messages a bit nicer
commit7be67d604999480f08b674f3346bdc09bd4a8ac0 authorEvan Czaplicki <info@elm-lang.org> dateThu 27 Nov 2014, 02:04 (12 years ago) parent44ee98e
2 files changed+6−4
src/Parse/Declaration.hs+2−2 src/Parse/Helpers.hs+4−2
src/Parse/Declaration.hs+2−2
@@ -31,11 +31,11 @@ typeDecl =
3131
3232 case isAlias of
3333 Just _ ->
34− do tipe <- Type.expr <?> "type"
34+ do tipe <- Type.expr <?> "a type"
3535 return (D.TypeAlias name args tipe)
3636
3737 Nothing ->
38− do tcs <- pipeSep1 Type.constructor <?> "constructor for a union type"
38+ do tcs <- pipeSep1 Type.constructor <?> "a constructor for a union type"
3939 return $ D.Datatype name args tcs
4040
4141
src/Parse/Helpers.hs+4−2
@@ -281,7 +281,9 @@ padded p =
281281
282282spaces :: IParser String
283283spaces =
284− concat <$> many1 (string " " <|> multiComment) <?> "spaces"
284+ let space = string " " <|> multiComment <?> "whitespace"
285+ in
286+ concat <$> many1 space
285287
286288
287289forcedWS :: IParser String
@@ -315,7 +317,7 @@ freshLine =
315317
316318newline :: IParser String
317319newline =
318− simpleNewline <|> lineComment <?> "newline"
320+ simpleNewline <|> lineComment <?> "a newline"
319321
320322
321323simpleNewline :: IParser String