From 106adbbe619e9bd42a6ca00f097d3eb22011f6f5 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 24 Apr 2002 15:12:41 +0000 Subject: [haddock @ 2002-04-24 15:12:41 by simonmar] Stop slurping comment lines when we see a row of dashes longer than length 2: these are useful as separators. --- src/HsLexer.lhs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/HsLexer.lhs b/src/HsLexer.lhs index d55b5ef0..ac5fa9ae 100644 --- a/src/HsLexer.lhs +++ b/src/HsLexer.lhs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: HsLexer.lhs,v 1.2 2002/04/09 11:23:24 simonmar Exp $ +-- $Id: HsLexer.lhs,v 1.3 2002/04/24 15:12:41 simonmar Exp $ -- -- (c) The GHC Team, 1997-2000 -- @@ -561,8 +561,12 @@ slurpExtraCommentLines s lines y = case rest of '\n':nextline -> case dropWhile nonNewlineSpace nextline of - '-':'-':s -> slurpExtraCommentLines s - ((line++"\n"):lines) (y+1) + -- stop slurping if we see a string of more than two '-'; + -- strings of dashes are useful as separators but we don't + -- want them in the doc. + '-':'-':c:s | c /= '-' + -> slurpExtraCommentLines (c:s) + ((line++"\n"):lines) (y+1) _ -> (rest, finished, y) other -> (rest, finished, y) where -- cgit v1.2.3