From 48fd138cd94a488d519d79dd64281ca6d7a72ff1 Mon Sep 17 00:00:00 2001 From: sewardj Date: Fri, 7 Jan 2000 17:49:29 +0000 Subject: [PATCH] [project @ 2000-01-07 17:49:29 by sewardj] type.c: implement typechecker(POSTPREL), so that initialisation of the typechecker is completed correctly in combined mode. storage.c(addTupleTycon): create a name table entry for () so that nameUnit in the above can be bound to something. --- ghc/interpreter/link.c | 9 ++++----- ghc/interpreter/storage.c | 18 +++++++++++++----- ghc/interpreter/type.c | 26 +++++++++++++++++++++----- 3 files changed, 38 insertions(+), 15 deletions(-) diff --git a/ghc/interpreter/link.c b/ghc/interpreter/link.c index 2c4e52a..74186f3 100644 --- a/ghc/interpreter/link.c +++ b/ghc/interpreter/link.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: link.c,v $ - * $Revision: 1.26 $ - * $Date: 2000/01/06 16:33:10 $ + * $Revision: 1.27 $ + * $Date: 2000/01/07 17:49:29 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -490,11 +490,10 @@ Int what; { break; case POSTPREL: -#if 0 +#if 1 fprintf(stderr, "linkControl(POSTPREL)\n"); #endif -if (combined) assert(0); -break; + break; case PREPREL : diff --git a/ghc/interpreter/storage.c b/ghc/interpreter/storage.c index d18eabf..b35bb94 100644 --- a/ghc/interpreter/storage.c +++ b/ghc/interpreter/storage.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: storage.c,v $ - * $Revision: 1.32 $ - * $Date: 2000/01/07 16:56:47 $ + * $Revision: 1.33 $ + * $Date: 2000/01/07 17:49:29 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -803,10 +803,11 @@ Name addWiredInBoxingTycon Tycon addTupleTycon ( Int n ) { - Int i; - Kind k; - Tycon t; + Int i; + Kind k; + Tycon t; Module m; + Name nm; for (i = TYCMIN; i < tyconHw; i++) if (tycon(i).tuple == n) return i; @@ -822,6 +823,13 @@ Tycon addTupleTycon ( Int n ) tycon(t).kind = k; tycon(t).tuple = n; tycon(t).what = DATATYPE; + + if (n == 0) { + /* maybe we want to do this for all n ? */ + nm = newName(ghcTupleText_n(n), t); + name(nm).type = t; /* ummm ... for n > 0 */ + } + return t; } diff --git a/ghc/interpreter/type.c b/ghc/interpreter/type.c index bd653fd..e2f8277 100644 --- a/ghc/interpreter/type.c +++ b/ghc/interpreter/type.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: type.c,v $ - * $Revision: 1.20 $ - * $Date: 1999/12/16 16:34:46 $ + * $Revision: 1.21 $ + * $Date: 2000/01/07 17:49:29 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -2795,7 +2795,20 @@ Int what; { mark(typeProgIO); break; - case POSTPREL: break; + case POSTPREL: + + if (combined) { + setCurrModule(modulePrelude); + dummyVar = inventVar(); + typeUnit = mkTuple(0); + arrow = fn(aVar,bVar); + listof = ap(typeList,aVar); + boundPair = ap(ap(mkTuple(2),aVar),aVar); + nameUnit = findQualNameWithoutConsultingExportList + (mkQVar(findText("PrelBase"), + findText("()"))); + } + break; case PREPREL : typeChecker(RESET); @@ -2834,8 +2847,11 @@ Int what; { starToStar = simpleKind(1); - typeUnit = addPrimTycon(findText("()"), - STAR,0,DATATYPE,NIL); + typeUnit = //addPrimTycon(findText("()"), + // STAR,0,DATATYPE,NIL); + findTycon(findText("()")); + assert(nonNull(typeUnit)); + typeArrow = addPrimTycon(findText("(->)"), simpleKind(2),2, DATATYPE,NIL); -- 1.7.10.4