on master help sign in
Improve error messages when the module documentation structure is missing
0f9f8c0Evan Czaplicki
compiler/Docs.hs+4−2
@@ -69,8 +69,10 @@ docComment = do
69 return $ dropWhile (==' ') (reverse reversed)
69 return $ dropWhile (==' ') (reverse reversed)
70
70
71moduleDocs = do
71moduleDocs = do
72+ optional freshLine
72− (names,exports) <- anyThen moduleDef
73+ (names,exports) <- moduleDef
74+ manyTill (string " " <|> newline <?> "more whitespace")
73− anyThen (lookAhead (string "{-|"))
75+ (lookAhead (string "{-|") <?> "module documentation comment")
74 structure <- docComment
76 structure <- docComment
75 return (List.intercalate "." names, exports, structure)
77 return (List.intercalate "." names, exports, structure)
76
78