users/17310: we can't treat < after [ as a normal character.

Document problem and test for case that needs to work.
This commit is contained in:
Peter Stephenson 2012-10-03 18:11:12 +00:00
parent 76590bd93c
commit 61b9529ff8
5 changed files with 17 additions and 24 deletions

View file

@ -1,3 +1,10 @@
2012-10-03 Peter Stephenson <p.w.stephenson@ntlworld.com>
* users/17310: Doc/Zsh/params.yo, Src/lex.c, Test/A04redirect.ztst,
Test/D06subscript.ztst: back off users/17304 owing to problem
with [ command, document problem, and test the case that needs
to work.
2012-10-02 Peter Stephenson <pws@csr.com>
* users/17304: Src/lex.c, Test/D06subscript.ztst: angle brackets
@ -207,5 +214,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5731 $
* $Revision: 1.5732 $
*****************************************************

View file

@ -182,7 +182,10 @@ to the matching closing one is considered to be a list of flags, as in
The flags tt(s), tt(n) and tt(b) take an argument; the delimiter
is shown below as `tt(:)', but any character, or the matching pairs
`tt(LPAR())...tt(RPAR())', `tt({)...tt(})', `tt([)...tt(])', or
`tt(<)...tt(>)', may be used.
`tt(<)...tt(>)', may be used, but note that `tt(<)...tt(>)' can only be
used if the subscript is inside a double quoted expression or a
parameter substitution enclosed in braces as otherwise the expression is
interpreted as a redirection.
The flags currently understood are:

View file

@ -1218,7 +1218,7 @@ gettokstr(int c, int sub)
c = Comma;
break;
case LX2_OUTANG:
if (in_brace_param || sub || brct)
if (in_brace_param || sub)
break;
e = hgetc();
if (e != '(') {
@ -1255,7 +1255,7 @@ gettokstr(int c, int sub)
break;
}
lexstop = 0;
if (in_brace_param || sub || brct)
if (in_brace_param || sub)
break;
goto brk;
case LX2_EQUALS:

View file

@ -441,3 +441,6 @@
0:failed assignment on non-posix-special, POSIX_BUILTINS
>output
?zsh: read-only variable: foo
[</dev/null ]
1:check behaviour with square brackets

View file

@ -249,23 +249,3 @@
string[0]=!
1:Can't set only element zero of string
?(eval):1: string: assignment to invalid subscript range
string="Life,+like+a+dome+of+many-colour'd+glass"
for delims in "()" "{}" "[]" "<>"; do
eval 'print ${string[(ws'$delims[1]'+'$delims[2]')2]}'
eval 'print $string[(ws'$delims[1]'+'$delims[2]')3]'
eval 'print "$string[(ws'$delims[1]'+'$delims[2]')4]"'
done
0:Check matched delimiters in subscripts
>like
>a
>dome
>like
>a
>dome
>like
>a
>dome
>like
>a
>dome