From: simonpj Date: Tue, 4 Feb 2003 12:40:01 +0000 (+0000) Subject: [project @ 2003-02-04 12:40:00 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~1211 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=74775c6b3cb5c511af4312868ee26bdea18a0fd7;hp=e6d004928bcd0e71ba58c034b6fe4c870e6a70cb;p=ghc-hetmet.git [project @ 2003-02-04 12:40:00 by simonpj] Make utils/genprimopcode recognise the type (). It was previously written 'Unit', which is easily confused with the type 'Unit' (used for generic derived instances). --- diff --git a/ghc/compiler/prelude/primops.txt.pp b/ghc/compiler/prelude/primops.txt.pp index 33c5ae5..a361c0c 100644 --- a/ghc/compiler/prelude/primops.txt.pp +++ b/ghc/compiler/prelude/primops.txt.pp @@ -1,5 +1,5 @@ ----------------------------------------------------------------------- --- $Id: primops.txt.pp,v 1.23 2002/12/11 15:36:35 simonmar Exp $ +-- $Id: primops.txt.pp,v 1.24 2003/02/04 12:40:00 simonpj Exp $ -- -- Primitive Operations -- @@ -1481,7 +1481,7 @@ primop DeRefWeakOp "deRefWeak#" GenPrimOp primop FinalizeWeakOp "finalizeWeak#" GenPrimOp Weak# a -> State# RealWorld -> (# State# RealWorld, Int#, - (State# RealWorld -> (# State# RealWorld, Unit #)) #) + (State# RealWorld -> (# State# RealWorld, () #)) #) with usage = { mangle FinalizeWeakOp [mkM, mkP] (mkR . (inUB FinalizeWeakOp diff --git a/ghc/utils/genprimopcode/Main.hs b/ghc/utils/genprimopcode/Main.hs index 49d3921..d92d3a9 100644 --- a/ghc/utils/genprimopcode/Main.hs +++ b/ghc/utils/genprimopcode/Main.hs @@ -383,7 +383,7 @@ ppType (TyApp "RealWorld" []) = "realWorldTy" ppType (TyApp "ThreadId#" []) = "threadIdPrimTy" ppType (TyApp "ForeignObj#" []) = "foreignObjPrimTy" ppType (TyApp "BCO#" []) = "bcoPrimTy" -ppType (TyApp "Unit" []) = "unitTy" -- dodgy +ppType (TyApp "()" []) = "unitTy" -- unitTy is TysWiredIn's name for () ppType (TyVar "a") = "alphaTy" @@ -647,7 +647,7 @@ ppT = alts [apply TyVar pTyvar, ] pTyvar = sat (`notElem` ["section","primop","with"]) pName -pTycon = pConstructor +pTycon = alts [pConstructor, lexeme (string "()")] pName = lexeme (then2 (:) lower (many isIdChar)) pConstructor = lexeme (then2 (:) upper (many isIdChar))