Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [Feature Request] Adding option to support triple quotes
- X-seq: zsh-workers 44678
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: [Feature Request] Adding option to support triple quotes
- Date: Sat, 17 Aug 2019 07:30:09 +0100
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=OaCwy2HAkKGuGTzR5ZQw1kxFZNpmT6f9fuBV8oBuuOE=; b=Ir/O3FKLik/8uUBvtZfZuzkAHHMu0Ebm44Ze7bqYVymnl8/QUsp+xYyfJxxPWnPO5M 6JmcKOwAyJyluxoJBGMnpOcGF+U1K4kgRZYsbuxQm/6OoTaHyjD0Ty8w8SUwGfnc+a28 dRIocsH+PXSWRQNYdT+yc9lA4jkHVug05/OJJy7zI6XoqRa1e+0oBJz4AfTvthSYwQfO XH7EuHGhr3IobL/KiFClerVk/lnt5dFWY2Mbw5xg+4vXW4hGUvQNecwjTqllfTtg0+GU 9USweQfhdslw7cC8sKNuQs7cWentuOuuwr1ewZOQ/GZQYTQaI0XQyEyUe7QBXVTEJeOV N07w==
- In-reply-to: <CAH+w=7bh3d950w_kT8KN5MeDjagapuoSqbWRBmFo8S=ZTUnwvg@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <2c845fb0-d628-400f-a805-ad8356b6d87a@www.fastmail.com> <7EBD1ADA-7179-4EEF-97CA-DBE4371D80D6@icloud.com> <876f807b-dfdd-4246-8cfe-7cf6f373ac88@www.fastmail.com> <f053e72e-e22e-4729-a2de-eaa712119728@www.fastmail.com> <AAFFC725-E38F-4307-8E21-8A443FC0FFBC@icloud.com> <CAH+w=7bh3d950w_kT8KN5MeDjagapuoSqbWRBmFo8S=ZTUnwvg@mail.gmail.com>
2019-08-16 22:31:11 -0700, Bart Schaefer:
[...]
> So if you really want to make progress with this, start looking for
> something more akin to perl's q{} and qq{} as already mentioned.
[...]
q{} would be a non-starter since it's already valid syntax.
q(...) for '...'
qq(...) for "..."
qqq(...) for $'...'
qqqq(...) and more q's reserved for future extensions like
ksh93's $"..."
may be workable. (and \qq(...) or 'q'q(...) would be a literal q
followed by q(...)).
perl allows \( and \) to escape ( and ) (and as a result \\ to
escape \) inside even the q(...) form, I'm not sure I like that:
$ perl -le 'print q( \\ \(\) () )'
\ () ()
'...' can quote anything that doesn't contain '. q(...) could
quote anything except unmatched (...) pairs.
I'm sure everyone will have wished for a kind of quotes (à la
TCL {...} or perl q(...)) that can nest when writing things
like:
ssh host 'find . -exec sh -c '\''for i do sed '\'\\\'\'s/... '
Which you wished you could write:
ssh host q(find . -exec zsh -c q(for i do sed q(s...)...) zsh {} +)
That's the same kind of reason we got $(...) to replace `...`
On a related note, I really wish the glob*(e'(code $(...))')
worked, as in the code that looks for the closing ) for the e
glob qualifier would find the matching ")" as opposed to the
first one (same in the s/j... parameter expansion flags, etc.)
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author