Skip to content

Commit

Permalink
Include annotations when printing splices
Browse files Browse the repository at this point in the history
  • Loading branch information
alanz committed May 5, 2024
1 parent 488df4c commit 166cbdb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
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 @@ -3311,11 +3311,11 @@ instance ExactPrint (HsExpr GhcPs) where

exact (HsTypedSplice an s) = do
an0 <- markEpAnnL an lidl AnnDollarDollar
s' <- exact s
s' <- markAnnotated s
return (HsTypedSplice an0 s')

exact (HsUntypedSplice an s) = do
s' <- exact s
s' <- markAnnotated s
return (HsUntypedSplice an s')

exact (HsProc an p c) = do
Expand Down
4 changes: 2 additions & 2 deletions tests/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +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"
-- mkParserTest libdir "ghc910" "T23927_2.hs"

-- Needs GHC changes

Expand Down
11 changes: 8 additions & 3 deletions tests/examples/ghc910/GenerateBug.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
module Generate where

onReturnCode = [||
let _ = foo in
\farInp ->
$$({-trace "unGen.onReturnCode" $-} unGen)
$$(
{- c1 -} unGen
)
||]


foo =
(
{- c2 -} blah
)

0 comments on commit 166cbdb

Please sign in to comment.