on master help sign in
Implement ‘VarBr’
d82d607mrkkrp
data/examples/declaration/splice/quotes-out.hsnew file+3
@@ -0,0 +1,3 @@
1+foo = ''R
2+
3+bar = 'foo
data/examples/declaration/splice/quotes.hsnew file+3
@@ -0,0 +1,3 @@
1+foo = ''R
2+
3+bar = 'foo
src/Ormolu/Printer/Meat/Declaration/Value.hs+4−1
@@ -13,6 +13,7 @@ where
13import Bag (bagToList)
13import Bag (bagToList)
14import BasicTypes
14import BasicTypes
15import Control.Monad
15import Control.Monad
16+import Data.Bool (bool)
16import Data.Data hiding (Infix, Prefix)
17import Data.Data hiding (Infix, Prefix)
17import Data.List (intersperse, sortOn)
18import Data.List (intersperse, sortOn)
18import Data.Text (Text)
19import Data.Text (Text)
@@ -728,7 +729,9 @@ p_hsBracket = \case
728 DecBrL NoExt decls -> quote "d" (p_hsDecls Free decls)
729 DecBrL NoExt decls -> quote "d" (p_hsDecls Free decls)
729 DecBrG NoExt _ -> notImplemented "DecBrG" -- result of renamer
730 DecBrG NoExt _ -> notImplemented "DecBrG" -- result of renamer
730 TypBr NoExt ty -> quote "t" (located ty p_hsType)
731 TypBr NoExt ty -> quote "t" (located ty p_hsType)
731− VarBr NoExt _ _ -> notImplemented "VarBr"
732+ VarBr NoExt isSingleQuote name -> do
733+ txt (bool "''" "'" isSingleQuote)
734+ p_rdrName (noLoc name)
732 TExpBr NoExt expr -> do
735 TExpBr NoExt expr -> do
733 txt "[||"
736 txt "[||"
734 breakpoint'
737 breakpoint'