import Outputable
import GlaExts
+import FastString ( tailFS )
#if __HASKELL1__ > 4
import Ratio ( (%) )
'label' { ITlabel }
'dynamic' { ITdynamic }
'unsafe' { ITunsafe }
+ 'with' { ITwith }
'__interface' { ITinterface } -- interface keywords
'__export' { IT__export }
-----------------------------------------------------------------------------
-rules_and_deprecs :: { ([RdrNameRuleDecl], [(Maybe FAST_STRING, FAST_STRING)]) }
+rules_and_deprecs :: { ([RdrNameRuleDecl], [RdrNameDeprecation]) }
rules_and_deprecs : {- empty -} { ([], []) }
| rules_and_deprecs rule_or_deprec
{ let
in append2 $1 $2
}
-rule_or_deprec :: { ([RdrNameRuleDecl], [(Maybe FAST_STRING, FAST_STRING)]) }
+rule_or_deprec :: { ([RdrNameRuleDecl], [RdrNameDeprecation]) }
rule_or_deprec : pragma { case $1 of
POk _ (PRules rules) -> (rules,[])
POk _ (PDeprecs deprecs) -> ([],deprecs)
-----------------------------------------------------------------------------
-deprecs :: { [(Maybe FAST_STRING, FAST_STRING)] }
+deprecs :: { [RdrNameDeprecation] }
deprecs : {- empty -} { [] }
- | deprecs ';' deprec { $3 : $1 }
+ | deprecs deprec ';' { $2 : $1 }
-deprec :: { (Maybe FAST_STRING, FAST_STRING) }
-deprec : STRING { (Nothing, $1) }
- | deprec_name STRING { (Just $1, $2) }
+deprec :: { RdrNameDeprecation }
+deprec : STRING { Deprecation (IEModuleContents undefined) $1 }
+ | deprec_name STRING { Deprecation $1 $2 }
-deprec_name :: { FAST_STRING }
- : var_fs { $1 }
- | tc_fs { $1 }
+-- SUP: TEMPORARY HACK
+deprec_name :: { RdrNameIE }
+ : var_name { IEVar $1 }
+ | data_name { IEThingAbs $1 }
-----------------------------------------------------------------------------
class :: { HsPred RdrName }
class : qcls_name atypes { (HsPClass $1 $2) }
- | IPVARID '::' type { (HsPIParam (mkSysUnqual ipName $1) $3) }
+ | ipvar_name '::' type { (HsPIParam $1 $3) }
types0 :: { [RdrNameHsType] {- Zero or more -} }
types0 : {- empty -} { [ ] }
| '(#' types0 '#)' { MonoTupleTy $2 False{-unboxed-} }
| '[' type ']' { MonoListTy $2 }
| '{' qcls_name atypes '}' { MonoDictTy $2 $3 }
- | '{' IPVARID '::' type '}' { MonoIParamTy (mkSysUnqual ipName $2) $4 }
+ | '{' ipvar_name '::' type '}' { MonoIParamTy $2 $4 }
| '(' type ')' { $2 }
-- This one is dealt with via qtc_name
| 'label' { SLIT("label") }
| 'dynamic' { SLIT("dynamic") }
| 'unsafe' { SLIT("unsafe") }
+ | 'with' { SLIT("with") }
qvar_fs :: { (EncodedFS, EncodedFS) }
: QVARID { $1 }
qvar_name : var_name { $1 }
| qvar_fs { mkSysQual varName $1 }
+ipvar_name :: { RdrName }
+ : IPVARID { mkSysUnqual ipName (tailFS $1) }
+
var_names :: { [RdrName] }
var_names : { [] }
| var_name var_names { $1 : $2 }
------------------------------------------------------------------------
scc :: { CostCentre }
- : '__sccC' '{' mod_name STRING '}' { AllCafsCC $3 $4 }
- | '__scc' '{' cc_name mod_name STRING cc_dup cc_caf '}'
- { NormalCC { cc_name = $3, cc_mod = $4, cc_grp = $5,
- cc_is_dupd = $6, cc_is_caf = $7 } }
+ : '__sccC' '{' mod_name '}' { AllCafsCC $3 }
+ | '__scc' '{' cc_name mod_name cc_dup cc_caf '}'
+ { NormalCC { cc_name = $3, cc_mod = $4,
+ cc_is_dupd = $5, cc_is_caf = $6 } }
cc_name :: { EncodedFS }
: CONID { $1 }
| PIdInfo [HsIdInfo RdrName]
| PType RdrNameHsType
| PRules [RdrNameRuleDecl]
- | PDeprecs [(Maybe FAST_STRING, FAST_STRING)]
+ | PDeprecs [RdrNameDeprecation]
mkConDecl name (ex_tvs, ex_ctxt) details loc = ConDecl name ex_tvs ex_ctxt details loc
}