aboutsummaryrefslogtreecommitdiff
path: root/src/HsLexer.lhs
diff options
context:
space:
mode:
authorwolfgang <unknown>2005-03-09 08:28:39 +0000
committerwolfgang <unknown>2005-03-09 08:28:39 +0000
commita0e1d17806caac72175a4e13ad1978148d8dc13b (patch)
tree7f4918503e1633d6a35bf1681b746783bf390a27 /src/HsLexer.lhs
parent905d42f7feeec414dd6dae323c1a0feea6ce2651 (diff)
[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).
Diffstat (limited to 'src/HsLexer.lhs')
-rw-r--r--src/HsLexer.lhs7
1 files changed, 6 insertions, 1 deletions
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