version 1.22, 2005/08/09 21:36:42 |
version 1.23, 2006/10/15 08:38:21 |
Line 245 For_Eval(char *line) |
|
Line 245 For_Eval(char *line) |
|
if (DEBUG(FOR)) { |
if (DEBUG(FOR)) { |
int i; |
int i; |
for (i = 0; i < accumFor.nvars; i++) { |
for (i = 0; i < accumFor.nvars; i++) { |
(void)fprintf(stderr, "For: variable %s\n", accumFor.vars[i]); |
(void)fprintf(debug_file, "For: variable %s\n", accumFor.vars[i]); |
} |
} |
(void)fprintf(stderr, "For: list %s\n", sub); |
(void)fprintf(debug_file, "For: list %s\n", sub); |
} |
} |
if (ptr - wrd > 0) |
if (ptr - wrd > 0) |
ADDWORD(); |
ADDWORD(); |
Line 267 For_Eval(char *line) |
|
Line 267 For_Eval(char *line) |
|
if (strncmp(ptr, "endfor", 6) == 0 && |
if (strncmp(ptr, "endfor", 6) == 0 && |
(isspace((unsigned char) ptr[6]) || !ptr[6])) { |
(isspace((unsigned char) ptr[6]) || !ptr[6])) { |
if (DEBUG(FOR)) |
if (DEBUG(FOR)) |
(void)fprintf(stderr, "For: end for %d\n", forLevel); |
(void)fprintf(debug_file, "For: end for %d\n", forLevel); |
if (--forLevel < 0) { |
if (--forLevel < 0) { |
Parse_Error(level, "for-less endfor"); |
Parse_Error(level, "for-less endfor"); |
return 0; |
return 0; |
Line 277 For_Eval(char *line) |
|
Line 277 For_Eval(char *line) |
|
isspace((unsigned char) ptr[3])) { |
isspace((unsigned char) ptr[3])) { |
forLevel++; |
forLevel++; |
if (DEBUG(FOR)) |
if (DEBUG(FOR)) |
(void)fprintf(stderr, "For: new loop %d\n", forLevel); |
(void)fprintf(debug_file, "For: new loop %d\n", forLevel); |
} |
} |
} |
} |
|
|
Line 351 For_Run(int lineno) |
|
Line 351 For_Run(int lineno) |
|
for (i = 0; i < arg.nvars; i++) { |
for (i = 0; i < arg.nvars; i++) { |
Var_Set(arg.vars[i], values[i], VAR_GLOBAL, 0); |
Var_Set(arg.vars[i], values[i], VAR_GLOBAL, 0); |
if (DEBUG(FOR)) |
if (DEBUG(FOR)) |
(void)fprintf(stderr, "--- %s = %s\n", arg.vars[i], |
(void)fprintf(debug_file, "--- %s = %s\n", arg.vars[i], |
values[i]); |
values[i]); |
} |
} |
|
|