version 1.44, 2013/11/01 17:54:37 |
version 1.45, 2013/11/22 15:47:35 |
|
|
For *arg; |
For *arg; |
unsigned long n; |
unsigned long n; |
|
|
while (isspace(*ptr)) |
while (ISSPACE(*ptr)) |
ptr++; |
ptr++; |
|
|
/* Parse loop. */ |
/* Parse loop. */ |
|
|
|
|
for (;;) { |
for (;;) { |
/* Grab the variables. */ |
/* Grab the variables. */ |
for (wrd = ptr; *ptr && !isspace(*ptr); ptr++) |
for (wrd = ptr; *ptr && !ISSPACE(*ptr); ptr++) |
continue; |
continue; |
if (ptr - wrd == 0) { |
if (ptr - wrd == 0) { |
Parse_Error(PARSE_FATAL, "Syntax error in for"); |
Parse_Error(PARSE_FATAL, "Syntax error in for"); |
return 0; |
return 0; |
} |
} |
endVar = ptr++; |
endVar = ptr++; |
while (isspace(*ptr)) |
while (ISSPACE(*ptr)) |
ptr++; |
ptr++; |
/* End of variable list ? */ |
/* End of variable list ? */ |
if (endVar - wrd == 2 && wrd[0] == 'i' && wrd[1] == 'n') |
if (endVar - wrd == 2 && wrd[0] == 'i' && wrd[1] == 'n') |
|
|
|
|
if (*ptr == '.') { |
if (*ptr == '.') { |
|
|
for (ptr++; isspace(*ptr); ptr++) |
for (ptr++; ISSPACE(*ptr); ptr++) |
continue; |
continue; |
|
|
if (strncmp(ptr, "endfor", 6) == 0 && |
if (strncmp(ptr, "endfor", 6) == 0 && |
(isspace(ptr[6]) || !ptr[6])) { |
(ISSPACE(ptr[6]) || !ptr[6])) { |
if (DEBUG(FOR)) |
if (DEBUG(FOR)) |
(void)fprintf(stderr, "For: end for %lu\n", |
(void)fprintf(stderr, "For: end for %lu\n", |
arg->level); |
arg->level); |
|
|
return false; |
return false; |
} |
} |
else if (strncmp(ptr, "for", 3) == 0 && |
else if (strncmp(ptr, "for", 3) == 0 && |
isspace(ptr[3])) { |
ISSPACE(ptr[3])) { |
arg->level++; |
arg->level++; |
if (DEBUG(FOR)) |
if (DEBUG(FOR)) |
(void)fprintf(stderr, "For: new loop %lu\n", |
(void)fprintf(stderr, "For: new loop %lu\n", |