module :: { RdrNameHsModule }
: '%module' modid tdefs vdefgs
- { HsModule $2 Nothing Nothing [] ($3 ++ concat $4) Nothing noSrcLoc}
+ { HsModule (mkHomeModule $2) Nothing Nothing
+ [] ($3 ++ concat $4) Nothing noSrcLoc}
tdefs :: { [RdrNameHsDecl] }
: {- empty -} {[]}
trep :: { (RdrName -> [HsTyVarBndr RdrName] -> DataConDetails (ConDecl RdrName)) }
: {- empty -} { (\ x ts -> Unknown) }
- | '=' ty { (\ x ts -> DataCons [ConDecl x x ts [] (VanillaCon [unbangedType $2]) noSrcLoc]) }
+ | '=' ty { (\ x ts -> DataCons [ConDecl x ts [] (PrefixCon [unbangedType $2]) noSrcLoc]) }
tbind :: { HsTyVarBndr RdrName }
: name { IfaceTyVar $1 liftedTypeKind }
| vdefg ';' vdefgs { ($1:$3) }
vdefg :: { [RdrNameHsDecl] }
- : '%rec' '{' vdefs1 '}' { $3 }
- | vdef { [$1] }
+ : '%rec' '{' vdefs1 '}' { map CoreD $3 }
+ | vdef { [CoreD $1] }
let_bind :: { UfBinding RdrName }
: '%rec' '{' vdefs1 '}' { UfRec (map convBind $3) }
| vdef { let (b,r) = convBind $1
in UfNonRec b r }
-vdefs1 :: { [RdrNameHsDecl] }
+vdefs1 :: { [RdrNameCoreDecl] }
: vdef { [$1] }
| vdef ';' vdefs1 { $1:$3 }
-vdef :: { RdrNameHsDecl }
- : qname '::' ty '=' exp { TyClD (CoreDecl $1 $3 $5 noSrcLoc) }
+vdef :: { RdrNameCoreDecl }
+ : qname '::' ty '=' exp { CoreDecl $1 $3 $5 noSrcLoc }
vbind :: { (RdrName, RdrNameHsType) }
con :: { ConDecl RdrName }
: q_d_name attbinds atys
- { mkConDecl $1 $2 [] (VanillaCon (map unbangedType $3)) noSrcLoc}
+ { ConDecl $1 $2 [] (PrefixCon (map unbangedType $3)) noSrcLoc}
atys :: { [ RdrNameHsType] }
: {- empty -} { [] }
{
-convBind :: RdrNameHsDecl -> (UfBinder RdrName, UfExpr RdrName)
-convBind (TyClD (CoreDecl n ty rhs _)) = (UfValBinder n ty, rhs)
+convBind :: RdrNameCoreDecl -> (UfBinder RdrName, UfExpr RdrName)
+convBind (CoreDecl n ty rhs _) = (UfValBinder n ty, rhs)
happyError :: P a
happyError s l = failP (show l ++ ": Parse error\n") (take 100 s) l