lspitzner / brittany

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

Support `-XExplicitNamespaces` #158

Closed lspitzner closed 6 years ago

lspitzner commented 6 years ago

From https://github.com/haskell/haskell-ide-engine/issues/666

{-# LANGUAGE ExplicitNamespaces #-}
module Test(type (++)) where

currently:

> clipread | brittany --dump-ast-full --output-on-errors
---- ast ----
A Just (Ann (DP (0,0)) [] [] [((AnnComment (Comment "{-# LANGUAGE ExplicitNamespaces #-}" stdin:1:1-35 Nothing)),DP (0,0)),((G AnnModule),DP (1,0)),((G AnnVal),DP (0,1)),((G AnnWhere),DP (0,1)),((G AnnEofPos),DP (1,0))] Nothing Nothing)
  HsModule
    Just (A (Nothing) {abstract:ModuleName})
    Just
      A Just (Ann (DP (0,0)) [] [] [((G AnnOpenP),DP (0,0)),((G AnnCloseP),DP (0,0))] Nothing Nothing)
        [ A Just (Ann (DP (0,0)) [] [] [] Nothing Nothing)
            IEThingAbs
              A Just (Ann (DP (0,0)) [] [] [((G AnnType),DP (0,0))] Nothing Nothing)
                IEType
                  A Just (Ann (DP (0,1)) [] [] [((G AnnOpenP),DP (0,0)),((G AnnVal),DP (0,0)),((G AnnCloseP),DP (0,0))] Nothing Nothing)
                    Unqual {OccName: ++}
        ]
    []
    []
    Nothing
    Nothing
ERROR: brittany pretty printer returned syntactically invalid result.
----
{-# LANGUAGE ExplicitNamespaces #-}
module Test
  ( ++
  )
where