Merge from Haddock: allow blank lines inside code blocks
[ghc-hetmet.git] / compiler / parser / HaddockParse.y
index f6c80cb..ded4dbe 100644 (file)
@@ -1,4 +1,11 @@
 {
+{-# OPTIONS -w #-}
+-- The above warning supression flag is a temporary kludge.
+-- While working on this module you are encouraged to remove it and fix
+-- any warnings in the module. See
+--     http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
+-- for details
+
 module HaddockParse (parseHaddockParagraphs, parseHaddockString) where
 
 import {-# SOURCE #-} HaddockLex
@@ -67,7 +74,8 @@ elem  :: { HsDoc RdrName }
        | '@' seq1 '@'          { DocMonospaced $2 }
 
 seq1   :: { HsDoc RdrName }
-       : elem1 seq1            { docAppend $1 $2 }
+       : PARA seq1             { docAppend (DocString "\n") $2 }
+       | elem1 seq1            { docAppend $1 $2 }
        | elem1                 { $1 }
 
 elem1  :: { HsDoc RdrName }