on master help sign in
Implement ‘VarBr’
commitd82d607b3a176efa28e4823b5f5098afd4d3b5d8 authormrkkrp <mark.karpov@tweag.io> dateSun 7 Jul 2019, 13:37 (7 years ago) parentcad7e40
3 files changed+10−1
data/examples/declaration/splice/quotes-out.hs+3 data/examples/declaration/splice/quotes.hs+3 src/Ormolu/Printer/Meat/Declaration/Value.hs+4−1
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
1313import Bag (bagToList)
1414import BasicTypes
1515import Control.Monad
16+import Data.Bool (bool)
1617import Data.Data hiding (Infix, Prefix)
1718import Data.List (intersperse, sortOn)
1819import Data.Text (Text)
@@ -728,7 +729,9 @@ p_hsBracket = \case
728729 DecBrL NoExt decls -> quote "d" (p_hsDecls Free decls)
729730 DecBrG NoExt _ -> notImplemented "DecBrG" -- result of renamer
730731 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)
732735 TExpBr NoExt expr -> do
733736 txt "[||"
734737 breakpoint'