diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2014-11-21 11:20:06 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-11-21 11:26:10 -0600 |
commit | 7927658ed1dcf557c7dd78e4b9844100521391c8 (patch) | |
tree | 16a5978453233ba0889af5fa3e59a60b42bc0bfc /compiler/rename/RnExpr.lhs | |
parent | cfa574cea30b411080de5d641309bdf135ed9be5 (diff) | |
download | haskell-7927658ed1dcf557c7dd78e4b9844100521391c8.tar.gz |
AST changes to prepare for API annotations, for #9628
Summary:
AST changes to prepare for API annotations
Add locations to parts of the AST so that API annotations can
then be added.
The outline of the whole process is captured here
https://ghc.haskell.org/trac/ghc/wiki/GhcAstAnnotations
This change updates the haddock submodule.
Test Plan: sh ./validate
Reviewers: austin, simonpj, Mikolaj
Reviewed By: simonpj, Mikolaj
Subscribers: thomie, goldfire, carter
Differential Revision: https://phabricator.haskell.org/D426
GHC Trac Issues: #9628
Diffstat (limited to 'compiler/rename/RnExpr.lhs')
-rw-r--r-- | compiler/rename/RnExpr.lhs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/rename/RnExpr.lhs b/compiler/rename/RnExpr.lhs index b24956c85e..98b1358594 100644 --- a/compiler/rename/RnExpr.lhs +++ b/compiler/rename/RnExpr.lhs @@ -241,8 +241,10 @@ rnExpr (ExplicitTuple tup_args boxity) ; (tup_args', fvs) <- mapAndUnzipM rnTupArg tup_args ; return (ExplicitTuple tup_args' boxity, plusFVs fvs) } where - rnTupArg (Present e) = do { (e',fvs) <- rnLExpr e; return (Present e', fvs) } - rnTupArg (Missing _) = return (Missing placeHolderType, emptyFVs) + rnTupArg (L l (Present e)) = do { (e',fvs) <- rnLExpr e + ; return (L l (Present e'), fvs) } + rnTupArg (L l (Missing _)) = return (L l (Missing placeHolderType) + , emptyFVs) rnExpr (RecordCon con_id _ rbinds) = do { conname <- lookupLocatedOccRn con_id @@ -372,8 +374,8 @@ rnHsRecBinds ctxt rec_binds@(HsRecFields { rec_dotdot = dd }) ; return (HsRecFields { rec_flds = flds', rec_dotdot = dd }, fvs `plusFV` plusFVs fvss) } where - rn_field fld = do { (arg', fvs) <- rnLExpr (hsRecFieldArg fld) - ; return (fld { hsRecFieldArg = arg' }, fvs) } + rn_field (L l fld) = do { (arg', fvs) <- rnLExpr (hsRecFieldArg fld) + ; return (L l (fld { hsRecFieldArg = arg' }), fvs) } \end{code} @@ -1288,7 +1290,7 @@ okPArrStmt dflags _ stmt LastStmt {} -> emptyInvalid -- Should not happen (dealt with by checkLastStmt) --------- -checkTupleSection :: [HsTupArg RdrName] -> RnM () +checkTupleSection :: [LHsTupArg RdrName] -> RnM () checkTupleSection args = do { tuple_section <- xoptM Opt_TupleSections ; checkErr (all tupArgPresent args || tuple_section) msg } |