ApiAnnotations : pquals production adds AnnVbar in the wrong place
authorAlan Zimmerman <alan.zimm@gmail.com>
Mon, 11 May 2015 13:28:55 +0000 (15:28 +0200)
committerAlan Zimmerman <alan.zimm@gmail.com>
Mon, 11 May 2015 13:28:55 +0000 (15:28 +0200)
commitfe38195eb783fc2f2f2d5ef50fb665b06fd15e82
tree6881106397d6930ff4af336db7949a12f7435787
parentf35d621de401bea74d42b28ff9a1d8c5d963a92d
ApiAnnotations : pquals production adds AnnVbar in the wrong place

Summary:
The Parser.y production for pquals is

    pquals :: { Located [[LStmt RdrName (LHsExpr RdrName)]] }
        : squals '|' pquals
                         {% addAnnotation (gl $ last $ unLoc $1) AnnVbar (gl $2) >>
                            return (sLL $1 $> (reverse (unLoc $1) : unLoc $3)) }
        | squals         { L (getLoc $1) [reverse (unLoc $1)] }

The squals are returned in reverse order, so the AnnVbar should be
attached to the head of the list, not the last.

Test Plan: ./validate

Reviewers: hvr, austin

Reviewed By: austin

Subscribers: thomie, mpickering

Differential Revision: https://phabricator.haskell.org/D869

GHC Trac Issues: #10357
compiler/parser/Parser.y
testsuite/tests/ghc-api/annotations/.gitignore
testsuite/tests/ghc-api/annotations/Makefile
testsuite/tests/ghc-api/annotations/T10357.stderr [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/T10357.stdout [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/Test10357.hs [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/all.T
testsuite/tests/ghc-api/annotations/t10357.hs [new file with mode: 0644]