1
1
mirror of https://github.com/google/ormolu.git synced 2024-11-30 14:46:39 +03:00

Replace weird whitespace characters by normal spaces

I'm just curios of their origin. If I'm not mistaken they were introduced by
@yumiova.
This commit is contained in:
mrkkrp 2019-08-05 21:01:52 +02:00
parent 09e2a538ef
commit 8870acd41f
No known key found for this signature in database
GPG Key ID: 8564658B2889FF7C
8 changed files with 16 additions and 16 deletions

View File

@ -40,7 +40,7 @@ foo = do
c <- a + b
print c
rec something $ do
rec something $ do
x <- a
print x

View File

@ -181,7 +181,7 @@ backticks m = do
-- | Surround given entity by banana brackets (i.e., from arrow notation.)
banana :: R () -> R ()
banana m = sitcc $ do
banana m = sitcc $ do
txt "(|"
ospaces m
txt "|)"

View File

@ -41,9 +41,9 @@ p_classDecl ctx name tvars fixity fdeps csigs cdefs cats catdefs = do
dependencySpans = getLoc <$> fdeps
combinedSpans = getLoc ctx : (signatureSpans ++ dependencySpans)
txt "class"
switchLayout combinedSpans $ do
switchLayout combinedSpans $ do
breakpoint
inci $ do
inci $ do
p_classContext ctx
switchLayout signatureSpans $ do
p_infixDefHelper
@ -73,7 +73,7 @@ p_classDecl ctx name tvars fixity fdeps csigs cdefs cats catdefs = do
else newline
p_classContext :: LHsContext GhcPs -> R ()
p_classContext ctx = unless (null (unLoc ctx)) $ do
p_classContext ctx = unless (null (unLoc ctx)) $ do
located ctx p_hsContext
breakpoint
txt "=> "

View File

@ -30,12 +30,12 @@ p_dataDecl style name tpats fixity HsDataDefn {..} = do
txt $ case dd_ND of
NewType -> "newtype"
DataType -> "data"
txt $ case style of
txt $ case style of
Associated -> mempty
Free -> " instance"
switchLayout (getLoc name : fmap getLoc tpats) $ do
breakpoint
inci $ p_infixDefHelper
inci $ p_infixDefHelper
(isInfix fixity)
inci
(p_rdrName name)

View File

@ -69,7 +69,7 @@ p_clsInstDecl = \case
case cid_poly_ty of
HsIB {..} -> located hsib_body $ \x -> do
breakpoint
inci $ do
inci $ do
match_overlap_mode cid_overlap_mode breakpoint
p_hsType x
-- GHC's AST does not necessarily store each kind of element in source

View File

@ -26,7 +26,7 @@ p_famDecl style FamilyDecl {..} = do
DataFamily -> Nothing <$ txt "data"
OpenTypeFamily -> Nothing <$ txt "type"
ClosedTypeFamily eqs -> Just eqs <$ txt "type"
txt $ case style of
txt $ case style of
Associated -> mempty
Free -> " family"
let HsQTvs {..} = fdTyVars

View File

@ -235,7 +235,7 @@ p_grhs' pretty style (GRHS NoExt guards body) =
txt "| "
sitcc (sep (comma >> breakpoint) (sitcc . located' p_stmt) xs)
space
txt $ case style of
txt $ case style of
EqualSign -> "="
RightArrow -> "->"
breakpoint
@ -248,14 +248,14 @@ p_hsCmd :: HsCmd GhcPs -> R ()
p_hsCmd = \case
HsCmdArrApp NoExt body input arrType _ -> do
located body p_hsExpr
txt $ case arrType of
txt $ case arrType of
HsFirstOrderApp -> " -<"
HsHigherOrderApp -> " -<<"
placeHanging (exprPlacement (unLoc input)) $
located input p_hsExpr
HsCmdArrForm NoExt form Prefix _ cmds -> banana $ sitcc $ do
HsCmdArrForm NoExt form Prefix _ cmds -> banana $ sitcc $ do
located form p_hsExpr
unless (null cmds) $ do
unless (null cmds) $ do
breakpoint
inci (sequence_ (intersperse breakpoint (located' p_hsCmdTop <$> cmds)))
HsCmdArrForm NoExt form Infix _ [left, right] -> do
@ -406,7 +406,7 @@ p_hsRecField
-> R ()
p_hsRecField = \HsRecField {..} -> do
located hsRecFieldLbl atom
unless hsRecPun $ do
unless hsRecPun $ do
txt " = "
located hsRecFieldArg p_hsExpr
@ -607,7 +607,7 @@ p_hsExpr = \case
HsSpliceE NoExt splice -> p_hsSplice splice
HsProc NoExt p e -> do
txt "proc"
located p $ \x -> do
located p $ \x -> do
breakpoint
inci (p_pat x)
breakpoint

View File

@ -165,7 +165,7 @@ p_conDeclField (XConDeclField NoExt) = notImplemented "XConDeclField"
tyVarsToTypes :: LHsQTyVars GhcPs -> [LHsType GhcPs]
tyVarsToTypes = \case
HsQTvs {..} -> fmap tyVarToType <$> hsq_explicit
HsQTvs {..} -> fmap tyVarToType <$> hsq_explicit
XLHsQTyVars {} -> notImplemented "XLHsQTyVars"
tyVarToType :: HsTyVarBndr GhcPs -> HsType GhcPs