summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2015-05-11 15:28:55 +0200
committerAlan Zimmerman <alan.zimm@gmail.com>2015-05-11 15:28:55 +0200
commitfe38195eb783fc2f2f2d5ef50fb665b06fd15e82 (patch)
tree6881106397d6930ff4af336db7949a12f7435787 /compiler/parser
parentf35d621de401bea74d42b28ff9a1d8c5d963a92d (diff)
downloadhaskell-fe38195eb783fc2f2f2d5ef50fb665b06fd15e82.tar.gz
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
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/Parser.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index 5137e773e6..51b20a0a05 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -2470,7 +2470,7 @@ flattenedpquals :: { Located [LStmt RdrName (LHsExpr RdrName)] }
pquals :: { Located [[LStmt RdrName (LHsExpr RdrName)]] }
: squals '|' pquals
- {% addAnnotation (gl $ last $ unLoc $1) AnnVbar (gl $2) >>
+ {% addAnnotation (gl $ head $ unLoc $1) AnnVbar (gl $2) >>
return (sLL $1 $> (reverse (unLoc $1) : unLoc $3)) }
| squals { L (getLoc $1) [reverse (unLoc $1)] }