mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-09-21 19:31:50 +02:00
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:
parent
76590bd93c
commit
61b9529ff8
@ -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 $
|
||||
*****************************************************
|
||||
|
@ -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:
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user