diff options
author | Shayne Fletcher <shayne@shaynefletcher.org> | 2021-05-15 21:15:41 +1000 |
---|---|---|
committer | Shayne Fletcher <shayne@shaynefletcher.org> | 2021-05-17 05:42:54 +1000 |
commit | cacd03042b984b2c0ef55f5ac2d4220f5b21797d (patch) | |
tree | 2fde1f3260359bb1e4a6352780f714e01f68eef0 /compiler/GHC/Parser | |
parent | fc9546caf3e16db070bfc7bb5523c38595233e26 (diff) | |
download | haskell-wip/T19848.tar.gz |
Changes to HsRecField'wip/T19848
Diffstat (limited to 'compiler/GHC/Parser')
-rw-r--r-- | compiler/GHC/Parser/PostProcess.hs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs index beeaeb9d9e..661e05e3da 100644 --- a/compiler/GHC/Parser/PostProcess.hs +++ b/compiler/GHC/Parser/PostProcess.hs @@ -1160,8 +1160,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 @@ -2413,7 +2413,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 @@ -2431,7 +2431,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? @@ -2456,8 +2456,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 @@ -2974,9 +2974,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 } |