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/deSugar/Check.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/deSugar/Check.lhs')
-rw-r--r-- | compiler/deSugar/Check.lhs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/deSugar/Check.lhs b/compiler/deSugar/Check.lhs index 3e6912f20e..52d81ed6ed 100644 --- a/compiler/deSugar/Check.lhs +++ b/compiler/deSugar/Check.lhs @@ -166,8 +166,9 @@ untidy_con :: HsConPatDetails Name -> HsConPatDetails Name untidy_con (PrefixCon pats) = PrefixCon (map untidy_pars pats) untidy_con (InfixCon p1 p2) = InfixCon (untidy_pars p1) (untidy_pars p2) untidy_con (RecCon (HsRecFields flds dd)) - = RecCon (HsRecFields [ fld { hsRecFieldArg = untidy_pars (hsRecFieldArg fld) } - | fld <- flds ] dd) + = RecCon (HsRecFields [ L l (fld { hsRecFieldArg + = untidy_pars (hsRecFieldArg fld) }) + | L l fld <- flds ] dd) pars :: NeedPars -> WarningPat -> Pat Name pars True p = ParPat p @@ -765,7 +766,8 @@ tidy_con con (RecCon (HsRecFields fs _)) field_pats = case con of RealDataCon dc -> map (\ f -> (f, nlWildPatId)) (dataConFieldLabels dc) PatSynCon{} -> panic "Check.tidy_con: pattern synonym with record syntax" - all_pats = foldr (\(HsRecField id p _) acc -> insertNm (getName (unLoc id)) p acc) + all_pats = foldr (\(L _ (HsRecField id p _)) acc + -> insertNm (getName (unLoc id)) p acc) field_pats fs insertNm nm p [] = [(nm,p)] |