[commit: ghc] wip/7.10-api-annots: ApiAnnotations : quoted type variables missing leading quote (d4596ef)

git at git.haskell.org git at git.haskell.org
Fri May 8 17:02:20 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/7.10-api-annots
Link       : http://ghc.haskell.org/trac/ghc/changeset/d4596efab84153d65f285c75f1e20f3556830ea2/ghc

>---------------------------------------------------------------

commit d4596efab84153d65f285c75f1e20f3556830ea2
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Wed May 6 08:07:39 2015 -0500

    ApiAnnotations : quoted type variables missing leading quote
    
    The HsOpTy can be constructed for a promoted type operator, in which case it has the following form
    
            | btype SIMPLEQUOTE qconop type     { sLL $1 $> $ mkHsOpTy $1 $3 $4 }
            | btype SIMPLEQUOTE varop  type     { sLL $1 $> $ mkHsOpTy $1 $3 $4 }
    
    The SIMPLEQUOTE does not get an annotation, so cannot be reproduced via the API Annotations.
    
    Also, in
    
    splice_exp :: { LHsExpr RdrName }
            : TH_ID_SPLICE          { sL1 $1 $ mkHsSpliceE
                                            (sL1 $1 $ HsVar (mkUnqual varName
                                                            (getTH_ID_SPLICE $1))) }
            | '$(' exp ')'          {% ams (sLL $1 $> $ mkHsSpliceE $2) [mo $1,mc $3] }
            | TH_ID_TY_SPLICE       { sL1 $1 $ mkHsSpliceTE
                                            (sL1 $1 $ HsVar (mkUnqual varName
                                                         (getTH_ID_TY_SPLICE $1))) }
            | '$$(' exp ')'         {% ams (sLL $1 $> $ mkHsSpliceTE $2) [mo $1,mc $3] }
    
    the TH_ID_SPLICE and TH_ID_TY_SPLICE positions are lost.
    
    Reviewed By: austin
    
    Differential Revision: https://phabricator.haskell.org/D825
    
    GHC Trac Issues: #10268
    
    (cherry picked from commit 15aafc7fb61d2cbf95f2a564762399e82fe44e9c)


>---------------------------------------------------------------

d4596efab84153d65f285c75f1e20f3556830ea2
 compiler/parser/ApiAnnotation.hs                   |  4 ++
 compiler/parser/Parser.y                           | 39 ++++++++-------
 testsuite/tests/ghc-api/annotations/.gitignore     |  1 +
 testsuite/tests/ghc-api/annotations/Makefile       |  7 +++
 testsuite/tests/ghc-api/annotations/T10268.stderr  | 10 ++++
 testsuite/tests/ghc-api/annotations/T10268.stdout  | 55 ++++++++++++++++++++++
 testsuite/tests/ghc-api/annotations/Test10268.hs   | 11 +++++
 testsuite/tests/ghc-api/annotations/all.T          |  1 +
 .../ghc-api/annotations/{t10255.hs => t10268.hs}   |  3 +-
 9 files changed, 114 insertions(+), 17 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc d4596efab84153d65f285c75f1e20f3556830ea2


More information about the ghc-commits mailing list