diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2023-04-26 18:44:24 +0100 |
---|---|---|
committer | Alan Zimmerman <alan.zimm@gmail.com> | 2023-04-26 23:28:24 +0100 |
commit | a13e2b7f192edbac6e28074a323b7dd84b3fc9f6 (patch) | |
tree | 568c5f558a937668e42f0b8155c440ca0952b60d /compiler/GHC/Rename/Expr.hs | |
parent | 79bea00eef99495ac19bb59505fd0d701b2de439 (diff) | |
download | haskell-a13e2b7f192edbac6e28074a323b7dd84b3fc9f6.tar.gz |
Put BufSpan into RealSrcSpanwip/az/locateda-epa-improve-2023-03-27
This has been superseded by !9473, which moved BufSpan into EpaSpan in
EpaLocation
Start on making LocatedN more direct
Using EpaLocation instead of Anchor
Via a synonym initially, to prove the concept
Variants of AnnSortKey
For future, just a list of which type comes next.
Example for ValBinds
EPA: Explicitly capture EOF Location in AnnsModule
And also get rid of EpaEofComment.
Diffstat (limited to 'compiler/GHC/Rename/Expr.hs')
-rw-r--r-- | compiler/GHC/Rename/Expr.hs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/compiler/GHC/Rename/Expr.hs b/compiler/GHC/Rename/Expr.hs index b68ff6a492..9bf95751f3 100644 --- a/compiler/GHC/Rename/Expr.hs +++ b/compiler/GHC/Rename/Expr.hs @@ -244,7 +244,7 @@ finishHsVar (L l name) = do { this_mod <- getModule ; when (nameIsLocalOrFrom this_mod name) $ checkThLocalName name - ; return (HsVar noExtField (L (la2na l) name), unitFV name) } + ; return (HsVar noExtField (L (l2l l) name), unitFV name) } rnUnboundVar :: RdrName -> RnM (HsExpr GhcRn, FreeVars) rnUnboundVar v = do @@ -278,7 +278,7 @@ rnExpr (HsVar _ (L l v)) -> rnExpr (ExplicitList noAnn []) | otherwise - -> finishHsVar (L (na2la l) $ greName gre) + -> finishHsVar (L (l2l l) $ greName gre) }}} rnExpr (HsIPVar x v) @@ -477,7 +477,7 @@ rnExpr (RecordCon { rcon_con = con_id , rcon_con = con_lname, rcon_flds = rec_binds' } , fvs `plusFV` plusFVs fvss `addOneFV` con_name) } where - mk_hs_var l n = HsVar noExtField (L (noAnnSrcSpan l) n) + mk_hs_var l n = HsVar noExtField (L (noAnnSrcSpanN l) n) rn_field (L l fld) = do { (arg', fvs) <- rnLExpr (hfbRHS fld) ; return (L l (fld { hfbRHS = arg' }), fvs) } @@ -966,7 +966,7 @@ methodNamesGRHSs (GRHSs _ grhss _) = plusFVs (map methodNamesGRHS grhss) ------------------------------------------------- -methodNamesGRHS :: LocatedAn NoEpAnns (GRHS GhcRn (LHsCmd GhcRn)) -> CmdNeeds +methodNamesGRHS :: LocatedAnS NoEpAnns (GRHS GhcRn (LHsCmd GhcRn)) -> CmdNeeds methodNamesGRHS (L _ (GRHS _ _ rhs)) = methodNamesLCmd rhs --------------------------------------------------- @@ -1118,7 +1118,7 @@ rnStmtsWithFreeVars ctxt _ [] thing_inside rnStmtsWithFreeVars mDoExpr@(HsDoStmt MDoExpr{}) rnBody (nonEmpty -> Just stmts) thing_inside -- Deal with mdo = -- Behave like do { rec { ...all but last... }; last } do { ((stmts1, (stmts2, thing)), fvs) - <- rnStmt mDoExpr rnBody (noLocA $ mkRecStmt noAnn (noLocA (NE.init stmts))) $ \ _ -> + <- rnStmt mDoExpr rnBody (noLocA $ mkRecStmt noAnn (noLocI (NE.init stmts))) $ \ _ -> do { last_stmt' <- checkLastStmt mDoExpr (NE.last stmts) ; rnStmt mDoExpr rnBody last_stmt' thing_inside } ; return (((stmts1 ++ stmts2), thing), fvs) } @@ -1360,12 +1360,12 @@ lookupStmtNamePoly ctxt name = do { rebindable_on <- xoptM LangExt.RebindableSyntax ; if rebindable_on then do { fm <- lookupOccRn (nameRdrName name) - ; return (HsVar noExtField (noLocA fm), unitFV fm) } + ; return (HsVar noExtField (noLocN fm), unitFV fm) } else not_rebindable } | otherwise = not_rebindable where - not_rebindable = return (HsVar noExtField (noLocA name), emptyFVs) + not_rebindable = return (HsVar noExtField (noLocN name), emptyFVs) -- | Is this a context where we respect RebindableSyntax? -- but ListComp are never rebindable @@ -1624,7 +1624,7 @@ segmentRecStmts loc ctxt empty_rec_stmt segs (fvs_later, might_be_more_fvs_later | otherwise = ([ L (noAnnSrcSpan loc) $ - empty_rec_stmt { recS_stmts = noLocA ss + empty_rec_stmt { recS_stmts = noLocI ss , recS_later_ids = nameSetElemsStable final_fvs_later , recS_rec_ids = nameSetElemsStable (defs `intersectNameSet` uses) }] @@ -1787,7 +1787,7 @@ segsToStmts empty_rec_stmt ((defs, uses, fwds, ss) : segs) fvs_later (later_stmts, later_uses) = segsToStmts empty_rec_stmt segs fvs_later new_stmt | non_rec = head ss | otherwise = L (getLoc (head ss)) rec_stmt - rec_stmt = empty_rec_stmt { recS_stmts = noLocA ss + rec_stmt = empty_rec_stmt { recS_stmts = noLocI ss , recS_later_ids = nameSetElemsStable used_later , recS_rec_ids = nameSetElemsStable fwds } -- See Note [Deterministic ApplicativeDo and RecursiveDo desugaring] @@ -2695,7 +2695,7 @@ getMonadFailOp ctxt nlHsApp (noLocA failExpr) (nlHsApp (noLocA $ fromStringExpr) arg_syn_expr) let failAfterFromStringExpr :: HsExpr GhcRn = - unLoc $ mkHsLam [noLocA $ VarPat noExtField $ noLocA arg_name] body + unLoc $ mkHsLam [noLocA $ VarPat noExtField $ noLocN arg_name] body let failAfterFromStringSynExpr :: SyntaxExpr GhcRn = mkSyntaxExpr failAfterFromStringExpr return (failAfterFromStringSynExpr, failFvs `plusFV` fromStringFvs) |