summaryrefslogtreecommitdiff
path: root/compiler/Language/Haskell/Syntax/Decls.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/Language/Haskell/Syntax/Decls.hs')
-rw-r--r--compiler/Language/Haskell/Syntax/Decls.hs19
1 files changed, 15 insertions, 4 deletions
diff --git a/compiler/Language/Haskell/Syntax/Decls.hs b/compiler/Language/Haskell/Syntax/Decls.hs
index 026080d3f6..303105e3d4 100644
--- a/compiler/Language/Haskell/Syntax/Decls.hs
+++ b/compiler/Language/Haskell/Syntax/Decls.hs
@@ -66,7 +66,7 @@ module Language.Haskell.Syntax.Decls (
-- ** @default@ declarations
DefaultDecl(..), LDefaultDecl,
-- ** Template haskell declaration splice
- SpliceExplicitFlag(..),
+ SpliceDecoration(..),
SpliceDecl(..), LSpliceDecl,
-- ** Foreign function interface declarations
ForeignDecl(..), LForeignDecl, ForeignImport(..), ForeignExport(..),
@@ -95,7 +95,7 @@ module Language.Haskell.Syntax.Decls (
import GHC.Prelude
import {-# SOURCE #-} Language.Haskell.Syntax.Expr
- ( HsExpr, HsSplice )
+ ( HsExpr, HsUntypedSplice )
-- Because Expr imports Decls via HsBracket
import Language.Haskell.Syntax.Binds
@@ -245,10 +245,21 @@ type LSpliceDecl pass = XRec pass (SpliceDecl pass)
data SpliceDecl p
= SpliceDecl -- Top level splice
(XSpliceDecl p)
- (XRec p (HsSplice p))
- SpliceExplicitFlag
+ (XRec p (HsUntypedSplice p))
+ SpliceDecoration -- Whether $( ) variant found, for pretty printing
| XSpliceDecl !(XXSpliceDecl p)
+-- | A splice can appear with various decorations wrapped around it. This data
+-- type captures explicitly how it was originally written, for use in the pretty
+-- printer.
+data SpliceDecoration
+ = DollarSplice -- ^ $splice
+ | BareSplice -- ^ bare splice
+ deriving (Data, Eq, Show)
+
+instance Outputable SpliceDecoration where
+ ppr x = text $ show x
+
{-
************************************************************************
* *