mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-07 23:51:14 +02:00
users/17304: angle brackets aren't associated with special parsing
inside square brackets
This commit is contained in:
parent
2cd0f0c555
commit
76590bd93c
3 changed files with 28 additions and 3 deletions
|
@ -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>
|
2012-09-30 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
* Aaron Schrab: 30712: .editorconfig: multi-editor specification
|
* Aaron Schrab: 30712: .editorconfig: multi-editor specification
|
||||||
|
@ -202,5 +207,5 @@
|
||||||
|
|
||||||
*****************************************************
|
*****************************************************
|
||||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
* 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;
|
c = Comma;
|
||||||
break;
|
break;
|
||||||
case LX2_OUTANG:
|
case LX2_OUTANG:
|
||||||
if (in_brace_param || sub)
|
if (in_brace_param || sub || brct)
|
||||||
break;
|
break;
|
||||||
e = hgetc();
|
e = hgetc();
|
||||||
if (e != '(') {
|
if (e != '(') {
|
||||||
|
@ -1255,7 +1255,7 @@ gettokstr(int c, int sub)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
lexstop = 0;
|
lexstop = 0;
|
||||||
if (in_brace_param || sub)
|
if (in_brace_param || sub || brct)
|
||||||
break;
|
break;
|
||||||
goto brk;
|
goto brk;
|
||||||
case LX2_EQUALS:
|
case LX2_EQUALS:
|
||||||
|
|
|
@ -249,3 +249,23 @@
|
||||||
string[0]=!
|
string[0]=!
|
||||||
1:Can't set only element zero of string
|
1:Can't set only element zero of string
|
||||||
?(eval):1: string: assignment to invalid subscript range
|
?(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