* included in the distribution.
*
* $RCSfile: storage.c,v $
- * $Revision: 1.41 $
- * $Date: 2000/02/08 15:32:30 $
+ * $Revision: 1.44 $
+ * $Date: 2000/02/24 14:05:55 $
* ------------------------------------------------------------------------*/
#include "prelude.h"
}
Bool isPreludeScript() { /* Test whether this is the Prelude*/
- return (scriptHw==0);
+ return (scriptHw < N_PRELUDE_SCRIPTS /*==0*/ );
}
Bool moduleThisScript(m) /* Test if given module is defined */
Module m; { /* in current script file */
- return scriptHw<1 || m>=scripts[scriptHw-1].moduleHw;
+ return scriptHw < 1
+ || m>=scripts[scriptHw-1].moduleHw;
}
Module lastModule() { /* Return module in current script file */
: pair(INTCELL,n);
}
-#if SIZEOF_INTP == SIZEOF_INT
+#if SIZEOF_VOID_P == SIZEOF_INT
typedef union {Int i; Ptr p;} IntOrPtr;
Cell mkPtr(p)
Ptr p;
x.i = snd(c);
return x.p;
}
-#elif SIZEOF_INTP == 2*SIZEOF_INT
+#elif SIZEOF_VOID_P == 2*SIZEOF_INT
typedef union {struct {Int i1; Int i2;} i; Ptr p;} IntOrPtr;
Cell mkPtr(p)
Ptr p;
if (isTycon(t)) return textToStr(tycon(t).text); else return "??";
}
+static String maybeClassStr ( Class c )
+{
+ if (isClass(c)) return textToStr(cclass(c).text); else return "??";
+}
+
static String maybeText ( Text t )
{
if (isNull(t)) return "(nil)";
printf ( "{\n" );
printf ( " text: %s\n", textToStr(tycon(t).text) );
printf ( " line: %d\n", tycon(t).line );
- printf ( " mod: %d %s\n", tycon(t).mod,
- maybeModuleStr(tycon(t).mod));
+ printf ( " mod: %s\n", maybeModuleStr(tycon(t).mod));
printf ( " tuple: %d\n", tycon(t).tuple);
printf ( " arity: %d\n", tycon(t).arity);
printf ( " kind: "); print100(tycon(t).kind);
printf ( "{\n" );
printf ( " text: %s\n", textToStr(name(n).text) );
printf ( " line: %d\n", name(n).line );
- printf ( " mod: %d %s\n", name(n).mod,
- maybeModuleStr(name(n).mod));
+ printf ( " mod: %s\n", maybeModuleStr(name(n).mod));
printf ( " syntax: %d\n", name(n).syntax );
printf ( " parent: %d\n", name(n).parent );
printf ( " arity: %d\n", name(n).arity );
printf ( "{\n" );
printf ( " text: %s\n", textToStr(cclass(c).text) );
printf ( " line: %d\n", cclass(c).line );
- printf ( " mod: %d %s\n", cclass(c).mod,
- maybeModuleStr(cclass(c).mod));
+ printf ( " mod: %s\n", maybeModuleStr(cclass(c).mod));
printf ( " arity: %d\n", cclass(c).arity );
printf ( " level: %d\n", cclass(c).level );
printf ( " kinds: "); print100( cclass(c).kinds );
return;
}
printf ( "{\n" );
-// printf ( " text: %s\n", textToStr(cclass(c)).text) );
+ printf ( " class: %s\n", maybeClassStr(inst(i).c) );
+ printf ( " line: %d\n", inst(i).line );
+ printf ( " mod: %s\n", maybeModuleStr(inst(i).mod));
+ printf ( " kinds: "); print100( inst(i).kinds );
+ printf ( " head: "); print100( inst(i).head );
+ printf ( " specs: "); print100( inst(i).specifics );
+ printf ( " #specs: %d\n", inst(i).numSpecifics );
+ printf ( " impls: "); print100( inst(i).implements );
+ printf ( " builder: %s\n", maybeNameStr( inst(i).builder ) );
printf ( "}\n" );
}