summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser.y
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Parser.y')
-rw-r--r--compiler/GHC/Parser.y9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y
index abfcc6fbff..bf3d4d0e75 100644
--- a/compiler/GHC/Parser.y
+++ b/compiler/GHC/Parser.y
@@ -3551,11 +3551,15 @@ varop :: { Located RdrName }
qop :: { forall b. DisambInfixOp b => PV (Located b) } -- used in sections
: qvarop { mkHsVarOpPV $1 }
| qconop { mkHsConOpPV $1 }
+ | SIMPLEQUOTE qvarop { reportSimplequoteOp (comb2 $1 $>) }
+ | SIMPLEQUOTE qconop { reportSimplequoteOp (comb2 $1 $>) }
| hole_op { $1 }
qopm :: { forall b. DisambInfixOp b => PV (Located b) } -- used in sections
: qvaropm { mkHsVarOpPV $1 }
| qconop { mkHsConOpPV $1 }
+ | SIMPLEQUOTE qvaropm { reportSimplequoteOp (comb2 $1 $>) }
+ | SIMPLEQUOTE qconop { reportSimplequoteOp (comb2 $1 $>) }
| hole_op { $1 }
hole_op :: { forall b. DisambInfixOp b => PV (Located b) } -- used in sections
@@ -4000,6 +4004,11 @@ reportEmptyDoubleQuotes span = do
, text "Character literals may not be empty"
]
+reportSimplequoteOp :: MonadP m => SrcSpan -> m a
+reportSimplequoteOp span =
+ addFatalError span $
+ text "Illegal operator promotion syntax at the term-level"
+
{-
%************************************************************************
%* *