summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-11-11 18:04:20 +0000
committerPeter Stephenson <pws@zsh.org>2015-11-11 18:04:20 +0000
commit830d54e629e8e12eb5a219a65a013876662e7b3e (patch)
treeec28abefe33e9925c36515652e4f87dba01b7db7 /Doc
parentf30b1bc7d16f6eab195f47dfd812527d69b0b315 (diff)
downloadzsh-830d54e629e8e12eb5a219a65a013876662e7b3e.tar.gz
zsh-830d54e629e8e12eb5a219a65a013876662e7b3e.tar.xz
zsh-830d54e629e8e12eb5a219a65a013876662e7b3e.zip
37092: make nested ${(P)name} properly refer to parameter on return
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/expn.yo11
1 files changed, 10 insertions, 1 deletions
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index 20e0c8d35..4c373d1f2 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -1033,7 +1033,16 @@ var(name) used in this fashion.
 If used with a nested parameter or command substitution, the result of that
 will be taken as a parameter name in the same way.  For example, if you
 have `tt(foo=bar)' and `tt(bar=baz)', the strings tt(${(P)foo}),
-tt(${(P)${foo}}), and tt(${(P)$(echo bar)}) will be expanded to `tt(baz)'.
+tt(${(P)${foo}}), and tt(${(P)$(echo bar)}) will be expanded to
+`tt(baz)'.
+
+Likewise, if the reference is itself nested, the expression with the
+flag is treated as if it were directly replaced by the parameter name.
+It is an error if this nested substitution produces an array with more
+than one word.  For example, if `tt(name=assoc)' where the parameter
+tt(assoc) is an associative array, then
+`tt(${${(P)name}[elt]})' refers to the element of the associative
+subscripted `tt(elt)'.
 )
 item(tt(q))(
 Quote characters that are special to the shell in the resulting words with