zsh-workers
 help / color / mirror / code / Atom feed
From: Zaidhaan Hussain <zaidhaan@gmx.com>
To: zsh-workers@zsh.org
Subject: Should (z) PE flag split & during expansion?
Date: Sat, 3 Jun 2023 14:00:09 +0800	[thread overview]
Message-ID: <rfqgtwa77p6aklvn6y4pcx2zu4jwmkd7f4cw44ygmtzj55izi6@au6wtpuvowe6> (raw)

The following:

printf '<%s>' ${(z)${:-'!-2:&'}}

Yields this:

<!-2:><&>

Which does not make sense if we consider that & is valid in parameter
expansions. At least for history expansions, such as would be the case
for the following setup:

echo foo_replaceme_bar
echo baz_replaceme_qux
!-2:s/replaceme/subst/ && !-1:&

I realize the manual (14.1.4) states "In parameter expansion the &
must appear inside braces, and in filename generation it must be
quoted with a backslash."

But even so, the following:

printf '<%s>' ${(z)${:-'!{-2:&}'}}

Yields this:

<!{-2:><&><}>

This was identified in issue #929 in zsh-users/zsh-syntax-highlighting
on GitHub.

--
Regards,
Zaidhaan


             reply	other threads:[~2023-06-03  6:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-03  6:00 Zaidhaan Hussain [this message]
2023-06-05 20:01 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rfqgtwa77p6aklvn6y4pcx2zu4jwmkd7f4cw44ygmtzj55izi6@au6wtpuvowe6 \
    --to=zaidhaan@gmx.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).