X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fparser%2FParserCore.y;h=c777137d9ad5dd15f5e4661d0cd44d50ae3b02a4;hb=23f40f0e9be6d4aa5cf9ea31d73f4013f8e7b4bd;hp=757d5e3637d1515c7bcac2dbb0ddb9538132280d;hpb=9b6858cb53438a2651ab00202582b13f95036058;p=ghc-hetmet.git diff --git a/ghc/compiler/parser/ParserCore.y b/ghc/compiler/parser/ParserCore.y index 757d5e3..c777137 100644 --- a/ghc/compiler/parser/ParserCore.y +++ b/ghc/compiler/parser/ParserCore.y @@ -13,7 +13,6 @@ import Module import ParserCoreUtils import LexCore import Literal -import BasicTypes import SrcLoc import TysPrim( wordPrimTyCon, intPrimTyCon, charPrimTyCon, floatPrimTyCon, doublePrimTyCon, addrPrimTyCon ) @@ -95,7 +94,7 @@ tdef :: { TyClDecl RdrName } trep :: { OccName -> [LConDecl RdrName] } : {- empty -} { (\ tc_occ -> []) } | '=' ty { (\ tc_occ -> let { dc_name = mkRdrUnqual (setOccNameSpace dataName tc_occ) ; - con_info = PrefixCon [unbangedType (toHsType $2)] } + con_info = PrefixCon [toHsType $2] } in [noLoc $ ConDecl (noLoc dc_name) [] (noLoc []) con_info]) } @@ -105,7 +104,9 @@ cons1 :: { [LConDecl RdrName] } con :: { LConDecl RdrName } : d_pat_occ attv_bndrs hs_atys - { noLoc $ ConDecl (noLoc (mkRdrUnqual $1)) $2 (noLoc []) (PrefixCon (map unbangedType $3))} + { noLoc $ ConDecl (noLoc (mkRdrUnqual $1)) $2 (noLoc []) (PrefixCon $3)} + | d_pat_occ '::' ty + { noLoc $ GadtDecl (noLoc (mkRdrUnqual $1)) (toHsType $3) } attv_bndrs :: { [LHsTyVarBndr RdrName] } : {- empty -} { [] } @@ -218,8 +219,9 @@ exp :: { IfaceExpr } : fexp { $1 } | '\\' bndrs '->' exp { foldr IfaceLam $4 $2 } | '%let' let_bind '%in' exp { IfaceLet $2 $4 } - | '%case' aexp '%of' id_bndr - '{' alts1 '}' { IfaceCase $2 (fst $4) $6 } +-- gaw 2004 + | '%case' '(' ty ')' aexp '%of' id_bndr + '{' alts1 '}' { IfaceCase $5 (fst $7) $3 $9 } | '%coerce' aty exp { IfaceNote (IfaceCoerce $2) $3 } | '%note' STRING exp { case $2 of