summaryrefslogtreecommitdiff
path: root/compiler/parser
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2017-01-08 07:52:53 +0300
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2017-01-08 07:53:06 +0300
commit6c869f906b879bc746ea1aa3e79e02f146d85093 (patch)
treeafbb8f916c28cbeced7e3c29dcf1e44a8c47096c /compiler/parser
parent7b317effd59f56bc8450ea8efbb1ef5954f09e5d (diff)
downloadhaskell-6c869f906b879bc746ea1aa3e79e02f146d85093.tar.gz
Parse holes as infix operators
Reported as #13050. Since holes are expressions but not identifiers, holes were not allowed in infix operator position. This patch introduces a new production in infix operator parser to allow this. Reviewers: simonpj, austin, bgamari Reviewed By: simonpj Subscribers: simonpj, RyanGlScott, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D2910 GHC Trac Issues: #13050
Diffstat (limited to 'compiler/parser')
-rw-r--r--compiler/parser/Parser.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y
index 3fc20a154f..dfb67550b5 100644
--- a/compiler/parser/Parser.y
+++ b/compiler/parser/Parser.y
@@ -3132,6 +3132,9 @@ varop :: { Located RdrName }
qop :: { LHsExpr RdrName } -- used in sections
: qvarop { sL1 $1 $ HsVar $1 }
| qconop { sL1 $1 $ HsVar $1 }
+ | '`' '_' '`' {% ams (sLL $1 $> EWildPat)
+ [mj AnnBackquote $1,mj AnnVal $2
+ ,mj AnnBackquote $3] }
qopm :: { LHsExpr RdrName } -- used in sections
: qvaropm { sL1 $1 $ HsVar $1 }