summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/Lexer.x4
-rw-r--r--compiler/parser/Parser.y6
-rw-r--r--compiler/parser/RdrHsSyn.hs16
3 files changed, 13 insertions, 13 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x
index ac6571c385..7067fe0c6d 100644
--- a/compiler/parser/Lexer.x
+++ b/compiler/parser/Lexer.x
@@ -2272,8 +2272,8 @@ srcParseErr
-> MsgDoc
srcParseErr dflags buf len
= if null token
- then ptext (sLit "parse error (possibly incorrect indentation or mismatched brackets)")
- else ptext (sLit "parse error on input") <+> quotes (text token)
+ then text "parse error (possibly incorrect indentation or mismatched brackets)"
+ else text "parse error on input" <+> quotes (text token)
$$ ppWhen (not th_enabled && token == "$") -- #7396
(text "Perhaps you intended to use TemplateHaskell")
$$ ppWhen (token == "<-")
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index 5f6f12cabe..152421734c 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -2940,9 +2940,9 @@ tyvarop : '`' tyvarid '`' {% ams (sLL $1 $> (unLoc $2))
[mj AnnBackquote $1,mj AnnVal $2
,mj AnnBackquote $3] }
| '.' {% parseErrorSDoc (getLoc $1)
- (vcat [ptext (sLit "Illegal symbol '.' in type"),
- ptext (sLit "Perhaps you intended to use RankNTypes or a similar language"),
- ptext (sLit "extension to enable explicit-forall syntax: forall <tvs>. <type>")])
+ (vcat [text "Illegal symbol '.' in type",
+ text "Perhaps you intended to use RankNTypes or a similar language",
+ text "extension to enable explicit-forall syntax: forall <tvs>. <type>"])
}
tyvarid :: { Located RdrName }
diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs
index 74a18f14e9..d9cb2f7a7e 100644
--- a/compiler/parser/RdrHsSyn.hs
+++ b/compiler/parser/RdrHsSyn.hs
@@ -137,7 +137,7 @@ mkClassDecl loc (L _ (mcxt, tycl_hdr)) fds where_cls
; let cxt = fromMaybe (noLoc []) mcxt
; (cls, tparams,ann) <- checkTyClHdr True tycl_hdr
; mapM_ (\a -> a loc) ann -- Add any API Annotations to the top SrcSpan
- ; tyvars <- checkTyVarsP (ptext (sLit "class")) whereDots cls tparams
+ ; tyvars <- checkTyVarsP (text "class") whereDots cls tparams
; at_defs <- mapM (eitherToP . mkATDefault) at_insts
; return (L loc (ClassDecl { tcdCtxt = cxt, tcdLName = cls, tcdTyVars = tyvars
, tcdFDs = snd (unLoc fds)
@@ -156,7 +156,7 @@ mkATDefault :: LTyFamInstDecl RdrName
-- from Convert.hs
mkATDefault (L loc (TyFamInstDecl { tfid_eqn = L _ e }))
| TyFamEqn { tfe_tycon = tc, tfe_pats = pats, tfe_rhs = rhs } <- e
- = do { tvs <- checkTyVars (ptext (sLit "default")) equalsDots tc (hsib_body pats)
+ = do { tvs <- checkTyVars (text "default") equalsDots tc (hsib_body pats)
; return (L loc (TyFamEqn { tfe_tycon = tc
, tfe_pats = tvs
, tfe_rhs = rhs })) }
@@ -202,7 +202,7 @@ mkTySynonym :: SrcSpan
mkTySynonym loc lhs rhs
= do { (tc, tparams,ann) <- checkTyClHdr False lhs
; mapM_ (\a -> a loc) ann -- Add any API Annotations to the top SrcSpan
- ; tyvars <- checkTyVarsP (ptext (sLit "type")) equalsDots tc tparams
+ ; tyvars <- checkTyVarsP (text "type") equalsDots tc tparams
; return (L loc (SynDecl { tcdLName = tc, tcdTyVars = tyvars
, tcdRhs = rhs, tcdFVs = placeHolderNames })) }
@@ -659,17 +659,17 @@ checkTyVars pp_what equals_or_where tc tparms
| isRdrTyVar tv = return (L l (UserTyVar (L ltv tv)))
chk t@(L loc _)
= Left (loc,
- vcat [ ptext (sLit "Unexpected type") <+> quotes (ppr t)
- , ptext (sLit "In the") <+> pp_what <+> ptext (sLit "declaration for") <+> quotes (ppr tc)
- , vcat[ (ptext (sLit "A") <+> pp_what <+> ptext (sLit "declaration should have form"))
+ vcat [ text "Unexpected type" <+> quotes (ppr t)
+ , text "In the" <+> pp_what <+> ptext (sLit "declaration for") <+> quotes (ppr tc)
+ , vcat[ (text "A" <+> pp_what <+> ptext (sLit "declaration should have form"))
, nest 2 (pp_what <+> ppr tc
<+> hsep (map text (takeList tparms allNameStrings))
<+> equals_or_where) ] ])
whereDots, equalsDots :: SDoc
-- Second argument to checkTyVars
-whereDots = ptext (sLit "where ...")
-equalsDots = ptext (sLit "= ...")
+whereDots = text "where ..."
+equalsDots = text "= ..."
checkDatatypeContext :: Maybe (LHsContext RdrName) -> P ()
checkDatatypeContext Nothing = return ()