1 /* $OpenBSD: syn.c,v 1.30 2015/09/01 13:12:31 tedu Exp $ */
4 * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009,
5 * 2011, 2012, 2013, 2014, 2015, 2016
6 * mirabilos <m@mirbsd.org>
8 * Provided that these terms and disclaimer and all copyright notices
9 * are retained or reproduced in an accompanying document, permission
10 * is granted to deal in this work without restriction, including un-
11 * limited rights to use, publicly perform, distribute, sell, modify,
12 * merge, give away, or sublicence.
14 * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
15 * the utmost extent permitted by applicable law, neither express nor
16 * implied; without malicious intent or gross negligence. In no event
17 * may a licensor, author or contributor be held liable for indirect,
18 * direct, other damage, loss, or other issues arising in any way out
19 * of dealing in the work, even if advised of the possibility of such
20 * damage or existence of a defect, except proven that it results out
21 * of said person's immediate fault when using the work as intended.
26 __RCSID("$MirOS: src/bin/mksh/syn.c,v 1.109 2016/01/19 23:12:15 tg Exp $");
28 struct nesting_state {
29 int start_token; /* token than began nesting (eg, FOR) */
30 int start_line; /* line nesting began on */
33 struct yyrecursive_state {
34 struct yyrecursive_state *next;
35 struct ioword **old_herep;
42 static void yyparse(void);
43 static struct op *pipeline(int);
44 static struct op *andor(void);
45 static struct op *c_list(bool);
46 static struct ioword *synio(int);
47 static struct op *nested(int, int, int);
48 static struct op *get_command(int);
49 static struct op *dogroup(void);
50 static struct op *thenpart(void);
51 static struct op *elsepart(void);
52 static struct op *caselist(void);
53 static struct op *casepart(int);
54 static struct op *function_body(char *, bool);
55 static char **wordlist(void);
56 static struct op *block(int, struct op *, struct op *);
57 static struct op *newtp(int);
58 static void syntaxerr(const char *) MKSH_A_NORETURN;
59 static void nesting_push(struct nesting_state *, int);
60 static void nesting_pop(struct nesting_state *);
61 static int inalias(struct source *) MKSH_A_PURE;
62 static Test_op dbtestp_isa(Test_env *, Test_meta);
63 static const char *dbtestp_getopnd(Test_env *, Test_op, bool);
64 static int dbtestp_eval(Test_env *, Test_op, const char *,
66 static void dbtestp_error(Test_env *, int, const char *) MKSH_A_NORETURN;
68 static struct op *outtree; /* yyparse output */
69 static struct nesting_state nesting; /* \n changed to ; */
71 static bool reject; /* token(cf) gets symbol again */
72 static int symbol; /* yylex value */
73 static int sALIAS = ALIAS; /* 0 in yyrecursive */
75 #define REJECT (reject = true)
76 #define ACCEPT (reject = false)
77 #define token(cf) ((reject) ? (ACCEPT, symbol) : (symbol = yylex(cf)))
78 #define tpeek(cf) ((reject) ? (symbol) : (REJECT, symbol = yylex(cf)))
79 #define musthave(c,cf) do { if (token(cf) != (c)) syntaxerr(NULL); } while (/* CONSTCOND */ 0)
81 static const char Tcbrace[] = "}";
82 static const char Tesac[] = "esac";
91 outtree = c_list(source->type == SSTRING);
93 if (c == 0 && !outtree)
94 outtree = newtp(TEOF);
95 else if (c != '\n' && c != 0)
102 struct op *t, *p, *tl = NULL;
106 while (token(0) == '|') {
107 if ((p = get_command(CONTIN)) == NULL)
110 t = tl = block(TPIPE, t, p);
112 tl = tl->right = block(TPIPE, tl->right, p);
127 while ((c = token(0)) == LOGAND || c == LOGOR) {
128 if ((p = pipeline(CONTIN)) == NULL)
130 t = block(c == LOGAND? TAND: TOR, t, p);
140 struct op *t = NULL, *p, *tl = NULL;
144 while (/* CONSTCOND */ 1) {
147 * Token has always been read/rejected at this point, so
148 * we don't worry about what flags to pass token()
152 if (c == '\n' && (multi || inalias(source))) {
154 /* ignore blank lines */
158 else if (c == '&' || c == COPROC)
159 p = block(c == '&' ? TASYNC : TCOPROC, p, NULL);
165 t = tl = block(TLIST, t, p);
167 tl = tl->right = block(TLIST, tl->right, p);
175 static const char IONDELIM_delim[] = { CHAR, '<', CHAR, '<', EOS };
177 static struct ioword *
181 static struct ioword *nextiop;
184 if (nextiop != NULL) {
190 if (tpeek(cf) != REDIR)
194 ishere = (iop->ioflag & IOTYPE) == IOHERE;
195 if (iop->ioflag & IOHERESTR) {
197 } else if (ishere && tpeek(HEREDELIM) == '\n') {
199 yylval.cp = wdcopy(IONDELIM_delim, ATEMP);
200 iop->ioflag |= IOEVAL | IONDELIM;
202 musthave(LWORD, ishere ? HEREDELIM : 0);
204 iop->delim = yylval.cp;
205 if (*ident != 0 && !(iop->ioflag & IOHERESTR)) {
207 iop->ioflag |= IOEVAL;
209 if (herep > &heres[HERES - 1])
210 yyerror("too many %ss\n", "<<");
213 iop->ioname = yylval.cp;
215 if (iop->ioflag & IOBASH) {
218 nextiop = alloc(sizeof(*iop), ATEMP);
219 #ifdef MKSH_CONSERVATIVE_FDS
220 nextiop->ioname = cp = alloc(3, ATEMP);
222 nextiop->ioname = cp = alloc(5, ATEMP);
226 *cp++ = digits_lc[iop->unit / 10];
230 *cp++ = digits_lc[iop->unit % 10];
233 iop->ioflag &= ~IOBASH;
235 nextiop->ioflag = IODUP;
236 nextiop->delim = NULL;
237 nextiop->heredoc = NULL;
243 nested(int type, int smark, int emark)
246 struct nesting_state old_nesting;
248 nesting_push(&old_nesting, smark);
250 musthave(emark, KEYWORD|sALIAS);
251 nesting_pop(&old_nesting);
252 return (block(type, t, NULL));
255 static const char let_cmd[] = {
256 QCHAR, 'l', CHAR, 'e', CHAR, 't', CHAR, ']', EOS
258 static const char setA_cmd0[] = {
259 QCHAR, 's', CHAR, 'e', CHAR, 't', EOS
261 static const char setA_cmd1[] = {
262 CHAR, '-', CHAR, 'A', EOS
264 static const char setA_cmd2[] = {
265 CHAR, '-', CHAR, '-', EOS
272 int c, iopn = 0, syniocf, lno;
273 struct ioword *iop, **iops;
275 struct nesting_state old_nesting;
277 /* NUFILE is small enough to leave this addition unchecked */
278 iops = alloc2((NUFILE + 1), sizeof(struct ioword *), ATEMP);
282 syniocf = KEYWORD|sALIAS;
283 switch (c = token(cf|KEYWORD|sALIAS|CMDASN)) {
295 syniocf &= ~(KEYWORD|sALIAS);
297 t->lineno = source->line;
298 goto get_command_begin;
299 while (/* CONSTCOND */ 1) {
300 bool check_assign_cmd;
302 if (XPsize(args) == 0) {
304 check_assign_cmd = true;
305 cf = sALIAS | CMDASN;
306 } else if (t->u.evalflags)
307 cf = CMDWORD | CMDASN;
312 while ((iop = synio(cf)) != NULL) {
314 yyerror("too many %ss\n",
323 * the iopn == 0 and XPsize(vars) == 0 are
324 * dubious but AT&T ksh acts this way
326 if (iopn == 0 && XPsize(vars) == 0 &&
328 if (assign_command(ident, false))
329 t->u.evalflags = DOVACHECK;
330 else if (strcmp(ident, Tcommand) != 0)
331 check_assign_cmd = false;
333 if ((XPsize(args) == 0 || Flag(FKEYWORD)) &&
334 is_wdvarassign(yylval.cp))
335 XPput(vars, yylval.cp);
337 XPput(args, yylval.cp);
341 if (XPsize(args) == 0 && XPsize(vars) == 1 &&
342 is_wdvarassign(yylval.cp)) {
345 /* wdarrassign: foo=(bar) */
348 /* manipulate the vars string */
349 tcp = XPptrv(vars)[(vars.len = 0)];
350 /* 'varname=' -> 'varname' */
351 tcp[wdscan(tcp, EOS) - tcp - 3] = EOS;
353 /* construct new args strings */
354 XPput(args, wdcopy(setA_cmd0, ATEMP));
355 XPput(args, wdcopy(setA_cmd1, ATEMP));
357 XPput(args, wdcopy(setA_cmd2, ATEMP));
359 /* slurp in words till closing paren */
360 while (token(CONTIN) == LWORD)
361 XPput(args, yylval.cp);
362 if (symbol != /*(*/ ')')
366 * Check for "> foo (echo hi)"
367 * which AT&T ksh allows (not
368 * POSIX, but not disallowed)
371 if (XPsize(args) == 0 &&
377 /* must be a function */
378 if (iopn != 0 || XPsize(args) != 1 ||
382 musthave(/*(*/')', 0);
383 t = function_body(XPptrv(args)[0], false);
395 int subshell_nesting_type_saved;
397 subshell_nesting_type_saved = subshell_nesting_type;
398 subshell_nesting_type = ')';
399 t = nested(TPAREN, '(', ')');
400 subshell_nesting_type = subshell_nesting_type_saved;
405 t = nested(TBRACE, '{', '}');
409 /* leave KEYWORD in syniocf (allow if (( 1 )) then ...) */
412 switch (token(LETEXPR)) {
423 XPput(args, wdcopy(let_cmd, ATEMP));
424 XPput(args, yylval.cp);
427 case DBRACKET: /* [[ .. ]] */
428 /* leave KEYWORD in syniocf (allow if [[ -n 1 ]] then ...) */
429 t = newtp(TDBRACKET);
434 te.flags = TEF_DBRACKET;
436 te.isa = dbtestp_isa;
437 te.getopnd = dbtestp_getopnd;
438 te.eval = dbtestp_eval;
439 te.error = dbtestp_error;
447 t = newtp((c == FOR) ? TFOR : TSELECT);
448 musthave(LWORD, CMDASN);
449 if (!is_wdvarname(yylval.cp, true))
450 yyerror("%s: %s\n", c == FOR ? "for" : Tselect,
452 strdupx(t->str, ident, ATEMP);
453 nesting_push(&old_nesting, c);
454 t->vars = wordlist();
456 nesting_pop(&old_nesting);
461 nesting_push(&old_nesting, c);
462 t = newtp((c == WHILE) ? TWHILE : TUNTIL);
463 t->left = c_list(true);
464 t->right = dogroup();
465 nesting_pop(&old_nesting);
472 nesting_push(&old_nesting, c);
473 t->left = caselist();
474 nesting_pop(&old_nesting);
478 nesting_push(&old_nesting, c);
480 t->left = c_list(true);
481 t->right = thenpart();
482 musthave(FI, KEYWORD|sALIAS);
483 nesting_pop(&old_nesting);
487 syniocf &= ~(KEYWORD|sALIAS);
491 t = block(TBANG, NULL, t);
495 syniocf &= ~(KEYWORD|sALIAS);
497 if (t && t->type == TCOM) {
498 t->str = alloc(2, ATEMP);
503 t = block(TTIME, t, NULL);
508 t = function_body(yylval.cp, true);
512 while ((iop = synio(syniocf)) != NULL) {
514 yyerror("too many %ss\n", "redirection");
523 iops = aresize2(iops, iopn, sizeof(struct ioword *), ATEMP);
527 if (t->type == TCOM || t->type == TDBRACKET) {
529 t->args = (const char **)XPclose(args);
531 t->vars = (char **)XPclose(vars);
538 t = block(TBRACE, t, NULL);
539 t->ioact = t->left->ioact;
540 t->left->ioact = NULL;
552 c = token(CONTIN|KEYWORD|sALIAS);
554 * A {...} can be used instead of do...done for for/select loops
555 * but not for while/until loops - we don't need to check if it
556 * is a while loop because it would have been parsed as part of
557 * the conditional command list...
566 musthave(c, KEYWORD|sALIAS);
575 musthave(THEN, KEYWORD|sALIAS);
577 t->left = c_list(true);
580 t->right = elsepart();
589 switch (token(KEYWORD|sALIAS|CMDASN)) {
591 if ((t = c_list(true)) == NULL)
597 t->left = c_list(true);
598 t->right = thenpart();
613 c = token(CONTIN|KEYWORD|sALIAS);
614 /* A {...} can be used instead of in...esac for case statements */
623 while ((tpeek(CONTIN|KEYWORD|ESACONLY)) != c) {
624 struct op *tc = casepart(c);
626 t = tl = tc, tl->right = NULL;
628 tl->right = tc, tl = tc;
630 musthave(c, KEYWORD|sALIAS);
643 if (token(CONTIN | KEYWORD) != '(')
651 if (symbol != endtok) {
653 symbol == '}' ? Tcbrace : Tesac, ATEMP);
660 XPput(ptns, yylval.cp);
661 } while (token(0) == '|');
664 t->vars = (char **)XPclose(ptns);
667 t->left = c_list(true);
669 /* initialise to default for ;; or omitted */
671 /* SUSv4 requires the ;; except in the last casepart */
672 if ((tpeek(CONTIN|KEYWORD|sALIAS)) != endtok)
684 /* initialised above, but we need to eat the token */
691 function_body(char *name,
692 /* function foo { ... } vs foo() { .. } */
698 sname = wdstrip(name, 0);
700 * Check for valid characters in name. POSIX and AT&T ksh93 say
701 * only allow [a-zA-Z_0-9] but this allows more as old pdkshs
702 * have allowed more; the following were never allowed:
703 * NUL TAB NL SP " $ & ' ( ) ; < = > \ ` |
704 * C_QUOTE covers all but adds # * ? [ ]
706 for (p = sname; *p; p++)
707 if (ctype(*p, C_QUOTE))
708 yyerror("%s: %s\n", sname, "invalid function name");
711 * Note that POSIX allows only compound statements after foo(),
712 * sh and AT&T ksh allow any command, go with the later since it
713 * shouldn't break anything. However, for function foo, AT&T ksh
714 * only accepts an open-brace.
717 if (tpeek(CONTIN|KEYWORD|sALIAS) == '(' /*)*/) {
718 /* function foo () { //}*/
721 /* degrade to POSIX function */
724 musthave('{' /*}*/, CONTIN|KEYWORD|sALIAS);
730 t->u.ksh_func = tobool(ksh_func);
731 t->lineno = source->line;
733 if ((t->left = get_command(CONTIN)) == NULL) {
736 * Probably something like foo() followed by EOF or ';'.
737 * This is accepted by sh and ksh88.
738 * To make "typeset -f foo" work reliably (so its output can
739 * be used as input), we pretend there is a colon here.
741 t->left = newtp(TCOM);
742 /* (2 * sizeof(char *)) is small enough */
743 t->left->args = alloc(2 * sizeof(char *), ATEMP);
744 t->left->args[0] = tv = alloc(3, ATEMP);
748 t->left->args[1] = NULL;
749 t->left->vars = alloc(sizeof(char *), ATEMP);
750 t->left->vars[0] = NULL;
764 /* POSIX does not do alias expansion here... */
765 if ((c = token(CONTIN|KEYWORD|sALIAS)) != IN) {
767 /* non-POSIX, but AT&T ksh accepts a ; here */
771 while ((c = token(0)) == LWORD)
772 XPput(args, yylval.cp);
773 if (c != '\n' && c != ';')
776 return ((char **)XPclose(args));
780 * supporting functions
784 block(int type, struct op *t1, struct op *t2)
794 static const struct tokeninfo {
801 { "then", THEN, true },
802 { "else", ELSE, true },
803 { "elif", ELIF, true },
805 { "case", CASE, true },
806 { Tesac, ESAC, true },
807 { "for", FOR, true },
808 { Tselect, SELECT, true },
809 { "while", WHILE, true },
810 { "until", UNTIL, true },
812 { "done", DONE, true },
814 { Tfunction, FUNCTION, true },
815 { "time", TIME, true },
817 { Tcbrace, '}', true },
819 { "[[", DBRACKET, true },
820 /* Lexical tokens (0[EOF], LWORD and REDIR handled specially) */
821 { "&&", LOGAND, false },
822 { "||", LOGOR, false },
823 { ";;", BREAK, false },
824 { ";|", BRKEV, false },
825 { ";&", BRKFT, false },
826 { "((", MDPAREN, false },
827 { "|&", COPROC, false },
828 /* and some special cases... */
829 { "newline", '\n', false },
836 struct tokeninfo const *tt;
839 ktinit(APERM, &keywords,
840 /* currently 28 keywords: 75% of 64 = 2^6 */
842 for (tt = tokentab; tt->name; tt++) {
844 p = ktenter(&keywords, tt->name, hash(tt->name));
845 p->flag |= DEFINED|ISSET;
853 syntaxerr(const char *what)
855 /* 23<<- is the longest redirection, I think */
858 struct tokeninfo const *tt;
868 if (nesting.start_token) {
869 c = nesting.start_token;
870 source->errline = nesting.start_line;
874 /* don't quote the EOF */
875 yyerror("%s: %s %s\n", Tsynerr, "unexpected", "EOF");
879 s = snptreef(NULL, 32, "%S", yylval.cp);
883 s = snptreef(redir, sizeof(redir), "%R", yylval.iop);
887 for (tt = tokentab; tt->name; tt++)
893 if (c > 0 && c < 256) {
897 shf_snprintf(redir, sizeof(redir),
902 yyerror("%s: '%s' %s\n", Tsynerr, s, what);
906 nesting_push(struct nesting_state *save, int tok)
909 nesting.start_token = tok;
910 nesting.start_line = source->line;
914 nesting_pop(struct nesting_state *saved)
924 t = alloc(sizeof(struct op), ATEMP);
930 t->left = t->right = NULL;
936 compile(Source *s, bool skiputf8bom)
938 nesting.start_token = 0;
939 nesting.start_line = 0;
949 * This kludge exists to take care of sh/AT&T ksh oddity in which
950 * the arguments of alias/export/readonly/typeset have no field
951 * splitting, file globbing, or (normal) tilde expansion done.
952 * AT&T ksh seems to do something similar to this since
953 * $ touch a=a; typeset a=[ab]; echo "$a"
955 * $ x=typeset; $x a=[ab]; echo "$a"
960 assign_command(const char *s, bool docommand)
964 return ((strcmp(s, Talias) == 0) ||
965 (strcmp(s, Texport) == 0) ||
966 (strcmp(s, Treadonly) == 0) ||
967 (docommand && (strcmp(s, Tcommand) == 0)) ||
968 (strcmp(s, Ttypeset) == 0));
971 /* Check if we are in the middle of reading an alias */
973 inalias(struct source *s)
975 for (; s && s->type == SALIAS; s = s->next)
976 if (!(s->flags & SF_ALIASEND))
983 * Order important - indexed by Test_meta values
984 * Note that ||, &&, ( and ) can't appear in as unquoted strings
985 * in normal shell input, so these can be interpreted unambiguously
986 * in the evaluation pass.
988 static const char dbtest_or[] = { CHAR, '|', CHAR, '|', EOS };
989 static const char dbtest_and[] = { CHAR, '&', CHAR, '&', EOS };
990 static const char dbtest_not[] = { CHAR, '!', EOS };
991 static const char dbtest_oparen[] = { CHAR, '(', EOS };
992 static const char dbtest_cparen[] = { CHAR, ')', EOS };
993 const char * const dbtest_tokens[] = {
994 dbtest_or, dbtest_and, dbtest_not,
995 dbtest_oparen, dbtest_cparen
997 static const char db_close[] = { CHAR, ']', CHAR, ']', EOS };
998 static const char db_lthan[] = { CHAR, '<', EOS };
999 static const char db_gthan[] = { CHAR, '>', EOS };
1002 * Test if the current token is a whatever. Accepts the current token if
1003 * it is. Returns 0 if it is not, non-zero if it is (in the case of
1004 * TM_UNOP and TM_BINOP, the returned value is a Test_op).
1007 dbtestp_isa(Test_env *te, Test_meta meta)
1009 int c = tpeek(CMDASN | (meta == TM_BINOP ? 0 : CONTIN));
1012 Test_op ret = TO_NONOP;
1014 /* unquoted word? */
1015 uqword = c == LWORD && *ident;
1018 ret = c == LOGOR ? TO_NONNULL : TO_NONOP;
1019 else if (meta == TM_AND)
1020 ret = c == LOGAND ? TO_NONNULL : TO_NONOP;
1021 else if (meta == TM_NOT)
1022 ret = (uqword && !strcmp(yylval.cp,
1023 dbtest_tokens[(int)TM_NOT])) ? TO_NONNULL : TO_NONOP;
1024 else if (meta == TM_OPAREN)
1025 ret = c == '(' /*)*/ ? TO_NONNULL : TO_NONOP;
1026 else if (meta == TM_CPAREN)
1027 ret = c == /*(*/ ')' ? TO_NONNULL : TO_NONOP;
1028 else if (meta == TM_UNOP || meta == TM_BINOP) {
1029 if (meta == TM_BINOP && c == REDIR &&
1030 (yylval.iop->ioflag == IOREAD ||
1031 yylval.iop->ioflag == IOWRITE)) {
1033 save = wdcopy(yylval.iop->ioflag == IOREAD ?
1034 db_lthan : db_gthan, ATEMP);
1035 } else if (uqword && (ret = test_isop(meta, ident)))
1038 /* meta == TM_END */
1039 ret = (uqword && !strcmp(yylval.cp,
1040 db_close)) ? TO_NONNULL : TO_NONOP;
1041 if (ret != TO_NONOP) {
1043 if ((unsigned int)meta < NELEM(dbtest_tokens))
1044 save = wdcopy(dbtest_tokens[(int)meta], ATEMP);
1046 XPput(*te->pos.av, save);
1052 dbtestp_getopnd(Test_env *te, Test_op op MKSH_A_UNUSED,
1053 bool do_eval MKSH_A_UNUSED)
1055 int c = tpeek(CMDASN);
1061 XPput(*te->pos.av, yylval.cp);
1067 dbtestp_eval(Test_env *te MKSH_A_UNUSED, Test_op op MKSH_A_UNUSED,
1068 const char *opnd1 MKSH_A_UNUSED, const char *opnd2 MKSH_A_UNUSED,
1069 bool do_eval MKSH_A_UNUSED)
1075 dbtestp_error(Test_env *te, int offset, const char *msg)
1077 te->flags |= TEF_ERROR;
1081 /* Kludgy to say the least... */
1083 yylval.cp = *(XPptrv(*te->pos.av) + XPsize(*te->pos.av) +
1093 #define EOVERFLOW ERANGE
1095 #define EOVERFLOW EINVAL
1100 parse_usec(const char *s, struct timeval *tv)
1106 /* parse integral part */
1107 while (ksh_isdigit(*s)) {
1108 tt.tv_sec = tv->tv_sec * 10 + ksh_numdig(*s++);
1109 /*XXX this overflow check maybe UB */
1110 if (tt.tv_sec / 10 != tv->tv_sec) {
1114 tv->tv_sec = tt.tv_sec;
1119 /* no decimal fraction */
1121 else if (*s++ != '.') {
1122 /* junk after integral part */
1127 /* parse decimal fraction */
1129 while (ksh_isdigit(*s)) {
1130 tv->tv_usec += i * ksh_numdig(*s++);
1135 /* check for junk after fractional part */
1136 while (ksh_isdigit(*s))
1143 /* end of input string reached, no errors */
1149 * Helper function called from within lex.c:yylex() to parse
1150 * a COMSUB recursively using the main shell parser and lexer
1153 yyrecursive(int subtype MKSH_A_UNUSED)
1157 struct yyrecursive_state *ys;
1160 if (subtype != COMSUB) {
1168 ys = alloc(sizeof(struct yyrecursive_state), ATEMP);
1170 /* tell the lexer to accept a closing parenthesis as EOD */
1171 ys->old_nesting_type = subshell_nesting_type;
1172 subshell_nesting_type = etok;
1174 /* push reject state, parse recursively, pop reject state */
1175 ys->old_reject = reject;
1176 ys->old_symbol = symbol;
1178 ys->old_herep = herep;
1179 ys->old_salias = sALIAS;
1181 ys->next = e->yyrecursive_statep;
1182 e->yyrecursive_statep = ys;
1183 /* we use TPAREN as a helper container here */
1184 t = nested(TPAREN, stok, etok);
1185 yyrecursive_pop(false);
1187 /* t->left because nested(TPAREN, ...) hides our goodies there */
1188 cp = snptreef(NULL, 0, "%T", t->left);
1195 yyrecursive_pop(bool popall)
1197 struct yyrecursive_state *ys;
1200 if (!(ys = e->yyrecursive_statep))
1202 e->yyrecursive_statep = ys->next;
1204 sALIAS = ys->old_salias;
1205 herep = ys->old_herep;
1206 reject = ys->old_reject;
1207 symbol = ys->old_symbol;
1209 subshell_nesting_type = ys->old_nesting_type;