summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser/PostProcess.hs
diff options
context:
space:
mode:
authorShayne Fletcher <shayne@shaynefletcher.org>2021-05-15 21:15:41 +1000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-19 23:40:12 -0400
commitd48b7e5c2fae5db1973a767be45aba82b2aa727c (patch)
treeb0af0b799854da5e4b9efbe29a24e02d4db71641 /compiler/GHC/Parser/PostProcess.hs
parentdf4a0a53691cd833f54eb443401243dd9c964196 (diff)
downloadhaskell-d48b7e5c2fae5db1973a767be45aba82b2aa727c.tar.gz
Changes to HsRecField'
Diffstat (limited to 'compiler/GHC/Parser/PostProcess.hs')
-rw-r--r--compiler/GHC/Parser/PostProcess.hs22
1 files changed, 11 insertions, 11 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs
index c6ad4db6d1..2eba1fa9e2 100644
--- a/compiler/GHC/Parser/PostProcess.hs
+++ b/compiler/GHC/Parser/PostProcess.hs
@@ -1158,8 +1158,8 @@ pun_RDR = mkUnqual varName (fsLit "pun-right-hand-side")
checkPatField :: LHsRecField GhcPs (LocatedA (PatBuilder GhcPs))
-> PV (LHsRecField GhcPs (LPat GhcPs))
-checkPatField (L l fld) = do p <- checkLPat (hsRecFieldArg fld)
- return (L l (fld { hsRecFieldArg = p }))
+checkPatField (L l fld) = do p <- checkLPat (hfbRHS fld)
+ return (L l (fld { hfbRHS = p }))
patFail :: SrcSpan -> SDoc -> PV a
patFail loc e = addFatalError $ PsError (PsErrParseErrorInPat e) [] loc
@@ -2411,7 +2411,7 @@ mkRdrRecordUpd overloaded_on exp@(L loc _) fbinds anns = do
, rupd_flds = Left fs' }
True -> do
let qualifiedFields =
- [ L l lbl | L _ (HsRecField _ (L l lbl) _ _) <- fs'
+ [ L l lbl | L _ (HsFieldBind _ (L l lbl) _ _) <- fs'
, isQual . rdrNameAmbiguousFieldOcc $ lbl
]
if not $ null qualifiedFields
@@ -2429,7 +2429,7 @@ mkRdrRecordUpd overloaded_on exp@(L loc _) fbinds anns = do
-- Convert a top-level field update like {foo=2} or {bar} (punned)
-- to a projection update.
recFieldToProjUpdate :: LHsRecField GhcPs (LHsExpr GhcPs) -> LHsRecUpdProj GhcPs
- recFieldToProjUpdate (L l (HsRecField anns (L _ (FieldOcc _ (L loc rdr))) arg pun)) =
+ recFieldToProjUpdate (L l (HsFieldBind anns (L _ (FieldOcc _ (L loc rdr))) arg pun)) =
-- The idea here is to convert the label to a singleton [FastString].
let f = occNameFS . rdrNameOcc $ rdr
fl = HsFieldLabel noAnn (L lf f) -- AZ: what about the ann?
@@ -2454,8 +2454,8 @@ mk_rec_fields fs (Just s) = HsRecFields { rec_flds = fs
, rec_dotdot = Just (L s (length fs)) }
mk_rec_upd_field :: HsRecField GhcPs (LHsExpr GhcPs) -> HsRecUpdField GhcPs
-mk_rec_upd_field (HsRecField noAnn (L loc (FieldOcc _ rdr)) arg pun)
- = HsRecField noAnn (L loc (Unambiguous noExtField rdr)) arg pun
+mk_rec_upd_field (HsFieldBind noAnn (L loc (FieldOcc _ rdr)) arg pun)
+ = HsFieldBind noAnn (L loc (Unambiguous noExtField rdr)) arg pun
mkInlinePragma :: SourceText -> (InlineSpec, RuleMatchInfo) -> Maybe Activation
-> InlinePragma
@@ -2972,9 +2972,9 @@ mkRdrProjUpdate :: SrcSpanAnnA -> Located [Located (HsFieldLabel GhcPs)]
-> LHsRecProj GhcPs (LHsExpr GhcPs)
mkRdrProjUpdate _ (L _ []) _ _ _ = panic "mkRdrProjUpdate: The impossible has happened!"
mkRdrProjUpdate loc (L l flds) arg isPun anns =
- L loc HsRecField {
- hsRecFieldAnn = anns
- , hsRecFieldLbl = L l (FieldLabelStrings flds)
- , hsRecFieldArg = arg
- , hsRecPun = isPun
+ L loc HsFieldBind {
+ hfbAnn = anns
+ , hfbLHS = L l (FieldLabelStrings flds)
+ , hfbRHS = arg
+ , hfbPun = isPun
}