From a0e1d17806caac72175a4e13ad1978148d8dc13b Mon Sep 17 00:00:00 2001 From: wolfgang Date: Wed, 9 Mar 2005 08:28:39 +0000 Subject: [haddock @ 2005-03-09 08:28:39 by wolfgang] Hack haddock's lexer to accept the output from Apple's broken version of cpp (Apple's cpp leaves #pragma set_debug_pwd directives in it's output). --- src/HsLexer.lhs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/HsLexer.lhs') diff --git a/src/HsLexer.lhs b/src/HsLexer.lhs index 96e80c73..d9c4635f 100644 --- a/src/HsLexer.lhs +++ b/src/HsLexer.lhs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: HsLexer.lhs,v 1.17 2005/01/04 16:15:51 simonmar Exp $ +-- $Id: HsLexer.lhs,v 1.18 2005/03/09 08:28:39 wolfgang Exp $ -- -- (c) The GHC Team, 1997-2000 -- @@ -21,6 +21,7 @@ import HsSyn import Numeric ( readHex, readOct ) import Char +import List ( isPrefixOf ) \end{code} \begin{code} @@ -230,6 +231,10 @@ lexer cont input (SrcLoc _ x0) y0 col = tab y _ _ ('\n':s) = newLine cont s y + tab y _ True ('#':s) + | "pragma GCC set_debug_pwd" `isPrefixOf` s + = newLine cont (tail $ dropWhile (/= '\n') s) y + -- single-line comments tab y x bol s@('-':'-':' ':c:_) | doc c = is_a_token bol s y x -- cgit v1.2.3