summaryrefslogtreecommitdiff
path: root/compiler/hsSyn/HsSyn.hs
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2015-01-19 08:15:18 -0600
committerAustin Seipp <aseipp@pobox.com>2015-01-23 07:18:04 -0600
commit5b7a79780b709f4a9d1c110bb786bae1031d1614 (patch)
tree77608fe69623b484118b7a67db2661511b84ab1c /compiler/hsSyn/HsSyn.hs
parent3a7a30d765d272f10b150c28dcc28726b513b091 (diff)
downloadhaskell-wip/api-annot-tweaks-7.10.tar.gz
API Annotations documentation update, parsing issue, add example testwip/api-annot-tweaks-7.10
Summary: Add a reference note to each AnnKeywordId haddock comment so GHC developers will have an idea why they are there. Add a new test to ghc-api/annotations to serve as a template for other GHC developers when they need to update the parser. It provides output which checks that each SrcSpan that an annotation is attached to actually appears in the `ParsedSource`, and lists the individual annotations. The idea is that a developer writes a version of this which parses a sample file using whatever syntax is changed in Parser.y, and can then check that all the annotations come through. Depends on D538 Test Plan: ./validate Reviewers: simonpj, hvr, austin Reviewed By: austin Subscribers: thomie, jstolarek Differential Revision: https://phabricator.haskell.org/D620 (cherry picked from commit 851ed7211fb18fea938be84c99b6389f6762b30d)
Diffstat (limited to 'compiler/hsSyn/HsSyn.hs')
-rw-r--r--compiler/hsSyn/HsSyn.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/hsSyn/HsSyn.hs b/compiler/hsSyn/HsSyn.hs
index e75939ea2f..72525b2519 100644
--- a/compiler/hsSyn/HsSyn.hs
+++ b/compiler/hsSyn/HsSyn.hs
@@ -73,7 +73,8 @@ data HsModule name
--
-- - 'ApiAnnotation.AnnKeywordId's : 'ApiAnnotation.AnnOpen'
-- ,'ApiAnnotation.AnnClose'
- --
+
+ -- For details on above see note [Api annotations] in ApiAnnotation
hsmodImports :: [LImportDecl name],
-- ^ We snaffle interesting stuff out of the imported interfaces early
-- on, adding that info to TyDecls/etc; so this list is often empty,
@@ -86,12 +87,15 @@ data HsModule name
-- - 'ApiAnnotation.AnnKeywordId's : 'ApiAnnotation.AnnOpen'
-- ,'ApiAnnotation.AnnClose'
--
+
+ -- For details on above see note [Api annotations] in ApiAnnotation
hsmodHaddockModHeader :: Maybe LHsDocString
-- ^ Haddock module info and description, unparsed
--
-- - 'ApiAnnotation.AnnKeywordId's : 'ApiAnnotation.AnnOpen'
-- ,'ApiAnnotation.AnnClose'
- --
+
+ -- For details on above see note [Api annotations] in ApiAnnotation
}
-- ^ 'ApiAnnotation.AnnKeywordId's
--
@@ -100,7 +104,8 @@ data HsModule name
-- - 'ApiAnnotation.AnnOpen','ApiAnnotation.AnnSemi',
-- 'ApiAnnotation.AnnClose' for explicit braces and semi around
-- hsmodImports,hsmodDecls if this style is used.
- --
+
+ -- For details on above see note [Api annotations] in ApiAnnotation
deriving (Typeable)
deriving instance (DataId name) => Data (HsModule name)