Skip to content

Commit

Permalink
Almost ready.
Browse files Browse the repository at this point in the history
Last few should be sortable in ghc-exactprint, all relate to comments
which do appear in the AST we get.
  • Loading branch information
alanz committed May 4, 2024
1 parent ccccc48 commit 488df4c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,4 @@ rm -fr dist*
# cabal configure -fdev -froundtrip --enable-tests --with-compiler=/opt/ghc/9.10.0.20240414/bin/ghc --allow-newer

# cabal configure -fdev --enable-tests --with-compiler=/opt/ghc/9.10.0.20240421/bin/ghc --allow-newer
cabal configure -fdev -froundtrip --enable-tests --with-compiler=/opt/ghc/9.10.0.20240428/bin/ghc --allow-newer
cabal configure -fdev -froundtrip --enable-tests --with-compiler=/opt/ghc/9.10.0.20240502/bin/ghc --allow-newer
1 change: 1 addition & 0 deletions roundtrip-config/knownfailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,4 @@
./hackage-roundtrip-work/wai-devel-0.0.0.4/src/Devel/Watch.hs
./hackage-roundtrip-work/willow-0.1.0.0/test/Test/Willow/WebPlatformTests/Manual/Encoding.hs
./hackage-roundtrip-work/yesod-goodies-0.0.5/Yesod/Goodies/Markdown.hs
./hackage-roundtrip-work/MissingH-1.6.0.1/src/System/IO/WindowsCompat.hs
4 changes: 2 additions & 2 deletions src/Language/Haskell/GHC/ExactPrint/ExactPrint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2798,8 +2798,8 @@ prepareListAnnotationF :: (Monad m, Monoid w) =>
prepareListAnnotationF ls = map (\b -> (realSrcSpan $ getLocA b, go b)) ls
where
go (L l a) = do
d' <- markAnnotated (DataFamInstDeclWithContext noAnn NotTopLevel a)
return (toDyn (L l (dc_d d')))
(L l' d') <- markAnnotated (L l (DataFamInstDeclWithContext noAnn NotTopLevel a))
return (toDyn (L l' (dc_d d')))

prepareListAnnotationA :: (Monad m, Monoid w, ExactPrint (LocatedAn an a))
=> [LocatedAn an a] -> [(RealSrcSpan,EP w m Dynamic)]
Expand Down
4 changes: 3 additions & 1 deletion tests/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ tt' = do
-- mkParserTest libdir "ghc910" "LinearLet.hs"
-- mkParserTest libdir "ghc910" "Generic.hs"
-- mkParserTest libdir "ghc910" "Expression.hs"
mkParserTest libdir "ghc910" "GenerateBug.hs"
-- mkParserTest libdir "ghc910" "GenerateBug.hs"
-- mkParserTest libdir "ghc910" "ConstructorArgs.hs"
mkParserTest libdir "ghc910" "T23927_2.hs"

-- Needs GHC changes

Expand Down
13 changes: 13 additions & 0 deletions tests/examples/ghc910/ConstructorArgs.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeOperators #-}
module ConstructorArgs where

class
a -- c1
:+ -- c2
b -- c3

data Foo
= Int -- c4
:* -- c5
String -- c6
7 changes: 7 additions & 0 deletions tests/examples/ghc910/type-operators1-four-out.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeOperators #-}

class
a -- Before operator
:+
b -- After operator

0 comments on commit 488df4c

Please sign in to comment.