diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2020-09-29 22:00:50 +0300 |
---|---|---|
committer | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2020-09-29 22:09:22 +0300 |
commit | ef449d9e1e5d4016ae036813a190e752242bab30 (patch) | |
tree | 4c9e816af579678db653ddc20bde62c53d912019 | |
parent | 4365d77a0b306ada61654c3648b844cfa0f4fdcf (diff) | |
download | haskell-wip/simplequote-infix-op.tar.gz |
SIMPLEQUOTE in qop/qopmwip/simplequote-infix-op
-rw-r--r-- | compiler/GHC/Parser.y | 9 |
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" + {- %************************************************************************ %* * |