[commit: ghc] master: ApiAnnotations : quoted type variables missing leading quote (15aafc7)

git at git.haskell.org git at git.haskell.org
Wed May 6 13:09:36 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/15aafc7fb61d2cbf95f2a564762399e82fe44e9c/ghc

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

commit 15aafc7fb61d2cbf95f2a564762399e82fe44e9c
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


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

15aafc7fb61d2cbf95f2a564762399e82fe44e9c
 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 15aafc7fb61d2cbf95f2a564762399e82fe44e9c


More information about the ghc-commits mailing list