From 85b0dd71335c8ee6d4925be6b590cbe643edf196 Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Sat, 23 Sep 2017 18:17:51 +0100
Subject: Updates for ksh array element syntax.
Move detection of key/value pairs down into prefork().
Detect normal array assignment and [key]=val array assignemnt
separately. Mark key / value pairs with Marker and pass up flag. Deal
with marked triads specially later on.
---
Test/B02typeset.ztst | 15 +++++++++++++++
1 file changed, 15 insertions(+)
(limited to 'Test/B02typeset.ztst')
diff --git a/Test/B02typeset.ztst b/Test/B02typeset.ztst
index 7923ae3a6..13f0d5e30 100644
--- a/Test/B02typeset.ztst
+++ b/Test/B02typeset.ztst
@@ -778,3 +778,18 @@
>the key
>the value
>typeset -A keyvalhash=( ['*']='?not_globbed?' ['another key']='another value' ['the key']='the value' )
+
+ local keyvalarray=(first [2]=second third [6]=sixth seventh [5]=fifth new_sixth)
+ print -l "${keyvalarray[@]}"
+0:mixed syntax [key]=val with normal arrays
+>first
+>second
+>third
+>
+>fifth
+>new_sixth
+>seventh
+
+ local -A keyvalhash=(1 one [2]=two 3 three)
+1:Mixed syntax with [key]=val not allowed for hash.
+?(eval):1: bad [key]=value syntax for associative array
--
cgit 1.4.1