on master help sign in
Make error messages a bit nicer
7be67d6Evan Czaplicki
src/Parse/Declaration.hs+2−2
@@ -31,11 +31,11 @@ typeDecl =
31
31
32 case isAlias of
32 case isAlias of
33 Just _ ->
33 Just _ ->
34− do tipe <- Type.expr <?> "type"
34+ do tipe <- Type.expr <?> "a type"
35 return (D.TypeAlias name args tipe)
35 return (D.TypeAlias name args tipe)
36
36
37 Nothing ->
37 Nothing ->
38− do tcs <- pipeSep1 Type.constructor <?> "constructor for a union type"
38+ do tcs <- pipeSep1 Type.constructor <?> "a constructor for a union type"
39 return $ D.Datatype name args tcs
39 return $ D.Datatype name args tcs
40
40
41
41
src/Parse/Helpers.hs+4−2
@@ -281,7 +281,9 @@ padded p =
281
281
282spaces :: IParser String
282spaces :: IParser String
283spaces =
283spaces =
284+ let space = string " " <|> multiComment <?> "whitespace"
285+ in
284− concat <$> many1 (string " " <|> multiComment) <?> "spaces"
286+ concat <$> many1 space
285
287
286
288
287forcedWS :: IParser String
289forcedWS :: IParser String
@@ -315,7 +317,7 @@ freshLine =
315
317
316newline :: IParser String
318newline :: IParser String
317newline =
319newline =
318− simpleNewline <|> lineComment <?> "newline"
320+ simpleNewline <|> lineComment <?> "a newline"
319
321
320
322
321simpleNewline :: IParser String
323simpleNewline :: IParser String