From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: "zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: [Feature Request] Adding option to support triple quotes
Date: Sat, 17 Aug 2019 07:30:09 +0100 [thread overview]
Message-ID: <20190817063009.7niz4cz2tuqx3ksu@chaz.gmail.com> (raw)
In-Reply-To: <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
next prev parent reply other threads:[~2019-08-17 6:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2c845fb0-d628-400f-a805-ad8356b6d87a@www.fastmail.com>
[not found] ` <7EBD1ADA-7179-4EEF-97CA-DBE4371D80D6@icloud.com>
[not found] ` <876f807b-dfdd-4246-8cfe-7cf6f373ac88@www.fastmail.com>
[not found] ` <f053e72e-e22e-4729-a2de-eaa712119728@www.fastmail.com>
2019-08-15 16:23 ` Aryn Starr
2019-08-17 5:31 ` Bart Schaefer
2019-08-17 6:30 ` Stephane Chazelas [this message]
2019-08-17 8:19 ` Stephane Chazelas
2019-08-18 4:24 ` Mikael Magnusson
2019-08-18 18:58 ` Matching delimiters for the "e" glob qualifier (Was: [Feature Request] Adding option to support triple quotes) Stephane Chazelas
2019-08-18 19:55 ` Bart Schaefer
2019-08-19 6:46 ` Matching delimiters for the "e" glob qualifier Stephane Chazelas
2019-08-13 6:06 [Feature Request] Adding option to support triple quotes Aryn Starr
2019-08-13 9:06 ` Mikael Magnusson
2019-08-13 20:52 ` Aryn Starr
2019-08-13 16:28 ` Daniel Shahaf
2019-08-13 20:40 ` Aryn Starr
2019-08-14 9:54 ` Stephane Chazelas
2019-08-15 14:28 ` Aryn Starr
2019-08-15 15:56 ` Daniel Shahaf
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=20190817063009.7niz4cz2tuqx3ksu@chaz.gmail.com \
--to=stephane.chazelas@gmail.com \
--cc=schaefer@brasslantern.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).