parser: API Annotations : guardquals1 does not annotate commas properly
authorAlan Zimmerman <alan.zimm@gmail.com>
Tue, 14 Apr 2015 06:17:48 +0000 (01:17 -0500)
committerAustin Seipp <austin@well-typed.com>
Tue, 14 Apr 2015 06:19:55 +0000 (01:19 -0500)
commit9eab6feed44ad8beb6703d2e27ce47a8f79d0f49
tree38e392a5015a051dba69d974b2b5bd0f1374257e
parent8aefc9b746512e91891879ad546e850e8a427d23
parser: API Annotations : guardquals1 does not annotate commas properly

The `guardquals1` production includes

   : guardquals1 ',' qual  {% addAnnotation (gl $ last $ unLoc $1) AnnComma
                                             (gl $2) >>
                               return (sLL $1 $> ($3 : unLoc $1)) }

The AnnComma should be attached to `(gl $ head $ unLoc $1)`, rather than
`last`.

Reviewed By: austin

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

GHC Trac Issues: #10256
compiler/parser/Parser.y
testsuite/tests/ghc-api/annotations/AnnotationTuple.hs
testsuite/tests/ghc-api/annotations/exampleTest.stdout
testsuite/tests/ghc-api/annotations/parseTree.stdout