summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--Src/lex.c4
-rw-r--r--Test/D06subscript.ztst20
3 files changed, 28 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6b354086c..681fd10e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 $
 *****************************************************
diff --git a/Src/lex.c b/Src/lex.c
index 1cf3611c9..d02b3885a 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -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:
diff --git a/Test/D06subscript.ztst b/Test/D06subscript.ztst
index cffca742e..f91d62f2f 100644
--- a/Test/D06subscript.ztst
+++ b/Test/D06subscript.ztst
@@ -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