Browse Source

lexical #15/19, drop `delayed' which is never zero ...

rlar 14 years ago
parent
commit
43a6d59c72
  1. 14
      src/frontend/parser/lexical.c

14
src/frontend/parser/lexical.c

@ -85,10 +85,8 @@ static int numeofs = 0;
} }
#define newword \ #define newword \
if (delayed) append; \
delayed = 0; \
append; \
cw->wl_word = copy(buf); \ cw->wl_word = copy(buf); \
delayed = 1; \
bzero(buf, NEW_BSIZE_SP); \ bzero(buf, NEW_BSIZE_SP); \
i = 0; i = 0;
@ -121,7 +119,6 @@ cp_lexer(char *string)
wordlist *wlist = NULL, *cw = NULL; wordlist *wlist = NULL, *cw = NULL;
char buf[NEW_BSIZE_SP], linebuf[NEW_BSIZE_SP]; char buf[NEW_BSIZE_SP], linebuf[NEW_BSIZE_SP];
int paren; int paren;
int delayed;
if (cp_inp_cur == NULL) if (cp_inp_cur == NULL)
cp_inp_cur = cp_in; cp_inp_cur = cp_in;
@ -137,7 +134,6 @@ nloop:
paren = 0; paren = 0;
bzero(linebuf, NEW_BSIZE_SP); bzero(linebuf, NEW_BSIZE_SP);
bzero(buf, NEW_BSIZE_SP); bzero(buf, NEW_BSIZE_SP);
delayed = 1;
for (;;) { for (;;) {
if (string) { if (string) {
c = *string++; c = *string++;
@ -175,7 +171,7 @@ gotchar:
if ((c == EOF) && cp_bqflag) if ((c == EOF) && cp_bqflag)
c = '\n'; c = '\n';
if ((c == cp_hash) && !cp_interactive && (j == 1)) { if ((c == cp_hash) && !cp_interactive && (j == 1)) {
if (delayed) append;
append;
if (string) if (string)
return (NULL); return (NULL);
while (((c = input(cp_inp_cur)) != '\n') && (c != EOF)) while (((c = input(cp_inp_cur)) != '\n') && (c != EOF))
@ -202,7 +198,7 @@ gotchar:
buf[i] = '\0'; buf[i] = '\0';
newword; newword;
} }
if (delayed) append;
append;
if (cw->wl_prev) { if (cw->wl_prev) {
cw->wl_prev->wl_next = NULL; cw->wl_prev->wl_next = NULL;
tfree(cw); tfree(cw);
@ -250,7 +246,7 @@ gotchar:
case '\004': case '\004':
case EOF: case EOF:
if (delayed) append;
append;
if (cp_interactive && !cp_nocc && if (cp_interactive && !cp_nocc &&
(string == NULL)) { (string == NULL)) {
if (j == 0) { if (j == 0) {
@ -297,7 +293,7 @@ gotchar:
#else #else
fputc(linebuf[j], cp_out); /* But you can't edit */ fputc(linebuf[j], cp_out); /* But you can't edit */
#endif #endif
if (delayed) append;
append;
// cp_ccom doesn't mess wlist, read only access to wlist->wl_word // cp_ccom doesn't mess wlist, read only access to wlist->wl_word
cp_ccom(wlist, buf, TRUE); cp_ccom(wlist, buf, TRUE);
wl_free(wlist); wl_free(wlist);

Loading…
Cancel
Save