Commit f005c993 authored by dcw's avatar dcw

added @@ code to GLOBAL and EXPORT sections

parent 592b4fb6
......@@ -95,6 +95,7 @@ void make_declns( exports, globals, d, basename ) declnlist d; char *exports, *g
#define outdent() numtabs--
#define nl() fputc( '\n', outfile )
#define outchar(c) fputc( c, outfile )
#define usefile(f) outfile = f, numtabs = 0
......@@ -117,6 +118,7 @@ static void defn_declns( exports, modulename, decs ) char *exports, *modulename;
FILE *defnfile;
char tempname[256];
declnlist d;
char *exportptr;
sprintf( tempname, "%s.def", modulename );
defnfile = fopen( tempname, "w" );
......@@ -137,8 +139,21 @@ static void defn_declns( exports, modulename, decs ) char *exports, *modulename;
if( *exports != '\0' )
{
int i;
line( "(* Contents of EXPORT section *)" );
line( exports );
for( exportptr=exports; *exportptr; exportptr++ )
{
if( *exportptr == '@' && exportptr[1] == '@'
&& exportptr[2] == '\n' )
{
exportptr += 2;
break;
}
outchar( *exportptr );
}
nl();
nl();
}
......@@ -163,6 +178,14 @@ static void defn_declns( exports, modulename, decs ) char *exports, *modulename;
{
defn_onetype( d );
}
if( *exportptr != '\0' )
{
nl();
line( "(* Remaining contents of EXPORT section *)" );
line( exportptr );
nl();
}
line( "END %s.", modulename );
nl();
fclose( defnfile );
......@@ -233,6 +256,7 @@ static void impln_declns( globals, modulename, decs ) char *globals, *modulename
FILE *implnfile;
char tempname[256];
declnlist d;
char *globalptr;
sprintf( tempname, "%s.mod", modulename );
implnfile = fopen( tempname, "w" );
......@@ -262,7 +286,17 @@ static void impln_declns( globals, modulename, decs ) char *globals, *modulename
if( *globals != '\0' )
{
line( "(* Contents of GLOBAL section *)" );
line( globals );
for( globalptr=globals; *globalptr; globalptr++ )
{
if( *globalptr == '@' && globalptr[1] == '@'
&& globalptr[2] == '\n' )
{
globalptr += 2;
break;
}
outchar( *globalptr );
}
nl();
}
......@@ -284,6 +318,14 @@ static void impln_declns( globals, modulename, decs ) char *globals, *modulename
impln_onetype( d );
}
write_bool();
if( *globalptr != '\0' )
{
nl();
nl();
line( "(* Remaining contents of GLOBAL section *)" );
line( globalptr );
nl();
}
line( "BEGIN" );
line( "END %s.", modulename );
......
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