Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,322
Issues
4,322
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
367
Merge Requests
367
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
144db21e
Commit
144db21e
authored
Apr 19, 2013
by
Krzysztof Gogolewski
Committed by
ian@well-typed.com
Apr 21, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display operators using parentheses/backticks in error messages (
#7848
)
parent
78d56448
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
19 deletions
+23
-19
compiler/basicTypes/DataCon.lhs
compiler/basicTypes/DataCon.lhs
+4
-0
compiler/hsSyn/HsBinds.lhs
compiler/hsSyn/HsBinds.lhs
+7
-7
compiler/hsSyn/HsPat.lhs
compiler/hsSyn/HsPat.lhs
+7
-7
compiler/main/PprTyThing.hs
compiler/main/PprTyThing.hs
+1
-1
compiler/typecheck/TcErrors.lhs
compiler/typecheck/TcErrors.lhs
+1
-1
compiler/typecheck/TcHsType.lhs
compiler/typecheck/TcHsType.lhs
+1
-1
compiler/typecheck/TcRnTypes.lhs
compiler/typecheck/TcRnTypes.lhs
+1
-1
compiler/typecheck/TcTyClsDecls.lhs
compiler/typecheck/TcTyClsDecls.lhs
+1
-1
No files found.
compiler/basicTypes/DataCon.lhs
View file @
144db21e
...
@@ -529,6 +529,10 @@ instance NamedThing DataCon where
...
@@ -529,6 +529,10 @@ instance NamedThing DataCon where
instance Outputable DataCon where
instance Outputable DataCon where
ppr con = ppr (dataConName con)
ppr con = ppr (dataConName con)
instance OutputableBndr DataCon where
pprInfixOcc con = pprInfixName (dataConName con)
pprPrefixOcc con = pprPrefixName (dataConName con)
instance Data.Data DataCon where
instance Data.Data DataCon where
-- don't traverse?
-- don't traverse?
toConstr _ = abstractConstr "DataCon"
toConstr _ = abstractConstr "DataCon"
...
...
compiler/hsSyn/HsBinds.lhs
View file @
144db21e
...
@@ -575,22 +575,22 @@ ppr_sig (TypeSig vars ty) = pprVarSig (map unLoc vars) (ppr ty)
...
@@ -575,22 +575,22 @@ ppr_sig (TypeSig vars ty) = pprVarSig (map unLoc vars) (ppr ty)
ppr_sig (GenericSig vars ty) = ptext (sLit "default") <+> pprVarSig (map unLoc vars) (ppr ty)
ppr_sig (GenericSig vars ty) = ptext (sLit "default") <+> pprVarSig (map unLoc vars) (ppr ty)
ppr_sig (IdSig id) = pprVarSig [id] (ppr (varType id))
ppr_sig (IdSig id) = pprVarSig [id] (ppr (varType id))
ppr_sig (FixSig fix_sig) = ppr fix_sig
ppr_sig (FixSig fix_sig) = ppr fix_sig
ppr_sig (SpecSig var ty inl) = pragBrackets (pprSpec
var
(ppr ty) inl)
ppr_sig (SpecSig var ty inl) = pragBrackets (pprSpec
(unLoc var)
(ppr ty) inl)
ppr_sig (InlineSig var inl) = pragBrackets (ppr inl <+> ppr
var
)
ppr_sig (InlineSig var inl) = pragBrackets (ppr inl <+> ppr
PrefixOcc (unLoc var)
)
ppr_sig (SpecInstSig ty) = pragBrackets (ptext (sLit "SPECIALIZE instance") <+> ppr ty)
ppr_sig (SpecInstSig ty) = pragBrackets (ptext (sLit "SPECIALIZE instance") <+> ppr ty)
instance Outputable name => Outputable (FixitySig name) where
instance Outputable
Bndr
name => Outputable (FixitySig name) where
ppr (FixitySig name fixity) = sep [ppr fixity, ppr
name
]
ppr (FixitySig name fixity) = sep [ppr fixity, ppr
InfixOcc (unLoc name)
]
pragBrackets :: SDoc -> SDoc
pragBrackets :: SDoc -> SDoc
pragBrackets doc = ptext (sLit "{-#") <+> doc <+> ptext (sLit "#-}")
pragBrackets doc = ptext (sLit "{-#") <+> doc <+> ptext (sLit "#-}")
pprVarSig :: (Outputable id) => [id] -> SDoc -> SDoc
pprVarSig :: (Outputable
Bndr
id) => [id] -> SDoc -> SDoc
pprVarSig vars pp_ty = sep [pprvars <+> dcolon, nest 2 pp_ty]
pprVarSig vars pp_ty = sep [pprvars <+> dcolon, nest 2 pp_ty]
where
where
pprvars = hsep $ punctuate comma (map ppr vars)
pprvars = hsep $ punctuate comma (map ppr
PrefixOcc
vars)
pprSpec :: (Outputable id) => id -> SDoc -> InlinePragma -> SDoc
pprSpec :: (Outputable
Bndr
id) => id -> SDoc -> InlinePragma -> SDoc
pprSpec var pp_ty inl = ptext (sLit "SPECIALIZE") <+> pp_inl <+> pprVarSig [var] pp_ty
pprSpec var pp_ty inl = ptext (sLit "SPECIALIZE") <+> pp_inl <+> pprVarSig [var] pp_ty
where
where
pp_inl | isDefaultInlinePragma inl = empty
pp_inl | isDefaultInlinePragma inl = empty
...
...
compiler/hsSyn/HsPat.lhs
View file @
144db21e
...
@@ -232,7 +232,7 @@ pprPatBndr var -- Print with type info if -dppr-debug is on
...
@@ -232,7 +232,7 @@ pprPatBndr var -- Print with type info if -dppr-debug is on
parens (pprBndr LambdaBind var) -- Could pass the site to pprPat
parens (pprBndr LambdaBind var) -- Could pass the site to pprPat
-- but is it worth it?
-- but is it worth it?
else
else
ppr var
ppr
PrefixOcc
var
pprParendLPat :: (OutputableBndr name) => LPat name -> SDoc
pprParendLPat :: (OutputableBndr name) => LPat name -> SDoc
pprParendLPat (L _ p) = pprParendPat p
pprParendLPat (L _ p) = pprParendPat p
...
@@ -246,14 +246,14 @@ pprPat (VarPat var) = pprPatBndr var
...
@@ -246,14 +246,14 @@ pprPat (VarPat var) = pprPatBndr var
pprPat (WildPat _) = char '_'
pprPat (WildPat _) = char '_'
pprPat (LazyPat pat) = char '~' <> pprParendLPat pat
pprPat (LazyPat pat) = char '~' <> pprParendLPat pat
pprPat (BangPat pat) = char '!' <> pprParendLPat pat
pprPat (BangPat pat) = char '!' <> pprParendLPat pat
pprPat (AsPat name pat) = hcat [ppr
name
, char '@', pprParendLPat pat]
pprPat (AsPat name pat) = hcat [ppr
PrefixOcc (unLoc name)
, char '@', pprParendLPat pat]
pprPat (ViewPat expr pat _) = hcat [pprLExpr expr, text " -> ", ppr pat]
pprPat (ViewPat expr pat _) = hcat [pprLExpr expr, text " -> ", ppr pat]
pprPat (ParPat pat) = parens (ppr pat)
pprPat (ParPat pat) = parens (ppr pat)
pprPat (ListPat pats _ _) = brackets (interpp'SP pats)
pprPat (ListPat pats _ _) = brackets (interpp'SP pats)
pprPat (PArrPat pats _) = paBrackets (interpp'SP pats)
pprPat (PArrPat pats _) = paBrackets (interpp'SP pats)
pprPat (TuplePat pats bx _) = tupleParens (boxityNormalTupleSort bx) (interpp'SP pats)
pprPat (TuplePat pats bx _) = tupleParens (boxityNormalTupleSort bx) (interpp'SP pats)
pprPat (ConPatIn con details) = pprUserCon
con
details
pprPat (ConPatIn con details) = pprUserCon
(unLoc con)
details
pprPat (ConPatOut { pat_con = con, pat_tvs = tvs, pat_dicts = dicts,
pprPat (ConPatOut { pat_con = con, pat_tvs = tvs, pat_dicts = dicts,
pat_binds = binds, pat_args = details })
pat_binds = binds, pat_args = details })
= getPprStyle $ \ sty -> -- Tiresome; in TcBinds.tcRhs we print out a
= getPprStyle $ \ sty -> -- Tiresome; in TcBinds.tcRhs we print out a
...
@@ -262,7 +262,7 @@ pprPat (ConPatOut { pat_con = con, pat_tvs = tvs, pat_dicts = dicts,
...
@@ -262,7 +262,7 @@ pprPat (ConPatOut { pat_con = con, pat_tvs = tvs, pat_dicts = dicts,
ppr con <> braces (sep [ hsep (map pprPatBndr (tvs ++ dicts))
ppr con <> braces (sep [ hsep (map pprPatBndr (tvs ++ dicts))
, ppr binds])
, ppr binds])
<+> pprConArgs details
<+> pprConArgs details
else pprUserCon
con
details
else pprUserCon
(unLoc con)
details
pprPat (LitPat s) = ppr s
pprPat (LitPat s) = ppr s
pprPat (NPat l Nothing _) = ppr l
pprPat (NPat l Nothing _) = ppr l
...
@@ -273,9 +273,9 @@ pprPat (CoPat co pat _) = pprHsWrapper (ppr pat) co
...
@@ -273,9 +273,9 @@ pprPat (CoPat co pat _) = pprHsWrapper (ppr pat) co
pprPat (SigPatIn pat ty) = ppr pat <+> dcolon <+> ppr ty
pprPat (SigPatIn pat ty) = ppr pat <+> dcolon <+> ppr ty
pprPat (SigPatOut pat ty) = ppr pat <+> dcolon <+> ppr ty
pprPat (SigPatOut pat ty) = ppr pat <+> dcolon <+> ppr ty
pprUserCon :: (Outputable con, OutputableBndr id) => con -> HsConPatDetails id -> SDoc
pprUserCon :: (Outputable
Bndr
con, OutputableBndr id) => con -> HsConPatDetails id -> SDoc
pprUserCon c (InfixCon p1 p2) = ppr p1 <+> ppr c <+> ppr p2
pprUserCon c (InfixCon p1 p2) = ppr p1 <+> ppr
InfixOcc
c <+> ppr p2
pprUserCon c details = ppr c <+> pprConArgs details
pprUserCon c details = ppr
PrefixOcc
c <+> pprConArgs details
pprConArgs :: OutputableBndr id => HsConPatDetails id -> SDoc
pprConArgs :: OutputableBndr id => HsConPatDetails id -> SDoc
pprConArgs (PrefixCon pats) = sep (map pprParendLPat pats)
pprConArgs (PrefixCon pats) = sep (map pprParendLPat pats)
...
...
compiler/main/PprTyThing.hs
View file @
144db21e
...
@@ -228,7 +228,7 @@ pprDataConDecl pefas ss gadt_style dataCon
...
@@ -228,7 +228,7 @@ pprDataConDecl pefas ss gadt_style dataCon
user_ify
bang
=
bang
user_ify
bang
=
bang
maybe_show_label
(
lbl
,
bty
)
maybe_show_label
(
lbl
,
bty
)
|
showSub
ss
lbl
=
Just
(
ppr
lbl
<+>
dcolon
<+>
pprBangTy
bty
)
|
showSub
ss
lbl
=
Just
(
ppr
_bndr
lbl
<+>
dcolon
<+>
pprBangTy
bty
)
|
otherwise
=
Nothing
|
otherwise
=
Nothing
ppr_fields
[
ty1
,
ty2
]
ppr_fields
[
ty1
,
ty2
]
...
...
compiler/typecheck/TcErrors.lhs
View file @
144db21e
...
@@ -1164,7 +1164,7 @@ relevantBindings ctxt ct
...
@@ -1164,7 +1164,7 @@ relevantBindings ctxt ct
| otherwise
| otherwise
= do { (tidy_env', tidy_ty) <- zonkTidyTcType tidy_env (idType id)
= do { (tidy_env', tidy_ty) <- zonkTidyTcType tidy_env (idType id)
; let id_tvs = tyVarsOfType tidy_ty
; let id_tvs = tyVarsOfType tidy_ty
doc = sep [ ppr id <+> dcolon <+> ppr tidy_ty
doc = sep [ ppr
PrefixOcc
id <+> dcolon <+> ppr tidy_ty
, nest 2 (parens (ptext (sLit "bound at")
, nest 2 (parens (ptext (sLit "bound at")
<+> ppr (getSrcLoc id)))]
<+> ppr (getSrcLoc id)))]
; if id_tvs `intersectsVarSet` ct_tvs
; if id_tvs `intersectsVarSet` ct_tvs
...
...
compiler/typecheck/TcHsType.lhs
View file @
144db21e
...
@@ -1555,7 +1555,7 @@ pprHsSigCtxt ctxt hs_ty = sep [ ptext (sLit "In") <+> pprUserTypeCtxt ctxt <> co
...
@@ -1555,7 +1555,7 @@ pprHsSigCtxt ctxt hs_ty = sep [ ptext (sLit "In") <+> pprUserTypeCtxt ctxt <> co
pp_sig (ForSigCtxt n) = pp_n_colon n
pp_sig (ForSigCtxt n) = pp_n_colon n
pp_sig _ = ppr (unLoc hs_ty)
pp_sig _ = ppr (unLoc hs_ty)
pp_n_colon n = ppr n <+> dcolon <+> ppr (unLoc hs_ty)
pp_n_colon n = ppr
PrefixOcc
n <+> dcolon <+> ppr (unLoc hs_ty)
badPatSigTvs :: TcType -> [TyVar] -> SDoc
badPatSigTvs :: TcType -> [TyVar] -> SDoc
badPatSigTvs sig_ty bad_tvs
badPatSigTvs sig_ty bad_tvs
...
...
compiler/typecheck/TcRnTypes.lhs
View file @
144db21e
...
@@ -1480,7 +1480,7 @@ pprSkolInfo :: SkolemInfo -> SDoc
...
@@ -1480,7 +1480,7 @@ pprSkolInfo :: SkolemInfo -> SDoc
-- Complete the sentence "is a rigid type variable bound by..."
-- Complete the sentence "is a rigid type variable bound by..."
pprSkolInfo (SigSkol (FunSigCtxt f) ty)
pprSkolInfo (SigSkol (FunSigCtxt f) ty)
= hang (ptext (sLit "the type signature for"))
= hang (ptext (sLit "the type signature for"))
2 (ppr f <+> dcolon <+> ppr ty)
2 (ppr
PrefixOcc
f <+> dcolon <+> ppr ty)
pprSkolInfo (SigSkol cx ty) = hang (pprUserTypeCtxt cx <> colon)
pprSkolInfo (SigSkol cx ty) = hang (pprUserTypeCtxt cx <> colon)
2 (ppr ty)
2 (ppr ty)
pprSkolInfo (IPSkol ips) = ptext (sLit "the implicit-parameter bindings for")
pprSkolInfo (IPSkol ips) = ptext (sLit "the implicit-parameter bindings for")
...
...
compiler/typecheck/TcTyClsDecls.lhs
View file @
144db21e
...
@@ -1733,7 +1733,7 @@ dataConCtxt con = ptext (sLit "In the definition of data constructor") <+> quote
...
@@ -1733,7 +1733,7 @@ dataConCtxt con = ptext (sLit "In the definition of data constructor") <+> quote
classOpCtxt :: Var -> Type -> SDoc
classOpCtxt :: Var -> Type -> SDoc
classOpCtxt sel_id tau = sep [ptext (sLit "When checking the class method:"),
classOpCtxt sel_id tau = sep [ptext (sLit "When checking the class method:"),
nest 2 (ppr sel_id <+> dcolon <+> ppr tau)]
nest 2 (ppr
PrefixOcc
sel_id <+> dcolon <+> ppr tau)]
nullaryClassErr :: Class -> SDoc
nullaryClassErr :: Class -> SDoc
nullaryClassErr cls
nullaryClassErr cls
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment