Template Haskell: allow type splices
[ghc-hetmet.git] / compiler / parser / Parser.y.pp
index 6839286..f9976b4 100644 (file)
@@ -8,7 +8,7 @@
 -- ---------------------------------------------------------------------------
 
 {
-{-# OPTIONS -w #-}
+{-# OPTIONS -Wwarn -w #-}
 -- The above warning supression flag is a temporary kludge.
 -- While working on this module you are encouraged to remove it and fix
 -- any warnings in the module. See
@@ -1078,6 +1078,10 @@ atype :: { LHsType RdrName }
        | '[:' ctype ':]'               { LL $ HsPArrTy  $2 }
        | '(' ctype ')'                 { LL $ HsParTy   $2 }
        | '(' ctype '::' kind ')'       { LL $ HsKindSig $2 (unLoc $4) }
+       | '$(' exp ')'                  { LL $ HsSpliceTy (mkHsSplice $2 ) }
+       | TH_ID_SPLICE                  { LL $ HsSpliceTy (mkHsSplice 
+                                                (L1 $ HsVar (mkUnqual varName 
+                                                               (getTH_ID_SPLICE $1)))) } -- $x
 -- Generics
         | INTEGER                       { L1 (HsNumTy (getINTEGER $1)) }