zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: order of processing in brace expansion
Date: Wed, 02 May 2001 16:28:21 +0100	[thread overview]
Message-ID: <Tc0a88d015346c05e98@mailsweeper01.cambridgesiliconradio.com> (raw)
In-Reply-To: Your message of "Wed, 02 May 2001 14:59:59 -0000." <1010502150000.ZM14338@candle.brasslantern.com>

Bart wrote:
> > That is, in all versions of zsh so far, using a parameter expansion is a
> > way to quote commas against brace expansion while still getting filename
> > generation after the expansion.
> 
> I was wondering whether there might be some sort of compromise, such as
> only tokenizing commas when BRACE_CCL is set.

I don't really like filling the code full of this sort of dependency,
unless it can be proven that someone, somewhere was using this particular
hack which none of us here even suspected existed until a few days ago.

But it has just occurred to me that actually the fix results in some other
illogical results.

% foo='{a,b}'
% print $~foo
{a,b}
% print {$~foo}
{a b}

This is rather hairy.  The obvious fix is to tokenize braces, too.  This
seems to do the trick, but the change of behaviour is now much more
obvious.  We probably ought to make it either all or nothing.  Bash doesn't
expand braces that result from parameters (probably due to the ordering of
expansions).  Any suggestions?  It doesn't seem worth an option.

Index: Src/glob.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/glob.c,v
retrieving revision 1.16
diff -u -r1.16 glob.c
--- Src/glob.c	2001/05/02 09:53:32	1.16
+++ Src/glob.c	2001/05/02 15:22:28
@@ -2374,6 +2374,8 @@
 	case '?':
 	case '=':
 	case ',':
+	case '{':
+	case '}':
 	    for (t = ztokens; *t; t++)
 		if (*t == *s) {
 		    if (bslash)
-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


  reply	other threads:[~2001-05-02 15:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-27 17:31 Allan Poindexter
2001-04-27 18:09 ` Peter Stephenson
2001-04-28  6:05   ` Bart Schaefer
2001-04-28 18:17     ` Bart Schaefer
2001-05-02  9:50     ` Peter Stephenson
2001-05-02 14:59       ` Bart Schaefer
2001-05-02 15:28         ` Peter Stephenson [this message]
2001-05-02 16:30           ` Bart Schaefer
2001-05-09  9:06             ` Peter Stephenson
2001-05-11 16:57               ` Allan Poindexter
2001-05-11 19:22             ` Allan Poindexter
2001-05-11 20:09               ` 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=Tc0a88d015346c05e98@mailsweeper01.cambridgesiliconradio.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /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).