on master help sign in
Improve error messages when the module documentation structure is missing
commit0f9f8c01e9e2309bd77aaa2f8c82e49a8e582dc2 authorEvan Czaplicki <info@elm-lang.org> dateMon 14 Oct 2013, 14:59 (13 years ago) parent24da711
1 file changed+4−2
compiler/Docs.hs+4−2
compiler/Docs.hs+4−2
@@ -69,8 +69,10 @@ docComment = do
6969 return $ dropWhile (==' ') (reverse reversed)
7070
7171moduleDocs = do
72− (names,exports) <- anyThen moduleDef
73− anyThen (lookAhead (string "{-|"))
72+ optional freshLine
73+ (names,exports) <- moduleDef
74+ manyTill (string " " <|> newline <?> "more whitespace")
75+ (lookAhead (string "{-|") <?> "module documentation comment")
7476 structure <- docComment
7577 return (List.intercalate "." names, exports, structure)
7678