* included in the distribution.
*
* $RCSfile: connect.h,v $
- * $Revision: 1.22 $
- * $Date: 1999/12/20 16:55:26 $
+ * $Revision: 1.23 $
+ * $Date: 2000/01/07 16:56:47 $
* ------------------------------------------------------------------------*/
/* --------------------------------------------------------------------------
extern Void getFileSize Args((String, Long *));
extern ZPair readInterface Args((String,Long));
-extern Void processInterfaces Args((Void));
+extern Bool processInterfaces Args((Void));
extern List /* of ZTriple(I_INTERFACE,
Text--name of obj file,
* included in the distribution.
*
* $RCSfile: hugs.c,v $
- * $Revision: 1.32 $
- * $Date: 2000/01/05 19:10:21 $
+ * $Revision: 1.33 $
+ * $Date: 2000/01/07 16:56:47 $
* ------------------------------------------------------------------------*/
#include <setjmp.h>
/* Return TRUE if no imports were needed; FALSE otherwise. */
static Bool local addScript(stacknum) /* read single file */
Int stacknum; {
+ Bool didPrelude;
static char name[FILENAME_MAX+1];
Int len = scriptInfo[stacknum].size;
scriptFile = name;
if (scriptInfo[stacknum].fromSource) {
- if (lastWasObject) processInterfaces();
+ if (lastWasObject) {
+ didPrelude = processInterfaces();
+ if (didPrelude) {
+ preludeLoaded = TRUE;
+ everybody(POSTPREL);
+ }
+ }
lastWasObject = FALSE;
Printf("Reading script \"%s\":\n",name);
needsImports = FALSE;
scriptFile = 0;
- if (strcmp(scriptInfo[stacknum].modName, "Prelude")==0) {
- preludeLoaded = TRUE;
- everybody(POSTPREL);
- }
return TRUE;
}
Time timeStamp; /* including the first script which*/
Long fileSize; /* has been either changed or added*/
static char name[FILENAME_MAX+1];
+ Bool didPrelude;
lastWasObject = FALSE;
ppSmStack("readscripts-begin");
if (numScripts==namesUpto) ppSmStack( "readscripts-final") ;
}
- processInterfaces();
+ didPrelude = processInterfaces();
+ if (didPrelude) {
+ preludeLoaded = TRUE;
+ everybody(POSTPREL);
+ }
+
{ Int m = namesUpto-1;
Text mtext = findText(scriptInfo[m].modName);
* Hugs version 1.4, December 1997
*
* $RCSfile: interface.c,v $
- * $Revision: 1.22 $
- * $Date: 2000/01/07 15:31:12 $
+ * $Revision: 1.23 $
+ * $Date: 2000/01/07 16:56:47 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
/* ifaces_outstanding holds a list of parsed interfaces
for which we need to load objects and create symbol
table entries.
+
+ Return TRUE if Prelude `elem` ifaces_outstanding, else FALSE.
*/
-Void processInterfaces ( void )
+Bool processInterfaces ( void )
{
List tmp;
List xs;
Module mod;
List all_known_types;
Int num_known_types;
+ Bool didPrelude;
List ifaces = NIL; /* :: List I_INTERFACE */
List iface_sizes = NIL; /* :: List Int */
List iface_onames = NIL; /* :: List Text */
- if (isNull(ifaces_outstanding)) return;
+ if (isNull(ifaces_outstanding)) return FALSE;
fprintf ( stderr,
"processInterfaces: %d interfaces to process\n",
calling the finishGHC* functions. But don't process
the export lists; those must wait for later.
*/
+ didPrelude = FALSE;
for (xs = ifaces; nonNull(xs); xs = tl(xs)) {
iface = unap(I_INTERFACE,hd(xs));
mname = textOf(zfst(iface));
setCurrModule(mod);
ppModule ( module(mod).text );
+ if (mname == textPrelude) didPrelude = TRUE;
+
for (decls = zsnd(iface); nonNull(decls); decls = tl(decls)) {
Cell decl = hd(decls);
switch(whatIs(decl)) {
/* Finished! */
ifaces_outstanding = NIL;
+
+ return didPrelude;
}
Name mn;
/* Stick the new context on the member type */
+ memT = dictapsToQualtype(memT);
if (whatIs(memT)==POLYTYPE) internal("startGHCClass");
if (whatIs(memT)==QUAL) {
memT = pair(QUAL,
* included in the distribution.
*
* $RCSfile: storage.c,v $
- * $Revision: 1.31 $
- * $Date: 2000/01/06 16:33:10 $
+ * $Revision: 1.32 $
+ * $Date: 2000/01/07 16:56:47 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
if (*s != 'T') goto parse_error;
s++;
p[n++] = '(';
- while (i >= 0) { p[n++] = ','; i--; };
+ while (i > 0) { p[n++] = ','; i--; };
p[n++] = ')';
break;
default:
if (tycon(i).tuple == n) return i;
if (combined)
- m = findFakeModule(findText(n<=1 ? "PrelBase" : "PrelTup")); else
+ m = findFakeModule(findText(n==0 ? "PrelBase" : "PrelTup")); else
m = findModule(findText("Prelude"));
setCurrModule(m);