mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-19 13:33:52 +01:00
11606: Propagate parse errors out of parse_list() and parse_event(), and
test that it worked.
This commit is contained in:
parent
17aadf0338
commit
47532f255e
@ -944,7 +944,7 @@ source(char *s)
|
||||
execode(prog, 1, 0);
|
||||
popheap();
|
||||
} else
|
||||
loop(0, 0); /* loop through the file to be sourced */
|
||||
loop(0, 0); /* loop through the file to be sourced */
|
||||
sourcelevel--;
|
||||
|
||||
/* restore the current shell state */
|
||||
|
@ -459,6 +459,7 @@ par_event(void)
|
||||
}
|
||||
}
|
||||
if (!r) {
|
||||
tok = LEXERR;
|
||||
if (errflag) {
|
||||
yyerror(0);
|
||||
ecused--;
|
||||
@ -491,10 +492,8 @@ parse_list(void)
|
||||
yylex();
|
||||
init_parse();
|
||||
par_list(&c);
|
||||
#if 0
|
||||
if (tok == LEXERR)
|
||||
#endif
|
||||
if (tok != ENDINPUT) {
|
||||
if (tok != ENDINPUT) {
|
||||
tok = LEXERR;
|
||||
yyerror(0);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -50,9 +50,8 @@
|
||||
#
|
||||
# Tests for `Precommand Modifiers'
|
||||
#
|
||||
- sh -c 'echo $0'
|
||||
- $ZTST_testdir/../Src/zsh -fc "[[ \$0 = \"-$ZTST_testdir/../Src/zsh\" ]]"
|
||||
0:`-' precommand modifier
|
||||
>-sh
|
||||
|
||||
echo f*
|
||||
noglob echo f*
|
||||
@ -107,6 +106,12 @@
|
||||
0:`if ...' (iii)
|
||||
>false
|
||||
|
||||
if true;
|
||||
:
|
||||
fi
|
||||
1d:`if ...' (iv)
|
||||
?ZTST_execchunk:-1: parse error near `fi'
|
||||
|
||||
for name in word to term; do
|
||||
print $name
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user