Skip to content

Pragma parse failure in commonmark with GHC 9.0.1

Summary

The commonmark package fails to build with GHC 9.0.1 due to a parse failures on SCC pragmas:

src/Commonmark/Inlines.hs:333:10: error:
    A pragma is not allowed in this position: {-# SCC attrParser #-}
    |
333 |          {-# SCC attrParser #-} (AddAttributes <$> attrParser)
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Commonmark/Inlines.hs:337:7: error:
    A pragma is not allowed in this position: {-# SCC pDelimChunk #-}
    |
337 |   <|> {-# SCC pDelimChunk #-} pDelimChunk specmap isDelimChar
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I can't find anything about this in the release notes or the migration guide, so I'm wondering whether this might be an unintended regression.

I've also reported the issue at https://github.com/jgm/commonmark-hs/issues/72.

Steps to reproduce

cabal install commonmark-0.1.1.3 -w ghc-9.0.1

Expected behavior

Compilation succeeds.

Environment

  • GHC version used: GHC-9.0.1
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information