Commit 8ec864d0 authored by Matthew Pickering's avatar Matthew Pickering Committed by Ben Gamari

Fix pretty printing of top level SCC pragmas

Reviewers: austin, alanz, bgamari

Reviewed By: alanz, bgamari

Subscribers: thomie

Differential Revision:
parent 70317043
......@@ -975,10 +975,8 @@ ppr_sig (SpecInstSig src ty)
ppr_sig (MinimalSig _ bf) = pragBrackets (pprMinimalSig bf)
ppr_sig (PatSynSig names sig_ty)
= text "pattern" <+> pprVarSig (map unLoc names) (ppr sig_ty)
ppr_sig (SCCFunSig _ fn Nothing)
= pragBrackets (text "SCC" <+> ppr fn)
ppr_sig (SCCFunSig src fn (Just str))
= pragSrcBrackets src "{-# SCC#-}" (ppr fn <+> ppr str)
ppr_sig (SCCFunSig src fn mlabel)
= pragSrcBrackets src "{-# SCC" (ppr fn <+> maybe empty ppr mlabel )
instance OutputableBndr name => Outputable (FixitySig name) where
ppr (FixitySig names fixity) = sep [ppr fixity, pprops]
......@@ -193,3 +193,7 @@ ppr046:
.PHONY: ppr047
$(CHECK_PPR) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Ppr047.hs
.PHONY: ppr048
$(CHECK_PPR) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Ppr048.hs
module Ppr048 where
{-# SCc foo #-}
foo :: Int -> Int
foo x = x
{-# SCc foo2 "label" #-}
foo2 :: ()
foo2 = ()
......@@ -45,3 +45,4 @@ test('Ppr044', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr04
test('Ppr045', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr045'])
test('Ppr046', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr046'])
test('Ppr047', expect_fail, run_command, ['$MAKE -s --no-print-directory ppr047'])
test('Ppr048', ignore_stderr, run_command, ['$MAKE -s --no-print-directory ppr048'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment