relaxed the ;-terminator requirement for parameters

This commit is contained in:
ceriel
1991-08-23 16:23:07 +00:00
parent 3c221691b3
commit b1fdacb99c
6 changed files with 25 additions and 42 deletions

View File

@@ -348,21 +348,28 @@ getparams() {
register int l;
long ftell();
char first;
char add_semi = ' ';
first = ' ';
/* save offset in file to be able to copy the declaration later */
off = ftell(fact);
/* First pass through declaration, find the parameter names */
ltext[0] = '\0';
while ((l = gettok()) != ENDDECL) {
if (l == ';' || l == ',') {
if ((l == ';' || l == ',') && ltext[0] != '\0') {
/*
* The last identifier found before a ';' or a ','
* must be a parameter
*/
fprintf(fpars,"%c%s", first, ltext);
first = ',';
ltext[0] = '\0';
}
}
if (ltext[0] != '\0') {
fprintf(fpars, "%c%s", first, ltext);
add_semi = ';';
}
fputs(") ",fpars);
/*
* Now copy the declarations
@@ -372,7 +379,7 @@ getparams() {
*/
fseek(fact,off,0);
getaction(0);
fputs(" {\n",fpars);
fprintf(fpars, "%c {\n",add_semi);
}
STATIC