Commit 399a5b46 authored by Matthew Pickering's avatar Matthew Pickering Committed by Ben Gamari

Remove deprecated quasiquoter syntax.

In spirit, this reverts 9ba922ee

The syntax has been deprecated with a warning since 2010.

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1530
parent 55c737fd
......@@ -383,10 +383,6 @@ $tab { warnTab }
"$(" / { ifExtension thEnabled } { token ITparenEscape }
"$$(" / { ifExtension thEnabled } { token ITparenTyEscape }
-- For backward compatibility, accept the old dollar syntax
"[$" @varid "|" / { ifExtension qqEnabled }
{ lex_quasiquote_tok }
"[" @varid "|" / { ifExtension qqEnabled }
{ lex_quasiquote_tok }
......
......@@ -46,7 +46,6 @@ import Var ( Id )
import THNames ( quoteExpName, quotePatName, quoteDecName, quoteTypeName
, decsQTyConName, expQTyConName, patQTyConName, typeQTyConName, )
import RnTypes ( collectWildCards )
import Util
import {-# SOURCE #-} TcExpr ( tcMonoExpr )
import {-# SOURCE #-} TcSplice ( runMetaD, runMetaE, runMetaP, runMetaT, tcTopSpliceExpr )
......@@ -373,17 +372,6 @@ rnSplice (HsQuasiQuote splice_name quoter q_loc quote)
; loc <- getSrcSpanM
; splice_name' <- newLocalBndrRn (L loc splice_name)
-- Drop the leading "$" from the quoter name, if present
-- This is old-style syntax, now deprecated
-- NB: when removing this backward-compat, remove
-- the matching code in Lexer.x (around line 310)
; let occ_str = occNameString (rdrNameOcc quoter)
; quoter <- if ASSERT( not (null occ_str) ) -- Lexer ensures this
head occ_str /= '$'
then return quoter
else do { addWarn (deprecatedDollar quoter)
; return (mkRdrUnqual (mkVarOcc (tail occ_str))) }
-- Rename the quoter; akin to the HsVar case of rnExpr
; quoter' <- lookupOccRn quoter
; this_mod <- getModule
......@@ -392,13 +380,6 @@ rnSplice (HsQuasiQuote splice_name quoter q_loc quote)
; return (HsQuasiQuote splice_name' quoter' q_loc quote, unitFV quoter') }
deprecatedDollar :: RdrName -> SDoc
deprecatedDollar quoter
= hang (ptext (sLit "Deprecated syntax:"))
2 (ptext (sLit "quasiquotes no longer need a dollar sign:")
<+> ppr quoter)
---------------------
rnSpliceExpr :: HsSplice RdrName -> RnM (HsExpr Name, FreeVars)
rnSpliceExpr splice
......
......@@ -6,7 +6,7 @@ import QQ
f :: [pq| foo |] -- Expands to Int -> Int
[pq| blah |] -- Expands to f x = x
h [pq| foo |] = f [$pq| blah |] * 8
h [pq| foo |] = f [pq| blah |] * 8
-- Expands to h (Just x) = f (x+1) * 8
......
Test.hs:9:19:
Warning: Deprecated syntax:
quasiquotes no longer need a dollar sign: $pq
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment