[project @ 2001-03-13 14:58:25 by simonpj]
[ghc-hetmet.git] / ghc / compiler / rename / ParseIface.y
index 8181b64..e4bcf4b 100644 (file)
@@ -44,7 +44,7 @@ import BasicTypes     ( Fixity(..), FixityDirection(..),
 import CostCentre       ( CostCentre(..), IsCafCC(..), IsDupdCC(..) )
 import CallConv         ( cCallConv )
 import Type            ( Kind, mkArrowKind, liftedTypeKind, openTypeKind, usageTypeKind )
-import IdInfo           ( exactArity, InlinePragInfo(..) )
+import IdInfo           ( InlinePragInfo(..) )
 import PrimOp           ( CCall(..), CCallTarget(..) )
 import Lex             
 
@@ -390,13 +390,6 @@ pragma     : src_loc PRAGMA        { parseIdInfo $2 PState{ bol = 0#, atbol = 1#,
                                                        loc = $1 }
                                }
 
-rules_prag :: { ParseResult ([RdrNameRuleDecl], IfaceDeprecs) }
-rules_prag : src_loc PRAGMA    { parseRules $2 PState{ bol = 0#, atbol = 1#,
-                                                       context = [],
-                                                       glasgow_exts = 1#,
-                                                       loc = $1 }
-                               }
-
 -----------------------------------------------------------------------------
 
 rules_and_deprecs_part :: { ([RdrNameRuleDecl], IfaceDeprecs) }
@@ -406,6 +399,13 @@ rules_and_deprecs_part : {- empty -}       { ([], Nothing) }
                                             PFailed err -> pprPanic "Rules/Deprecations parse failed" err
                                        }
 
+rules_prag :: { ParseResult ([RdrNameRuleDecl], IfaceDeprecs) }
+rules_prag : src_loc PRAGMA    { parseRules $2 PState{ bol = 0#, atbol = 1#,
+                                                       context = [],
+                                                       glasgow_exts = 1#,
+                                                       loc = $1 }
+                               }
+
 rules_and_deprecs :: { ([RdrNameRuleDecl], IfaceDeprecs) }
 rules_and_deprecs : rule_prag deprec_prag      { ($1, $2) }
 
@@ -524,8 +524,8 @@ context_list1       : class                                 { [$1] }
                | class ',' context_list1               { $1 : $3 }
 
 class          :: { HsPred RdrName }
-class          :  qcls_name atypes                     { (HsPClass $1 $2) }
-               |  ipvar_name '::' type                 { (HsPIParam $1 $3) }
+class          :  qcls_name atypes                     { (HsClassP $1 $2) }
+               |  ipvar_name '::' type                 { (HsIParam $1 $3) }
 
 types0         :: { [RdrNameHsType]                    {- Zero or more -}  }   
 types0         :  {- empty -}                          { [ ] }
@@ -742,12 +742,12 @@ id_info           :: { [HsIdInfo RdrName] }
                | id_info_item id_info          { $1 : $2 }
 
 id_info_item   :: { HsIdInfo RdrName }
-               : '__A' INTEGER                 { HsArity (exactArity (fromInteger $2)) }
+               : '__A' INTEGER                 { HsArity (fromInteger $2) }
                | '__U' inline_prag core_expr   { HsUnfold $2 $3 }
                | '__M'                         { HsCprInfo }
                | '__S'                         { HsStrictness (mkStrictnessInfo $1) }
                | '__C'                         { HsNoCafRefs }
-               | '__P' qvar_name               { HsWorker $2 }
+               | '__P' qvar_name INTEGER       { HsWorker $2 (fromInteger $3) }
 
 inline_prag     :: { InlinePragInfo }
                 :  {- empty -}                  { NoInlinePragInfo }