on master help sign in
Add printer for ‘HsSpliceTy’
09e2a53Basile Henry
data/examples/declaration/type/splice-out.hsnew file+3
@@ -0,0 +1,3 @@
1+{-# LANGUAGE TemplateHaskell #-}
2+
3+type Foo = $(bar [t|Int|])
data/examples/declaration/type/splice.hsnew file+3
@@ -0,0 +1,3 @@
1+{-# LANGUAGE TemplateHaskell #-}
2+
3+type Foo = $( bar [t|Int|] )
src/Ormolu/Printer/Meat/Declaration/Value.hs-bootnew file+18
@@ -0,0 +1,18 @@
1+module Ormolu.Printer.Meat.Declaration.Value
2+ ( p_valDecl
3+ , p_pat
4+ , p_hsExpr
5+ , p_hsSplice
6+ )
7+where
8+
9+import GHC
10+import Ormolu.Printer.Combinators
11+
12+p_valDecl :: HsBindLR GhcPs GhcPs -> R ()
13+
14+p_pat :: Pat GhcPs -> R ()
15+
16+p_hsExpr :: HsExpr GhcPs -> R ()
17+
18+p_hsSplice :: HsSplice GhcPs -> R ()
src/Ormolu/Printer/Meat/Type.hs+2−1
@@ -17,6 +17,7 @@ import GHC
17import Ormolu.Printer.Combinators
17import Ormolu.Printer.Combinators
18import Ormolu.Printer.Meat.Common
18import Ormolu.Printer.Meat.Common
19import Ormolu.Utils
19import Ormolu.Utils
20+import {-# SOURCE #-} Ormolu.Printer.Meat.Declaration.Value (p_hsSplice)
20
21
21p_hsType :: HsType GhcPs -> R ()
22p_hsType :: HsType GhcPs -> R ()
22p_hsType = \case
23p_hsType = \case
@@ -95,7 +96,7 @@ p_hsType = \case
95 inci $ do
96 inci $ do
96 txt ":: "
97 txt ":: "
97 located k p_hsType
98 located k p_hsType
98− HsSpliceTy _ _ -> error "HsSpliceTy"
99+ HsSpliceTy NoExt splice -> p_hsSplice splice
99 HsDocTy NoExt _ _ -> error "HsDocTy"
100 HsDocTy NoExt _ _ -> error "HsDocTy"
100 HsBangTy NoExt (HsSrcBang _ u s) t -> do
101 HsBangTy NoExt (HsSrcBang _ u s) t -> do
101 case u of
102 case u of