TYPE_PART { ITtysig _ _ }
ARITY_PART { ITarity }
UNFOLD_PART { ITunfold $$ }
+ SPECIALISE { ITspecialise }
BOTTOM { ITbottom }
LAM { ITlam }
BIGLAM { ITbiglam }
LETREC { ITletrec }
IN { ITin }
OF { ITof }
- COERCE_IN { ITcoerce_in }
- COERCE_OUT { ITcoerce_out }
+ COERCE { ITcoerce }
ATSIGN { ITatsign }
CCALL { ITccall $$ }
SCC { ITscc $$ }
+ INLINE_CALL { ITinline }
CHAR { ITchar $$ }
STRING { ITstring $$ }
iface :: { ParsedIface }
-iface : INTERFACE CONID INTEGER
+iface : INTERFACE CONID INTEGER checkVersion
inst_modules_part
usages_part
exports_part fixities_part
{ ParsedIface
$2 -- Module name
(fromInteger $3) -- Module version
- $5 -- Usages
- $6 -- Exports
- $4 -- Instance modules
- $7 -- Fixities
- $9 -- Decls
- $8 -- Local instances
+ $6 -- Usages
+ $7 -- Exports
+ $5 -- Instance modules
+ $8 -- Fixities
+ $10 -- Decls
+ $9 -- Local instances
}
| strict_info { HsStrictness $1 }
| BOTTOM { HsStrictness HsBottom }
| UNFOLD_PART core_expr { HsUnfold $1 $2 }
+ | SPECIALISE spec_tvs
+ atypes EQUAL core_expr { HsSpecialise $2 $3 $5 }
+
+
+spec_tvs :: { [HsTyVar RdrName] }
+spec_tvs : OBRACK tv_bndrs CBRACK { $2 }
+
arity_info :: { ArityInfo }
arity_info : INTEGER { exactArity (fromInteger $1) }
| LETREC OCURLY rec_binds CCURLY
IN core_expr { UfLet (UfRec $3) $6 }
- | coerce atype core_expr { UfCoerce $1 $2 $3 }
-
| CCALL ccall_string
OBRACK atype atypes CBRACK core_args { let
(is_casm, may_gc) = $1
UfPrim (UfCCallOp $2 is_casm may_gc $5 $4)
$7
}
- | SCC core_expr { UfSCC $1 $2 }
+ | INLINE_CALL core_expr { UfNote UfInlineCall $2 }
+ | COERCE atype core_expr { UfNote (UfCoerce $2) $3 }
+ | SCC core_expr { UfNote (UfSCC $1) $2 }
rec_binds :: { [(UfBinder RdrName, UfExpr RdrName)] }
: { [] }
| core_val_bndr EQUAL core_expr SEMI rec_binds { ($1,$3) : $5 }
-coerce :: { UfCoercion RdrName }
-coerce : COERCE_IN qdata_name { UfIn $2 }
- | COERCE_OUT qdata_name { UfOut $2 }
-
prim_alts :: { [(Literal,UfExpr RdrName)] }
: { [] }
| core_lit RARROW core_expr SEMI prim_alts { ($1,$3) : $5 }
: VARID { head (_UNPK_ $1) }
| CONID { head (_UNPK_ $1) }
-
-------------------------------------------------------------------
src_loc :: { SrcLoc }
src_loc : {% getSrcLocIf }
+checkVersion :: { () }
+ : {-empty-} {% checkVersion Nothing }
+ | INTEGER {% checkVersion (Just (fromInteger $1)) }
+
-------------------------------------------------------------------
-- Haskell code