X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fparser%2FParser.y.pp;h=1cee18be7c435cd9a37349999ec54309ecde296b;hb=022fc24719ba4b98b8d9f19bfe7f75dd0f19d585;hp=adabb756abc975dcbdc7289ecb3fec5f5e9f591a;hpb=911ab82c2a7c1aaf8feb78731f0bae588d244e14;p=ghc-hetmet.git diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp index adabb75..1cee18b 100644 --- a/compiler/parser/Parser.y.pp +++ b/compiler/parser/Parser.y.pp @@ -35,6 +35,7 @@ import StaticFlags ( opt_SccProfilingOn, opt_Hpc ) import Type ( Kind, mkArrowKind, liftedTypeKind, unliftedTypeKind ) import BasicTypes ( Boxity(..), Fixity(..), FixityDirection(..), IPName(..), Activation(..), defaultInlineSpec ) +import DynFlags import OrdList import HaddockParse import {-# SOURCE #-} HaddockLex hiding ( Token ) @@ -200,7 +201,6 @@ incorrect. 'data' { L _ ITdata } 'default' { L _ ITdefault } 'deriving' { L _ ITderiving } - 'derive' { L _ ITderive } 'do' { L _ ITdo } 'else' { L _ ITelse } 'hiding' { L _ IThiding } @@ -345,6 +345,7 @@ identifier :: { Located RdrName } | qcon { $1 } | qvarop { $1 } | qconop { $1 } + | '(' '->' ')' { LL $ getRdrName funTyCon } ----------------------------------------------------------------------------- -- Module Header @@ -754,7 +755,7 @@ tycl_hdr :: { Located (LHsContext RdrName, -- Glasgow extension: stand-alone deriving declarations stand_alone_deriving :: { LDerivDecl RdrName } - : 'derive' 'instance' inst_type {% checkDerivDecl (LL (DerivDecl $3)) } + : 'deriving' 'instance' inst_type {% checkDerivDecl (LL (DerivDecl $3)) } ----------------------------------------------------------------------------- -- Nested declarations @@ -1296,7 +1297,8 @@ exp10 :: { LHsExpr RdrName } | fexp { $1 } scc_annot :: { Located FastString } - : '_scc_' STRING { LL $ getSTRING $2 } + : '_scc_' STRING {% (addWarning Opt_WarnDeprecations (getLoc $1) (text "_scc_ is deprecated; use an SCC pragma instead")) >>= \_ -> + (return $ LL $ getSTRING $2) } | '{-# SCC' STRING '#-}' { LL $ getSTRING $2 } hpc_annot :: { Located (FastString,(Int,Int),(Int,Int)) } @@ -1756,7 +1758,6 @@ special_id : 'as' { L1 FSLIT("as") } | 'qualified' { L1 FSLIT("qualified") } | 'hiding' { L1 FSLIT("hiding") } - | 'derive' { L1 FSLIT("derive") } | 'export' { L1 FSLIT("export") } | 'label' { L1 FSLIT("label") } | 'dynamic' { L1 FSLIT("dynamic") }