Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH?] Nofork and removing newlines
- X-seq: zsh-workers 52705
- From: Lawrence Velázquez <larryv@xxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>, "Mikael Magnusson" <mikachu@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: [PATCH?] Nofork and removing newlines
- Date: Thu, 07 Mar 2024 02:02:36 -0500
- Archived-at: <https://zsh.org/workers/52705>
- Feedback-id: iaa214773:Fastmail
- In-reply-to: <CAH+w=7Yq7e7JOiN51=vQjUvS+Yi6xY0VAJUGjoraeBKKazAnkw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7aFJH-5GAu6puszGKvjqN-w0sPCi6v-vGPauDHVujDnag@mail.gmail.com> <20240305065606.ccr2ieheahslcpye@chazelas.org> <CAH+w=7Yb6_eULBq6Ez6pEhtUXOqErr+aDL2BDi7zyxr8QpsTiw@mail.gmail.com> <20240306175711.t3uz2sery3b6tbjw@chazelas.org> <CAH+w=7a5K8ioO+mP8RXvtmawHJFfFw1jOWE49GmZdAOVaTPjUQ@mail.gmail.com> <CAHYJk3Tmh0xVQodHuXycDDv21_xgkhq5hvGZgPrZbLUYox2bGA@mail.gmail.com> <CAH+w=7Yq7e7JOiN51=vQjUvS+Yi6xY0VAJUGjoraeBKKazAnkw@mail.gmail.com>
On Wed, Mar 6, 2024, at 11:53 PM, Bart Schaefer wrote:
> On Wed, Mar 6, 2024 at 2:42 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>>
>> On Wed, Mar 6, 2024 at 2:22 PM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>> >
>> > Is there some strong reason we could not allow ${(T) foo} btw?
>>
>> "{ " (curly bracket followed by space) is recognized like a syntax
>> token.
>
> Code-wise, a sequence starting with ${ (with or without the space) and
> ending with } is lexed into a single STRING token. (If it's inside
> double quotes, the entire double-quoted thing is a STRING token, but
> you can have nested quotes inside the dollar-brace inside the double
> quotes, etc., so this has to work recursively, and so on.) So the
> lexer has to decide when it sees dollar-brace how to find the closing
> brace. Skipping over parameter flags before deciding to switch to
> parsing something that looks like a function body might be possible,
> but doesn't really fit into the structure of the lexer. Deciding
> based on the very next character (space or pipe for a command, or any
> other for a parameter) makes it tractable.
Hm, would it be feasible to create an explicit LF-preserving form
using a different character (e.g., ${&cmd})? If so, would it be
undesirable for some other reason?
(Sorry if you already said something ruling this out; I only had
time to quickly skim today's messages.)
--
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author