on master help sign in
Add printer for ‘HsSpliceTy’
commit09e2a538ef8de6de4d8c054fbc33dcf0051bdb68 authorBasile Henry <bjm.henry@gmail.com> dateMon 5 Aug 2019, 18:01 (7 years ago) parentc6a6193
4 files changed+26−1
data/examples/declaration/type/splice-out.hs+3 data/examples/declaration/type/splice.hs+3 src/Ormolu/Printer/Meat/Declaration/Value.hs-boot+18 src/Ormolu/Printer/Meat/Type.hs+2−1
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
1717import Ormolu.Printer.Combinators
1818import Ormolu.Printer.Meat.Common
1919import Ormolu.Utils
20+import {-# SOURCE #-} Ormolu.Printer.Meat.Declaration.Value (p_hsSplice)
2021
2122p_hsType :: HsType GhcPs -> R ()
2223p_hsType = \case
@@ -95,7 +96,7 @@ p_hsType = \case
9596 inci $ do
9697 txt ":: "
9798 located k p_hsType
98− HsSpliceTy _ _ -> error "HsSpliceTy"
99+ HsSpliceTy NoExt splice -> p_hsSplice splice
99100 HsDocTy NoExt _ _ -> error "HsDocTy"
100101 HsBangTy NoExt (HsSrcBang _ u s) t -> do
101102 case u of