Support stage 1 Template Haskell (non-quasi) quotes, fixes #10382.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Mon, 4 May 2015 23:10:05 +0000 (16:10 -0700)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Mon, 11 May 2015 16:09:22 +0000 (09:09 -0700)
commitf16ddcee0c64a92ab911a7841a8cf64e3ac671fd
tree3427379f02f5cd3cd53704b5fa35695fd9b5e3aa
parentecc3d6be218b1c7a36ee3f2f36c4f3ac4f45c34f
Support stage 1 Template Haskell (non-quasi) quotes, fixes #10382.

Summary:
This commit adds stage 1 support for Template Haskell
quoting, e.g. [| ... expr ... |], which is useful
for authors of quasiquoter libraries that do not actually
need splices.  The TemplateHaskell extension now does not
unconditionally fail; it only fails if the renamer encounters
a splice that it can't run.

In order to make sure the referenced data structures
are consistent, template-haskell is now a boot library.
There are some minor BC changes to template-haskell to make it boot
on GHC 7.8.

Note for reviewer: big diff changes are simply code
being moved out of an ifdef; there was no other substantive
change to that code.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: simonpj, austin, goldfire

Subscribers: bgamari, thomie

Differential Revision: https://phabricator.haskell.org/D876

GHC Trac Issues: #10382
55 files changed:
compiler/deSugar/DsExpr.hs
compiler/ghc.cabal.in
compiler/main/DynFlags.hs
compiler/main/HscMain.hs
compiler/rename/RnSplice.hs
compiler/typecheck/TcExpr.hs
compiler/typecheck/TcSplice.hs
docs/users_guide/7.12.1-notes.xml
docs/users_guide/glasgow_exts.xml
ghc.mk
libraries/template-haskell/Language/Haskell/TH/PprLib.hs
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
libraries/template-haskell/template-haskell.cabal
mk/warnings.mk
testsuite/tests/quotes/.gitignore [new file with mode: 0644]
testsuite/tests/quotes/Makefile [new file with mode: 0644]
testsuite/tests/quotes/T10384.hs [new file with mode: 0644]
testsuite/tests/quotes/T10384.stderr [new file with mode: 0644]
testsuite/tests/quotes/T2632.hs [moved from testsuite/tests/th/T2632.hs with 85% similarity]
testsuite/tests/quotes/T2931.hs [moved from testsuite/tests/th/T2931.hs with 70% similarity]
testsuite/tests/quotes/T3572.hs [moved from testsuite/tests/th/T3572.hs with 100% similarity]
testsuite/tests/quotes/T3572.stdout [moved from testsuite/tests/th/T3572.stdout with 100% similarity]
testsuite/tests/quotes/T4056.hs [moved from testsuite/tests/th/T4056.hs with 73% similarity]
testsuite/tests/quotes/T4169.hs [moved from testsuite/tests/th/T4169.hs with 85% similarity]
testsuite/tests/quotes/T4170.hs [moved from testsuite/tests/th/T4170.hs with 80% similarity]
testsuite/tests/quotes/T5721.hs [moved from testsuite/tests/th/T5721.hs with 59% similarity]
testsuite/tests/quotes/T6062.hs [moved from testsuite/tests/th/T6062.hs with 54% similarity]
testsuite/tests/quotes/T8455.hs [new file with mode: 0644]
testsuite/tests/quotes/T8633.hs [moved from testsuite/tests/th/T8633.hs with 96% similarity]
testsuite/tests/quotes/T8759a.hs [moved from testsuite/tests/th/T8759a.hs with 51% similarity]
testsuite/tests/quotes/T8759a.stderr [moved from testsuite/tests/th/T8759a.stderr with 100% similarity]
testsuite/tests/quotes/T9824.hs [moved from testsuite/tests/th/T9824.hs with 71% similarity]
testsuite/tests/quotes/TH_abstractFamily.hs [moved from testsuite/tests/th/TH_abstractFamily.hs with 100% similarity]
testsuite/tests/quotes/TH_abstractFamily.stderr [moved from testsuite/tests/th/TH_abstractFamily.stderr with 100% similarity]
testsuite/tests/quotes/TH_bracket1.hs [moved from testsuite/tests/th/TH_bracket1.hs with 100% similarity]
testsuite/tests/quotes/TH_bracket2.hs [moved from testsuite/tests/th/TH_bracket2.hs with 100% similarity]
testsuite/tests/quotes/TH_bracket3.hs [moved from testsuite/tests/th/TH_bracket3.hs with 100% similarity]
testsuite/tests/quotes/TH_localname.hs [new file with mode: 0644]
testsuite/tests/quotes/TH_localname.stderr [new file with mode: 0644]
testsuite/tests/quotes/TH_ppr1.hs [moved from testsuite/tests/th/TH_ppr1.hs with 100% similarity]
testsuite/tests/quotes/TH_ppr1.stdout [moved from testsuite/tests/th/TH_ppr1.stdout with 100% similarity]
testsuite/tests/quotes/TH_reifyType1.hs [moved from testsuite/tests/th/TH_reifyType1.hs with 100% similarity]
testsuite/tests/quotes/TH_reifyType2.hs [moved from testsuite/tests/th/TH_reifyType2.hs with 100% similarity]
testsuite/tests/quotes/TH_repE1.hs [moved from testsuite/tests/th/TH_repE1.hs with 100% similarity]
testsuite/tests/quotes/TH_repE3.hs [moved from testsuite/tests/th/TH_repE3.hs with 100% similarity]
testsuite/tests/quotes/TH_scope.hs [moved from testsuite/tests/th/TH_scope.hs with 100% similarity]
testsuite/tests/quotes/TH_spliceViewPat/A.hs [moved from testsuite/tests/th/TH_spliceViewPat/A.hs with 100% similarity]
testsuite/tests/quotes/TH_spliceViewPat/Main.hs [moved from testsuite/tests/th/TH_spliceViewPat/Main.hs with 100% similarity]
testsuite/tests/quotes/TH_spliceViewPat/Makefile [moved from testsuite/tests/th/TH_spliceViewPat/Makefile with 100% similarity]
testsuite/tests/quotes/TH_spliceViewPat/TH_spliceViewPat.stdout [moved from testsuite/tests/th/TH_spliceViewPat/TH_spliceViewPat.stdout with 100% similarity]
testsuite/tests/quotes/TH_spliceViewPat/test.T [moved from testsuite/tests/th/TH_spliceViewPat/test.T with 58% similarity]
testsuite/tests/quotes/TH_tf2.hs [moved from testsuite/tests/th/TH_tf2.hs with 100% similarity]
testsuite/tests/quotes/all.T [new file with mode: 0644]
testsuite/tests/th/T8455.hs [deleted file]
testsuite/tests/th/all.T