about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2004-05-13 20:04:10 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2004-05-13 20:04:10 +0000
commitd3b14e887ea29b62d1c2d5129582629a7fe97dd9 (patch)
tree0f33e1c570f084c92f0f97f14cedb8d02904a01a
parentaff4313b12df835e32b767aa8b1a1c4013514a44 (diff)
downloadzsh-d3b14e887ea29b62d1c2d5129582629a7fe97dd9.tar.gz
zsh-d3b14e887ea29b62d1c2d5129582629a7fe97dd9.tar.xz
zsh-d3b14e887ea29b62d1c2d5129582629a7fe97dd9.zip
19941: fix (( 3, ))
-rw-r--r--ChangeLog5
-rw-r--r--Src/math.c4
-rw-r--r--Test/C01arith.ztst20
3 files changed, 27 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d7a7ff24b..e1a410ccc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-05-13  Peter Stephenson  <pws@pwstephenson.fsnet.co.uk>
+
+	* 19941: Src/math.c, Test/C01arith.ztst: (( x, )) triggered
+	an internal bug instead of reporting an error.
+
 2004-05-13  Peter Stephenson  <pws@csr.com>
 
 	* 19936: Functions/Misc/zcalc: bad name for temporary history
diff --git a/Src/math.c b/Src/math.c
index a719ffea5..eb3a768ec 100644
--- a/Src/math.c
+++ b/Src/math.c
@@ -168,8 +168,8 @@ static int prec[TOKCOUNT] =
      0,  16, 0
 };
 
-#define TOPPREC 17
-#define ARGPREC (TOPPREC-1)
+#define TOPPREC 18
+#define ARGPREC 16
 
 static int type[TOKCOUNT] =
 {
diff --git a/Test/C01arith.ztst b/Test/C01arith.ztst
index d431daae0..bace31ea9 100644
--- a/Test/C01arith.ztst
+++ b/Test/C01arith.ztst
@@ -110,3 +110,23 @@
   print $(( ))
 0:empty math parse e.g. $(( )) acts like a zero
 >0
+
+  print $(( a = ))
+1:empty assignment
+?(eval):1: bad math expression: operand expected at `'
+
+  print $(( 3, ))
+1:empty right hand of comma
+?(eval):1: bad math expression: operand expected at `'
+
+  print $(( 3,,4 ))
+1:empty middle of comma
+?(eval):1: bad math expression: operand expected at `,4 '
+
+  print $(( (3 + 7, 4), 5 ))
+0:commas and parentheses, part 1
+>5
+
+  print $(( 5, (3 + 7, 4) ))
+0:commas and parentheses, part 1
+>4