diff options
Diffstat (limited to 'compiler/rename/RnSource.hs')
-rw-r--r-- | compiler/rename/RnSource.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs index f6a300763f..1a6fa170be 100644 --- a/compiler/rename/RnSource.hs +++ b/compiler/rename/RnSource.hs @@ -13,7 +13,7 @@ module RnSource ( #include "HsVersions.h" import {-# SOURCE #-} RnExpr( rnLExpr ) -import {-# SOURCE #-} RnSplice ( rnSpliceDecl ) +import {-# SOURCE #-} RnSplice ( rnSpliceDecl, rnTopSpliceDecls ) import HsSyn import RdrName @@ -1510,6 +1510,13 @@ addl gp (L l d : ds) = add gp l d ds add :: HsGroup RdrName -> SrcSpan -> HsDecl RdrName -> [LHsDecl RdrName] -> RnM (HsGroup RdrName, Maybe (SpliceDecl RdrName, [LHsDecl RdrName])) +-- #10047: Declaration QuasiQuoters are expanded immediately, without +-- causing a group split +add gp _ (SpliceD (SpliceDecl (L _ qq@HsQuasiQuote{}) _)) ds + = do { (ds', _) <- rnTopSpliceDecls qq + ; addl gp (ds' ++ ds) + } + add gp loc (SpliceD splice@(SpliceDecl _ flag)) ds = do { -- We've found a top-level splice. If it is an *implicit* one -- (i.e. a naked top level expression) |