diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2012-12-17 19:50:31 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2012-12-17 19:51:41 +0100 |
commit | 049f4be0b89188e1bc3e19e75c0675dd2356d3ef (patch) | |
tree | 7b6cc1a6611683b28888f8f7172ce8ceba773c30 /Src/parse.c | |
parent | 015e05572733aafd2a005edd507d16e2310653a0 (diff) | |
parent | 7152094541a54c92ff937413f850e09412585b7b (diff) | |
download | zsh-049f4be0b89188e1bc3e19e75c0675dd2356d3ef.tar.gz zsh-049f4be0b89188e1bc3e19e75c0675dd2356d3ef.zip |
New upstream test release
Diffstat (limited to 'Src/parse.c')
-rw-r--r-- | Src/parse.c | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/Src/parse.c b/Src/parse.c index e4d038b6e..0f5d99cef 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -666,7 +666,8 @@ par_sublist(int *complex) *complex |= c; if (tok == DBAR || tok == DAMPER) { - int qtok = tok, sl; + enum lextok qtok = tok; + int sl; cmdpush(tok == DBAR ? CS_CMDOR : CS_CMDAND); zshlex(); @@ -1176,7 +1177,8 @@ par_case(int *complex) static void par_if(int *complex) { - int oecused = ecused, xtok, p, pp, type, usebrace = 0; + int oecused = ecused, p, pp, type, usebrace = 0; + enum lextok xtok; unsigned char nc; p = ecadd(0); @@ -1367,7 +1369,8 @@ par_repeat(int *complex) static void par_subsh(int *complex) { - int oecused = ecused, otok = tok, p, pp; + enum lextok otok = tok; + int oecused = ecused, p, pp; p = ecadd(0); /* Extra word only needed for always block */ @@ -1607,6 +1610,11 @@ par_simple(int *complex, int nr) } else if (tok == ENVARRAY) { int oldcmdpos = incmdpos, n, type2; + /* + * We consider array setting complex because it can + * contain process substitutions, which need a valid job. + */ + *complex = c = 1; p = ecadd(0); incmdpos = 0; if ((type2 = strlen(tokstr) - 1) && tokstr[type2] == '+') { @@ -2110,7 +2118,7 @@ par_cond_2(void) && !s1[2]); condlex(); if (tok == INANG || tok == OUTANG) { - int xtok = tok; + enum lextok xtok = tok; condlex(); if (tok != STRING) YYERROR(ecused); @@ -2371,7 +2379,7 @@ freeeprog(Eprog p) /**/ char * -ecgetstr(Estate s, int dup, int *tok) +ecgetstr(Estate s, int dup, int *tokflag) { static char buf[4]; wordcode c = *s->pc++; @@ -2389,8 +2397,8 @@ ecgetstr(Estate s, int dup, int *tok) } else { r = s->strs + (c >> 2); } - if (tok) - *tok = (c & 1); + if (tokflag) + *tokflag = (c & 1); /*** Since function dump files are mapped read-only, avoiding to * to duplicate strings when they don't contain tokens may fail @@ -2407,33 +2415,33 @@ ecgetstr(Estate s, int dup, int *tok) /**/ char * -ecrawstr(Eprog p, Wordcode pc, int *tok) +ecrawstr(Eprog p, Wordcode pc, int *tokflag) { static char buf[4]; wordcode c = *pc; if (c == 6 || c == 7) { - if (tok) - *tok = (c & 1); + if (tokflag) + *tokflag = (c & 1); return ""; } else if (c & 2) { buf[0] = (char) ((c >> 3) & 0xff); buf[1] = (char) ((c >> 11) & 0xff); buf[2] = (char) ((c >> 19) & 0xff); buf[3] = '\0'; - if (tok) - *tok = (c & 1); + if (tokflag) + *tokflag = (c & 1); return buf; } else { - if (tok) - *tok = (c & 1); + if (tokflag) + *tokflag = (c & 1); return p->strs + (c >> 2); } } /**/ char ** -ecgetarr(Estate s, int num, int dup, int *tok) +ecgetarr(Estate s, int num, int dup, int *tokflag) { char **ret, **rp; int tf = 0, tmp = 0; @@ -2445,15 +2453,15 @@ ecgetarr(Estate s, int num, int dup, int *tok) tf |= tmp; } *rp = NULL; - if (tok) - *tok = tf; + if (tokflag) + *tokflag = tf; return ret; } /**/ LinkList -ecgetlist(Estate s, int num, int dup, int *tok) +ecgetlist(Estate s, int num, int dup, int *tokflag) { if (num) { LinkList ret; @@ -2464,12 +2472,12 @@ ecgetlist(Estate s, int num, int dup, int *tok) setsizednode(ret, i, ecgetstr(s, dup, &tmp)); tf |= tmp; } - if (tok) - *tok = tf; + if (tokflag) + *tokflag = tf; return ret; } - if (tok) - *tok = 0; + if (tokflag) + *tokflag = 0; return NULL; } @@ -3479,7 +3487,7 @@ dump_autoload(char *nam, char *file, int on, Options ops, int func) shf = (Shfunc) zshcalloc(sizeof *shf); shf->node.flags = on; shf->funcdef = mkautofn(shf); - shf->emulation = 0; + shf->sticky = NULL; shfunctab->addnode(shfunctab, ztrdup(fdname(n) + fdhtail(n)), shf); if (OPT_ISSET(ops,'X') && eval_autoload(shf, shf->node.nam, ops, func)) ret = 1; |