API Annotations documentation update, parsing issue, add example test
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 851ed721)
Showing
- compiler/basicTypes/BasicTypes.hs 15 additions, 15 deletionscompiler/basicTypes/BasicTypes.hs
- compiler/basicTypes/DataCon.hs 2 additions, 0 deletionscompiler/basicTypes/DataCon.hs
- compiler/basicTypes/RdrName.hs 2 additions, 0 deletionscompiler/basicTypes/RdrName.hs
- compiler/hsSyn/HsBinds.hs 28 additions, 0 deletionscompiler/hsSyn/HsBinds.hs
- compiler/hsSyn/HsDecls.hs 49 additions, 2 deletionscompiler/hsSyn/HsDecls.hs
- compiler/hsSyn/HsExpr.hs 90 additions, 0 deletionscompiler/hsSyn/HsExpr.hs
- compiler/hsSyn/HsImpExp.hs 15 additions, 2 deletionscompiler/hsSyn/HsImpExp.hs
- compiler/hsSyn/HsLit.hs 2 additions, 2 deletionscompiler/hsSyn/HsLit.hs
- compiler/hsSyn/HsPat.hs 24 additions, 0 deletionscompiler/hsSyn/HsPat.hs
- compiler/hsSyn/HsSyn.hs 8 additions, 3 deletionscompiler/hsSyn/HsSyn.hs
- compiler/hsSyn/HsTypes.hs 59 additions, 1 deletioncompiler/hsSyn/HsTypes.hs
- compiler/parser/ApiAnnotation.hs 11 additions, 5 deletionscompiler/parser/ApiAnnotation.hs
- compiler/parser/Lexer.x 7 additions, 7 deletionscompiler/parser/Lexer.x
- compiler/parser/Parser.y 4 additions, 1 deletioncompiler/parser/Parser.y
- compiler/prelude/ForeignCall.hs 2 additions, 0 deletionscompiler/prelude/ForeignCall.hs
- compiler/types/Class.hs 2 additions, 0 deletionscompiler/types/Class.hs
- testsuite/tests/ghc-api/annotations/.gitignore 1 addition, 0 deletionstestsuite/tests/ghc-api/annotations/.gitignore
- testsuite/tests/ghc-api/annotations/Makefile 5 additions, 1 deletiontestsuite/tests/ghc-api/annotations/Makefile
- testsuite/tests/ghc-api/annotations/all.T 1 addition, 0 deletionstestsuite/tests/ghc-api/annotations/all.T
- testsuite/tests/ghc-api/annotations/exampleTest.hs 112 additions, 0 deletionstestsuite/tests/ghc-api/annotations/exampleTest.hs
Loading
Please register or sign in to comment