Several TH/quasiquote changes
authorsimonpj@microsoft.com <unknown>
Wed, 10 Feb 2010 09:39:10 +0000 (09:39 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 10 Feb 2010 09:39:10 +0000 (09:39 +0000)
commit6f8ff0bbad3b9fa389c960ad1b5a267a1ae502f1
treebed69a56e2e5a840ac0c05293854f343f9b7ee82
parent4b357e2a7e7eff16cb51b01830636d451664b202
Several TH/quasiquote changes

a) Added quasi-quote forms for
      declarations
      types
   e.g.   f :: [$qq| ... |]

b) Allow Template Haskell pattern quotes (but not splices)
   e.g.  f x = [p| Int -> $x |]

c) Improve pretty-printing for HsPat to remove superfluous
   parens.  (This isn't TH related really, but it affects
   some of the same code.)

A consequence of (a) is that when gathering and grouping declarations
in RnSource.findSplice, we must expand quasiquotes as we do so.
Otherwise it's all fairly straightforward.  I did a little bit of
refactoring in TcSplice.

User-manual changes still to come.
18 files changed:
compiler/deSugar/DsMeta.hs
compiler/hsSyn/HsDecls.lhs
compiler/hsSyn/HsExpr.lhs
compiler/hsSyn/HsPat.lhs
compiler/hsSyn/HsPat.lhs-boot
compiler/hsSyn/HsTypes.lhs
compiler/hsSyn/HsUtils.lhs
compiler/parser/Parser.y.pp
compiler/parser/RdrHsSyn.lhs
compiler/rename/RnExpr.lhs
compiler/rename/RnHsSyn.lhs
compiler/rename/RnPat.lhs
compiler/rename/RnSource.lhs
compiler/rename/RnTypes.lhs
compiler/typecheck/TcHsType.lhs
compiler/typecheck/TcRnDriver.lhs
compiler/typecheck/TcSplice.lhs
compiler/typecheck/TcSplice.lhs-boot