Commit 1e9417e3 authored by dcw's avatar dcw
Browse files

realised was necessary to put all the pointer type declns at the top;

required a few changes to impln_declns
parent eab25d89
......@@ -231,10 +231,11 @@ static void defn_onetype( d ) decln d;
/* ----------------------- Implementation module ------------------------- */
static void impln_declns( globals, modulename, d ) char *globals, *modulename; declnlist d;
static void impln_declns( globals, modulename, decs ) char *globals, *modulename; declnlist decs;
{
FILE *implnfile;
char tempname[256];
declnlist d;
sprintf( tempname, "%s.mod", modulename );
implnfile = fopen( tempname, "w" );
......@@ -267,14 +268,24 @@ static void impln_declns( globals, modulename, d ) char *globals, *modulename; d
nl();
}
for( ; d != NULL; d=d->next )
line( "(* Pointer type declarations *)" );
line( "TYPE" );
indent();
for( d = decs; d != NULL; d=d->next )
{
impln_onetype( d );
if( d->Struct )
{
line( "%s\t= POINTER TO %sRec;", d->name, d->name );
nl();
}
}
if( print )
outdent();
for( d = decs; d != NULL; d=d->next )
{
write_bool();
impln_onetype( d );
}
write_bool();
line( "BEGIN" );
line( "END %s.", modulename );
......@@ -294,9 +305,6 @@ static void impln_onetype( d ) decln d;
{
line( "TYPE" );
indent();
line( "%s\t= POINTER TO %sRec;", d->name, d->name );
nl();
line( "%sRec = RECORD", d->name );
indent();
......@@ -337,10 +345,7 @@ static void impln_onetype( d ) decln d;
}
}
if( print )
{
printproc_body( d );
}
printproc_body( d );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment