From: Ian Lynagh Date: Wed, 7 Jul 2010 12:04:23 +0000 (+0000) Subject: Handle haddock headers when looking for LANGUAGE/OPTIONS_GHC pragmas X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=8538e4ba68b3d34ceaa2677ed242ac45ab456ce7;hp=847d3977929216f2484ed6ae33112b74fc86776a Handle haddock headers when looking for LANGUAGE/OPTIONS_GHC pragmas --- diff --git a/compiler/main/HeaderInfo.hs b/compiler/main/HeaderInfo.hs index 5a75ed3..cf61b8c 100644 --- a/compiler/main/HeaderInfo.hs +++ b/compiler/main/HeaderInfo.hs @@ -228,6 +228,9 @@ getOptions' toks parseToks (open:xs) | ITlanguage_prag <- getToken open = parseLanguage xs + parseToks (x:xs) + | ITdocCommentNext _ <- getToken x + = parseToks xs parseToks _ = [] parseLanguage (L loc (ITconid fs):rest) = checkExtension (L loc fs) : diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 4ce8304..fdf4bdd 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -285,7 +285,7 @@ $tab+ { warn Opt_WarnTabs (text "Tab character") } -- Haddock comments -<0> { +<0,option_prags> { "-- " $docsym / { ifExtension haddockEnabled } { multiline_doc_comment } "{-" \ ? $docsym / { ifExtension haddockEnabled } { nested_doc_comment } }