mirror of
https://github.com/zsh-users/zsh
synced 2024-09-15 22:20:22 +00:00
users/17304: angle brackets aren't associated with special parsing
inside square brackets
This commit is contained in:
parent
2cd0f0c555
commit
76590bd93c
|
@ -1,3 +1,8 @@
|
|||
2012-10-02 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* users/17304: Src/lex.c, Test/D06subscript.ztst: angle brackets
|
||||
aren't associated with special parsing inside square brackets.
|
||||
|
||||
2012-09-30 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* Aaron Schrab: 30712: .editorconfig: multi-editor specification
|
||||
|
@ -202,5 +207,5 @@
|
|||
|
||||
*****************************************************
|
||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||
* $Revision: 1.5730 $
|
||||
* $Revision: 1.5731 $
|
||||
*****************************************************
|
||||
|
|
|
@ -1218,7 +1218,7 @@ gettokstr(int c, int sub)
|
|||
c = Comma;
|
||||
break;
|
||||
case LX2_OUTANG:
|
||||
if (in_brace_param || sub)
|
||||
if (in_brace_param || sub || brct)
|
||||
break;
|
||||
e = hgetc();
|
||||
if (e != '(') {
|
||||
|
@ -1255,7 +1255,7 @@ gettokstr(int c, int sub)
|
|||
break;
|
||||
}
|
||||
lexstop = 0;
|
||||
if (in_brace_param || sub)
|
||||
if (in_brace_param || sub || brct)
|
||||
break;
|
||||
goto brk;
|
||||
case LX2_EQUALS:
|
||||
|
|
|
@ -249,3 +249,23 @@
|
|||
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 a new issue