From ae37c71b42a81ad52b96eda5a765b6ade8dfd291 Mon Sep 17 00:00:00 2001 From: David Waern Date: Wed, 7 Apr 2010 17:05:20 +0000 Subject: Propagate source positions from Lex.x to Parse.y --- src/Haddock/Interface/LexParseRn.hs | 2 +- src/Haddock/Interface/ParseModuleHeader.hs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Haddock/Interface') diff --git a/src/Haddock/Interface/LexParseRn.hs b/src/Haddock/Interface/LexParseRn.hs index 89440139..02fd4bc7 100644 --- a/src/Haddock/Interface/LexParseRn.hs +++ b/src/Haddock/Interface/LexParseRn.hs @@ -44,7 +44,7 @@ lexParseRnHaddockComment :: HaddockCommentType -> GlobalRdrEnv -> HsDocString -> ErrMsgM (Maybe (Doc Name)) lexParseRnHaddockComment hty gre (HsDocString fs) = do let str = unpackFS fs - let toks = tokenise str + let toks = tokenise str (0,0) -- TODO: real position let parse = case hty of NormalHaddockComment -> parseParas DocSectionComment -> parseString diff --git a/src/Haddock/Interface/ParseModuleHeader.hs b/src/Haddock/Interface/ParseModuleHeader.hs index dc701f36..2bdd30a7 100644 --- a/src/Haddock/Interface/ParseModuleHeader.hs +++ b/src/Haddock/Interface/ParseModuleHeader.hs @@ -46,13 +46,15 @@ parseModuleHeader str0 = description1 :: Either String (Maybe (Doc RdrName)) description1 = case descriptionOpt of Nothing -> Right Nothing - Just description -> case parseString . tokenise $ description of + -- TODO: pass real file position + Just description -> case parseString $ tokenise description (0,0) of Nothing -> Left ("Cannot parse Description: " ++ description) Just doc -> Right (Just doc) in case description1 of Left mess -> Left mess - Right docOpt -> case parseParas . tokenise $ str8 of + -- TODO: pass real file position + Right docOpt -> case parseParas $ tokenise str8 (0,0) of Nothing -> Left "Cannot parse header documentation paragraphs" Just doc -> Right (HaddockModInfo { hmi_description = docOpt, -- cgit v1.2.3