lspitzner / brittany

haskell source code formatter
GNU Affero General Public License v3.0
691 stars 72 forks source link

Parsing errors with Haddock #281

Closed dschrempf closed 4 years ago

dschrempf commented 4 years ago

Formatting of Haddock comments in the export list of module headers leads to semantic errors with Haddock. For example, the following code

( DataTypeI       
, DataTypeII(DataConstructor)
  -- * Haddock heading
, name
)

is formatted by Brittany to

( DataTypeI
, DataTypeII
  ( DataConstructor
    -- * Haddock heading
  )
, name
)

which throws a Haddock error of the form

parse error on input ‘-- * Haddock heading’
source  >    |      
source  > 23 |     -- * Haddock heading
source  >    |     ^^^^^^^^^^^^

See also issue #231.

tfausak commented 4 years ago

I think this is a duplicate of #220.