summaryrefslogtreecommitdiff
path: root/compiler/rename
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2016-12-19 19:09:18 +0000
committerTamar Christina <tamar@zhox.com>2016-12-19 19:09:18 +0000
commitf1dfce1cb2a823696d6d3a9ea41c2bc73d949f12 (patch)
treeb14692ca8e33e8f925a1fa47542eb3499fc79f0e /compiler/rename
parentbb74bc79daf8b91b21a1b68b0a406828d188ed92 (diff)
downloadhaskell-f1dfce1cb2a823696d6d3a9ea41c2bc73d949f12.tar.gz
Revert "Allow use of the external interpreter in stage1."
This reverts commit 52ba9470a7e85d025dc84a6789aa809cdd68b566.
Diffstat (limited to 'compiler/rename')
-rw-r--r--compiler/rename/RnEnv.hs4
-rw-r--r--compiler/rename/RnSplice.hs22
2 files changed, 26 insertions, 0 deletions
diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs
index 97718f88d2..f8969a8e13 100644
--- a/compiler/rename/RnEnv.hs
+++ b/compiler/rename/RnEnv.hs
@@ -341,12 +341,16 @@ lookupExactOcc_either name
; if name `inLocalRdrEnvScope` lcl_env
then return (Right name)
else
+#ifdef GHCI
do { th_topnames_var <- fmap tcg_th_topnames getGblEnv
; th_topnames <- readTcRef th_topnames_var
; if name `elemNameSet` th_topnames
then return (Right name)
else return (Left exact_nm_err)
}
+#else /* !GHCI */
+ return (Left exact_nm_err)
+#endif /* !GHCI */
}
gres -> return (Left (sameNameErr gres)) -- Ugh! See Note [Template Haskell ambiguity]
}
diff --git a/compiler/rename/RnSplice.hs b/compiler/rename/RnSplice.hs
index ccfd00257b..0c41ed30b6 100644
--- a/compiler/rename/RnSplice.hs
+++ b/compiler/rename/RnSplice.hs
@@ -5,7 +5,9 @@ module RnSplice (
rnSpliceType, rnSpliceExpr, rnSplicePat, rnSpliceDecl,
rnBracket,
checkThLocalName
+#ifdef GHCI
, traceSplice, SpliceInfo(..)
+#endif
) where
#include "HsVersions.h"
@@ -33,6 +35,7 @@ import {-# SOURCE #-} RnExpr ( rnLExpr )
import TcEnv ( checkWellStaged )
import THNames ( liftName )
+#ifdef GHCI
import DynFlags
import FastString
import ErrUtils ( dumpIfSet_dyn_printer )
@@ -54,6 +57,7 @@ import {-# SOURCE #-} TcSplice
import GHCi.RemoteTypes ( ForeignRef )
import qualified Language.Haskell.TH as TH (Q)
+#endif
import qualified GHC.LanguageExtensions as LangExt
@@ -197,6 +201,23 @@ quotedNameStageErr br
= sep [ text "Stage error: the non-top-level quoted name" <+> ppr br
, text "must be used at the same stage at which is is bound" ]
+#ifndef GHCI
+rnTopSpliceDecls :: HsSplice RdrName -> RnM ([LHsDecl RdrName], FreeVars)
+rnTopSpliceDecls e = failTH e "Template Haskell top splice"
+
+rnSpliceType :: HsSplice RdrName -> PostTc Name Kind
+ -> RnM (HsType Name, FreeVars)
+rnSpliceType e _ = failTH e "Template Haskell type splice"
+
+rnSpliceExpr :: HsSplice RdrName -> RnM (HsExpr Name, FreeVars)
+rnSpliceExpr e = failTH e "Template Haskell splice"
+
+rnSplicePat :: HsSplice RdrName -> RnM (Either (Pat RdrName) (Pat Name), FreeVars)
+rnSplicePat e = failTH e "Template Haskell pattern splice"
+
+rnSpliceDecl :: SpliceDecl RdrName -> RnM (SpliceDecl Name, FreeVars)
+rnSpliceDecl e = failTH e "Template Haskell declaration splice"
+#else
{-
*********************************************************
@@ -739,6 +760,7 @@ illegalUntypedSplice = text "Untyped splices may not appear in typed brackets"
-- = vcat [ hang (text "In the splice:")
-- 2 (char '$' <> pprParendExpr expr)
-- , text "To see what the splice expanded to, use -ddump-splices" ]
+#endif
checkThLocalName :: Name -> RnM ()
checkThLocalName name