[project @ 2000-04-13 11:56:35 by simonpj]
[ghc-hetmet.git] / ghc / compiler / rename / ParseIface.y
index 7661607..4062b55 100644 (file)
@@ -7,35 +7,39 @@ import HsSyn          -- quite a bit of stuff
 import RdrHsSyn                -- oodles of synonyms
 import HsTypes         ( mkHsForAllTy, mkHsUsForAllTy )
 import HsCore
-import Const           ( Literal(..), mkMachInt_safe )
+import Literal         ( Literal(..), mkMachInt, mkMachInt64, mkMachWord, mkMachWord64 )
 import BasicTypes      ( Fixity(..), FixityDirection(..), 
                          NewOrData(..), Version
                        )
 import CostCentre       ( CostCentre(..), IsCafCC(..), IsDupdCC(..) )
+import CallConv         ( cCallConv )
 import HsPragmas       ( noDataPragmas, noClassPragmas )
 import Type            ( Kind, mkArrowKind, boxedTypeKind, openTypeKind, UsageAnn(..) )
 import IdInfo           ( ArityInfo, exactArity, CprInfo(..), InlinePragInfo(..) )
+import PrimOp           ( CCall(..), CCallTarget(..) )
 import Lex             
 
 import RnMonad         ( ImportVersion, LocalVersion, ParsedIface(..), WhatsImported(..),
-                         RdrNamePragma, ExportItem, RdrAvailInfo, GenAvailInfo(..), WhetherHasOrphans
+                         RdrNamePragma, ExportItem, RdrAvailInfo, GenAvailInfo(..), 
+                          WhetherHasOrphans, IsBootInterface
                        ) 
 import Bag             ( emptyBag, unitBag, snocBag )
 import FiniteMap       ( emptyFM, unitFM, addToFM, plusFM, bagToFM, FiniteMap )
-import RdrName          ( RdrName, mkRdrUnqual, mkSysQual, mkSysUnqual )
+import RdrName          ( RdrName, mkRdrUnqual, mkSysQual, mkSysUnqual, mkRdrNameWkr )
 import Name            ( OccName, Provenance )
 import OccName          ( mkSysOccFS,
-                         tcName, varName, dataName, clsName, tvName, uvName,
+                         tcName, varName, ipName, dataName, clsName, tvName, uvName,
                          EncodedFS 
                        )
-import Module           ( ModuleName, mkSysModuleFS )                  
-import PrelMods         ( mkTupNameStr, mkUbxTupNameStr )
+import Module           ( ModuleName, PackageName, mkSysModuleFS, mkModule )                   
 import PrelInfo         ( mkTupConRdrName, mkUbxTupConRdrName )
 import SrcLoc          ( SrcLoc )
+import CmdLineOpts     ( opt_InPackage )
 import Maybes
 import Outputable
 
 import GlaExts
+import FastString      ( tailFS )
 
 #if __HASKELL1__ > 4
 import Ratio ( (%) )
@@ -48,6 +52,7 @@ import Ratio ( (%) )
 %lexer      { lexer } { ITeof }
 
 %token
+ 'as'          { ITas }
  'case'        { ITcase }                      -- Haskell keywords
  'class'       { ITclass } 
  'data'        { ITdata } 
@@ -55,6 +60,7 @@ import Ratio ( (%) )
  'deriving'    { ITderiving }
  'do'          { ITdo }
  'else'        { ITelse }
+ 'hiding'      { IThiding }
  'if'          { ITif }
  'import'      { ITimport }
  'in'          { ITin }
@@ -66,12 +72,10 @@ import Ratio ( (%) )
  'module'      { ITmodule }
  'newtype'     { ITnewtype }
  'of'          { ITof }
+ 'qualified'   { ITqualified }
  'then'        { ITthen }
  'type'        { ITtype }
  'where'       { ITwhere }
- 'as'          { ITas }
- 'qualified'   { ITqualified }
- 'hiding'      { IThiding }
 
  'forall'      { ITforall }                    -- GHC extension keywords
  'foreign'     { ITforeign }
@@ -79,19 +83,25 @@ import Ratio ( (%) )
  'label'       { ITlabel } 
  'dynamic'     { ITdynamic }
  'unsafe'      { ITunsafe }
+ 'with'                { ITwith }
+ 'stdcall'      { ITstdcallconv }
+ 'ccall'        { ITccallconv }
 
  '__interface' { ITinterface }                 -- interface keywords
  '__export'    { IT__export }
- '__forall'    { IT__forall }
  '__depends'   { ITdepends }
+ '__forall'    { IT__forall }
  '__letrec'    { ITletrec }
  '__coerce'    { ITcoerce }
- '__inline_call'{ ITinlineCall }
  '__inline_me'  { ITinlineMe }
+ '__inline_call'{ ITinlineCall }
  '__DEFAULT'   { ITdefaultbranch }
  '__bot'       { ITbottom }
  '__integer'   { ITinteger_lit }
  '__float'     { ITfloat_lit }
+ '__word'      { ITword_lit }
+ '__int64'     { ITint64_lit }
+ '__word64'    { ITword64_lit }
  '__rational'  { ITrational_lit }
  '__addr'      { ITaddr_lit }
  '__litlit'    { ITlit_lit }
@@ -109,7 +119,8 @@ import Ratio ( (%) )
  '__U'         { ITunfold $$ }
  '__S'         { ITstrict $$ }
  '__R'         { ITrules }
- '__M'         { ITcprinfo $$ }
+ '__M'         { ITcprinfo }
+ '__D'         { ITdeprecated }
 
  '..'          { ITdotdot }                    -- reserved symbols
  '::'          { ITdcolon }
@@ -146,6 +157,8 @@ import Ratio ( (%) )
  QVARSYM       { ITqvarsym  $$ }
  QCONSYM       { ITqconsym  $$ }
 
+ IPVARID       { ITipvarid  $$ }               -- GHC extension
+
  PRAGMA                { ITpragma   $$ }
 
  CHAR          { ITchar     $$ }
@@ -163,29 +176,31 @@ import Ratio ( (%) )
 --              (c) the IdInfo part of a signature (same reason)
 
 iface_stuff :: { IfaceStuff }
-iface_stuff : iface            { let (nm, iff) = $1 in PIface nm iff }
-           | type              { PType   $1 }
-           | id_info           { PIdInfo $1 }
-           | '__R' rules       { PRules  $2 }
+iface_stuff : iface            { PIface   $1 }
+           | type              { PType    $1 }
+           | id_info           { PIdInfo  $1 }
+           | '__R' rules       { PRules   $2 }
+           | '__D' deprecs     { PDeprecs $2 }
 
 
-iface          :: { (ModuleName, ParsedIface) }
-iface          : '__interface' mod_fs INTEGER orphans checkVersion 'where'
+iface          :: { ParsedIface }
+iface          : '__interface' package mod_name INTEGER orphans checkVersion 'where'
                  exports_part
                   import_part
                  instance_decl_part
                  decls_part
-                 rules_part
-                 { ( $2                        -- Module name
-                   , ParsedIface {
-                       pi_mod = fromInteger $3,        -- Module version
-                       pi_orphan  = $4,
-                       pi_exports = $7,        -- Exports
-                       pi_usages  = $8,        -- Usages
-                       pi_insts   = $9,        -- Local instances
-                       pi_decls   = $10,       -- Decls
-                       pi_rules   = $11        -- Rules 
-                     } ) }
+                 rules_and_deprecs
+                 { ParsedIface {
+                       pi_mod  = mkModule $3 $2,       -- Module itself
+                       pi_vers = fromInteger $4,       -- Module version
+                       pi_orphan  = $5,
+                       pi_exports = $8,        -- Exports
+                       pi_usages  = $9,        -- Usages
+                       pi_insts   = $10,       -- Local instances
+                       pi_decls   = $11,       -- Decls
+                       pi_rules   = fst $12,   -- Rules 
+                       pi_deprecs = snd $12    -- Deprecations 
+                     } }
 
 --------------------------------------------------------------------------
 
@@ -194,8 +209,8 @@ import_part :                                                 { [] }
            |  import_part import_decl                    { $2 : $1 }
            
 import_decl :: { ImportVersion OccName }
-import_decl : 'import' mod_fs INTEGER orphans whats_imported ';'
-                       { (mkSysModuleFS $2, fromInteger $3, $4, $5) }
+import_decl : 'import' mod_name INTEGER orphans is_boot whats_imported ';'
+                       { (mkSysModuleFS $2, fromInteger $3, $4, $5, $6) }
        -- import Foo 3 :: a 1 b 3 c 7 ;        means import a,b,c from Foo
        -- import Foo 3 ;                       means import all of Foo
        -- import Foo 3 ! :: ...stuff... ;      the ! means that Foo contains orphans
@@ -204,6 +219,10 @@ orphans                :: { WhetherHasOrphans }
 orphans                    :                                           { False }
                    | '!'                                       { True }
 
+is_boot                    :: { IsBootInterface }
+is_boot                    :                                           { False }
+                   | '@'                                       { True }
+
 whats_imported      :: { WhatsImported OccName }
 whats_imported      :                                           { Everything }
                     | '::' name_version_pairs                  { Specifically $2 }
@@ -222,7 +241,7 @@ name_version_pair   :  var_occ INTEGER                              { ($1, fromInteger $2) }
 exports_part   :: { [ExportItem] }
 exports_part   :                                       { [] }
                | exports_part '__export' 
-                 mod_fs entities ';'                   { (mkSysModuleFS $3, $4) : $1 }
+                 mod_name entities ';'                 { (mkSysModuleFS $3, $4) : $1 }
 
 entities       :: { [RdrAvailInfo] }
 entities       :                                       { [] }
@@ -310,32 +329,42 @@ decl    : src_loc var_name '::' type maybe_idinfo
 
 maybe_idinfo  :: { RdrName -> [HsIdInfo RdrName] }
 maybe_idinfo  : {- empty -}    { \_ -> [] }
-             | src_loc PRAGMA  { \x -> 
-                                  case parseIface $2
-                                          PState{bol = 0#, atbol = 1#,
-                                                 context = [],
-                                                 glasgow_exts = 1#,
-                                                 loc = $1 } of
+             | pragma          { \x -> case $1 of
                                     POk _ (PIdInfo id_info) -> id_info
                                     PFailed err -> 
                                        pprPanic "IdInfo parse failed" 
                                            (vcat [ppr x, err])
                                }
 
+pragma :: { ParseResult IfaceStuff }
+pragma : src_loc PRAGMA        { parseIface $2 PState{ bol = 0#, atbol = 1#,
+                                                       context = [],
+                                                       glasgow_exts = 1#,
+                                                       loc = $1 }
+                               }
+
 -----------------------------------------------------------------------------
 
-rules_part :: { [RdrNameRuleDecl] }
-rules_part : {- empty -}       { [] }
-          | src_loc PRAGMA     { case parseIface $2 
-                                          PState{bol = 0#, atbol = 1#,
-                                                 context = [],
-                                                 glasgow_exts = 1#,
-                                                 loc = $1 }  of
-                                    POk _ (PRules rules) -> rules
-                                    PFailed err -> 
-                                         pprPanic "Rules parse failed" err
+rules_and_deprecs :: { ([RdrNameRuleDecl], [RdrNameDeprecation]) }
+rules_and_deprecs : {- empty -}        { ([], []) }
+                 | rules_and_deprecs rule_or_deprec
+                               { let
+                                    append2 (xs1,ys1) (xs2,ys2) =
+                                       (xs1 `app` xs2, ys1 `app` ys2)
+                                    xs `app` [] = xs -- performance paranoia
+                                    xs `app` ys = xs ++ ys
+                                 in append2 $1 $2
                                }
 
+rule_or_deprec :: { ([RdrNameRuleDecl], [RdrNameDeprecation]) }
+rule_or_deprec : pragma        { case $1 of
+                            POk _ (PRules   rules)   -> (rules,[])
+                            POk _ (PDeprecs deprecs) -> ([],deprecs)
+                            PFailed err -> pprPanic "Rules/Deprecations parse failed" err
+                       }
+
+-----------------------------------------------------------------------------
+
 rules     :: { [RdrNameRuleDecl] }
           : {- empty -}        { [] }
           | rule ';' rules     { $1:$3 }
@@ -349,6 +378,21 @@ rule_forall        : '__forall' '{' core_bndrs '}' { $3 }
                  
 -----------------------------------------------------------------------------
 
+deprecs        :: { [RdrNameDeprecation] }
+deprecs                : {- empty -}           { [] }
+               | deprecs deprec ';'    { $2 : $1 }
+
+deprec         :: { RdrNameDeprecation }
+deprec         : STRING                { Deprecation (IEModuleContents undefined) $1 }
+               | deprec_name STRING    { Deprecation $1 $2 }
+
+-- SUP: TEMPORARY HACK
+deprec_name    :: { RdrNameIE }
+               : var_name              { IEVar      $1 }
+               | data_name             { IEThingAbs $1 }
+
+-----------------------------------------------------------------------------
+
 version                :: { Version }
 version                :  INTEGER                              { fromInteger $1 }
 
@@ -367,15 +411,15 @@ constrs1  :  constr               { [$1] }
                |  constr '|' constrs1  { $1 : $3 }
 
 constr         :: { RdrNameConDecl }
-constr         :  src_loc ex_stuff data_name batypes           { mkConDecl $3 $2 (VanillaCon $4) $1 }
-               |  src_loc ex_stuff data_name '{' fields1 '}'   { mkConDecl $3 $2 (RecCon $5)     $1 }
+constr         :  src_loc ex_stuff data_name batypes           { mk_con_decl $3 $2 (VanillaCon $4) $1 }
+               |  src_loc ex_stuff data_name '{' fields1 '}'   { mk_con_decl $3 $2 (RecCon $5)     $1 }
                 -- We use "data_fs" so as to include ()
 
 newtype_constr :: { [RdrNameConDecl] {- Empty if handwritten abstract -} }
 newtype_constr :                                       { [] }
-               | src_loc '=' ex_stuff data_name atype  { [mkConDecl $4 $3 (NewCon $5 Nothing) $1] }
+               | src_loc '=' ex_stuff data_name atype  { [mk_con_decl $4 $3 (NewCon $5 Nothing) $1] }
                | src_loc '=' ex_stuff data_name '{' var_name '::' atype '}'
-                                                       { [mkConDecl $4 $3 (NewCon $8 (Just $6)) $1] }
+                                                       { [mk_con_decl $4 $3 (NewCon $8 (Just $6)) $1] }
 
 ex_stuff :: { ([HsTyVar RdrName], RdrNameContext) }
 ex_stuff       :                                       { ([],[]) }
@@ -421,8 +465,9 @@ context_list1       :: { RdrNameContext }
 context_list1  : class                                 { [$1] }
                | class ',' context_list1               { $1 : $3 }
 
-class          :: { (RdrName, [RdrNameHsType]) }
-class          :  qcls_name atypes                     { ($1, $2) }
+class          :: { HsPred RdrName }
+class          :  qcls_name atypes                     { (HsPClass $1 $2) }
+               |  ipvar_name '::' type                 { (HsPIParam $1 $3) }
 
 types0         :: { [RdrNameHsType]                    {- Zero or more -}  }   
 types0         :  {- empty -}                          { [ ] }
@@ -450,6 +495,7 @@ atype               :  qtc_name                             { MonoTyVar $1 }
                |  '(#' types0 '#)'                     { MonoTupleTy $2 False{-unboxed-} }
                |  '[' type ']'                         { MonoListTy  $2 }
                |  '{' qcls_name atypes '}'             { MonoDictTy $2 $3 }
+               |  '{' ipvar_name '::' type '}'         { MonoIParamTy $2 $4 }
                |  '(' type ')'                         { $2 }
 
 -- This one is dealt with via qtc_name
@@ -459,11 +505,14 @@ atypes            :: { [RdrNameHsType]    {-  Zero or more -} }
 atypes         :                                       { [] }
                |  atype atypes                         { $1 : $2 }
 ---------------------------------------------------------------------
-mod_fs         :: { EncodedFS }
-               :  CONID                { $1 }
+package                :: { PackageName }
+               :  STRING               { $1 }
+               | {- empty -}           { opt_InPackage }       -- Useful for .hi-boot files,
+                                                               -- which can omit the package Id
+                                                               -- Module loops are always within a package
 
 mod_name       :: { ModuleName }
-               :  mod_fs               { mkSysModuleFS $1 }
+               :  CONID                { mkSysModuleFS $1 }
 
 
 ---------------------------------------------------
@@ -479,6 +528,9 @@ var_fs              :: { EncodedFS }
                | 'label'               { SLIT("label") }
                | 'dynamic'             { SLIT("dynamic") }
                | 'unsafe'              { SLIT("unsafe") }
+               | 'with'                { SLIT("with") }
+               | 'ccall'               { SLIT("ccall") }
+               | 'stdcall'             { SLIT("stdcall") }
 
 qvar_fs                :: { (EncodedFS, EncodedFS) }
                :  QVARID               { $1 }
@@ -494,6 +546,9 @@ qvar_name   :: { RdrName }
 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 }
@@ -618,7 +673,7 @@ id_info             :: { [HsIdInfo RdrName] }
 id_info_item   :: { HsIdInfo RdrName }
                : '__A' INTEGER                 { HsArity (exactArity (fromInteger $2)) }
                | '__U' inline_prag core_expr   { HsUnfold $2 $3 }
-               | '__M'                         { HsCprInfo $1 }
+               | '__M'                         { HsCprInfo }
                | '__S'                         { HsStrictness (HsStrictnessInfo $1) }
                | '__C'                         { HsNoCafRefs }
                | '__P' qvar_name               { HsWorker $2 }
@@ -639,8 +694,7 @@ core_expr   : '\\' core_bndrs '->' core_expr        { foldr UfLam $4 $2 }
                | '__letrec' '{' rec_binds '}'          
                  'in' core_expr                        { UfLet (UfRec $3) $6 }
 
-               | con_or_primop '{' core_args '}'       { UfCon $1 $3 }
-                | '__litlit' STRING atype               { UfCon (UfLitLitCon $2 $3) [] }
+                | '__litlit' STRING atype               { UfLitLit $2 $3 }
 
                 | '__inline_me' core_expr               { UfNote UfInlineMe $2 }
                 | '__inline_call' core_expr             { UfNote UfInlineCall $2 }
@@ -662,7 +716,6 @@ core_args   :: { [UfExpr RdrName] }
 
 core_aexpr      :: { UfExpr RdrName }              -- Atomic expressions
 core_aexpr      : qvar_name                                    { UfVar $1 }
-
                 | qdata_name                                    { UfVar $1 }
                        -- This one means that e.g. "True" will parse as 
                        -- (UfVar True_Id) rather than (UfCon True_Con []).
@@ -673,14 +726,30 @@ core_aexpr      : qvar_name                                       { UfVar $1 }
                        -- If you want to get a UfCon, then use the
                        -- curly-bracket notation (True {}).
 
-               | core_lit               { UfCon (UfLitCon $1) [] }
-               | '(' core_expr ')'      { $2 }
-               | '(' comma_exprs2 ')'   { UfTuple (mkTupConRdrName (length $2)) $2 }
-               | '(#' comma_exprs0 '#)' { UfTuple (mkUbxTupConRdrName (length $2)) $2 }
-
 -- This one is dealt with by qdata_name: see above comments
 --             | '('  ')'               { UfTuple (mkTupConRdrName 0) [] }
 
+               | core_lit               { UfLit $1 }
+               | '(' core_expr ')'      { $2 }
+
+                       -- Tuple construtors are for the *worker* of the tuple
+                       -- Going direct saves needless messing about 
+               | '(' comma_exprs2 ')'   { UfTuple (mkRdrNameWkr (mkTupConRdrName (length $2))) $2 }
+               | '(#' comma_exprs0 '#)' { UfTuple (mkRdrNameWkr (mkUbxTupConRdrName (length $2))) $2 }
+
+                | '{' '__ccall' ccall_string type '}'       
+                           { let
+                                 (is_dyn, is_casm, may_gc) = $2
+
+                                target | is_dyn    = DynamicTarget (error "CCall dyn target bogus unique")
+                                       | otherwise = StaticTarget $3
+
+                                ccall = CCall target is_casm may_gc cCallConv
+                            in
+                            UfCCall ccall $4
+                          }
+
+
 comma_exprs0    :: { [UfExpr RdrName] }        -- Zero or more
 comma_exprs0   : {- empty -}                   { [ ] }
                | core_expr                     { [ $1 ] }
@@ -690,15 +759,6 @@ comma_exprs2       :: { [UfExpr RdrName] } -- Two or more
 comma_exprs2   : core_expr ',' core_expr                       { [$1,$3] }
                | core_expr ',' comma_exprs2                    { $1 : $3 }
 
-con_or_primop   :: { UfCon RdrName }
-con_or_primop   : qdata_name                    { UfDataCon $1 }
-                | qvar_name                    { UfPrimOp $1 }
-                | '__ccall' ccall_string      { let
-                                               (is_dyn, is_casm, may_gc) = $1
-                                               in
-                                               UfCCallOp $2 is_dyn is_casm may_gc
-                                               }
-
 rec_binds      :: { [(UfBinder RdrName, UfExpr RdrName)] }
                :                                               { [] }
                | core_val_bndr '=' core_expr ';' rec_binds     { ($1,$3) : $5 }
@@ -710,12 +770,12 @@ core_alts :: { [UfAlt RdrName] }
 core_alt        :: { UfAlt RdrName }
 core_alt       : core_pat '->' core_expr       { (fst $1, snd $1, $3) }
 
-core_pat       :: { (UfCon RdrName, [RdrName]) }
-core_pat       : core_lit                      { (UfLitCon  $1, []) }
-               | '__litlit' STRING atype       { (UfLitLitCon $2 $3, []) }
-               | qdata_name core_pat_names     { (UfDataCon $1, $2) }
-               | '(' comma_var_names1 ')'      { (UfDataCon (mkTupConRdrName (length $2)), $2) }
-               | '(#' comma_var_names1 '#)'    { (UfDataCon (mkUbxTupConRdrName (length $2)), $2) }
+core_pat       :: { (UfConAlt RdrName, [RdrName]) }
+core_pat       : core_lit                      { (UfLitAlt  $1, []) }
+               | '__litlit' STRING atype       { (UfLitLitAlt $2 $3, []) }
+               | qdata_name core_pat_names     { (UfDataAlt $1, $2) }
+               | '(' comma_var_names1 ')'      { (UfDataAlt (mkTupConRdrName (length $2)), $2) }
+               | '(#' comma_var_names1 '#)'    { (UfDataAlt (mkUbxTupConRdrName (length $2)), $2) }
                | '__DEFAULT'                   { (UfDefault, []) }
                | '(' core_pat ')'              { $2 }
 
@@ -736,22 +796,14 @@ comma_var_names1 : var_name                                       { [$1] }
                 | var_name ',' comma_var_names1                { $1 : $3 }
 
 core_lit       :: { Literal }
-core_lit       : integer                       { mkMachInt_safe $1 }
+core_lit       : integer                       { mkMachInt $1 }
                | CHAR                          { MachChar $1 }
                | STRING                        { MachStr $1 }
-               | '__string' STRING             { NoRepStr $2 (panic "NoRepStr type") }
                | rational                      { MachDouble $1 }
+               | '__word' integer              { mkMachWord $2 }
+               | '__word64' integer            { mkMachWord64 $2 }
+               | '__int64' integer             { mkMachInt64 $2 }
                | '__float' rational            { MachFloat $2 }
-
-               | '__integer' integer           { NoRepInteger  $2 (panic "NoRepInteger type") 
-                                                       -- The type checker will add the types
-                                               }
-
-               | '__rational' integer integer  { NoRepRational ($2 % $3) 
-                                                  (panic "NoRepRational type")
-                                                       -- The type checker will add the type
-                                               }
-
                | '__addr' integer              { MachAddr $2 }
 
 integer                :: { Integer }
@@ -785,10 +837,10 @@ ccall_string      :: { FAST_STRING }
 
 ------------------------------------------------------------------------
 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 }
@@ -818,10 +870,11 @@ checkVersion :: { () }
 happyError :: P a
 happyError buf PState{ loc = loc } = PFailed (ifaceParseErr buf loc)
 
-data IfaceStuff = PIface       EncodedFS{-.hi module name-} ParsedIface
+data IfaceStuff = PIface       ParsedIface
                | PIdInfo       [HsIdInfo RdrName]
                | PType         RdrNameHsType
                | PRules        [RdrNameRuleDecl]
+               | PDeprecs      [RdrNameDeprecation]
 
-mkConDecl name (ex_tvs, ex_ctxt) details loc = ConDecl name ex_tvs ex_ctxt details loc
+mk_con_decl name (ex_tvs, ex_ctxt) details loc = mkConDecl name ex_tvs ex_ctxt details loc
 }