From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dns.primenet.com.au (dns.primenet.com.au [203.24.36.40]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id OAA00219 for ; Wed, 11 Sep 1996 14:18:22 +1000 (EST) Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by dns.primenet.com.au (8.7.5/8.7.3) with ESMTP id LAA00892 for ; Wed, 11 Sep 1996 11:13:57 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id UAA17319; Tue, 10 Sep 1996 20:51:48 -0400 (EDT) Resent-Date: Tue, 10 Sep 1996 20:51:48 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199609102353.BAA02545@hzoli.ppp.cs.elte.hu> Subject: Re: Various problems with 3.0.1-test1 To: pws@ifh.de (Peter Stephenson) Date: Wed, 11 Sep 1996 01:53:13 +0200 (MET DST) Cc: zsh-workers@math.gatech.edu In-Reply-To: <199609101603.SAA04007@hydra.ifh.de> from Peter Stephenson at "Sep 10, 96 06:03:53 pm" X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"DoifV1.0.XE4.ZqWDo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2127 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > In fact, the whole idea of the lexical tokens depending on some option > has me less than thrilled. Since the only difference is in lextok2, I > think the following patch should work. It has the bonus of making the > effect of extendedglob much more transparent in the code. I would > urge its inclusion. If you're counting, I've added seven extendedglob > tests and removed one. I believe these are all the ones required. > (Maybe it was this way before?) No I think zsh-2.5.0 had the same behaviour. Your patches to lex.c and zle_tricky.c are fine but for glob.c the second hunk is unnecessary and undesired. The second hunk changes the glob engine. Here Hat comes from the pattern parser and denotes negation. It purely represents the concept of negation and it is not related to the actual ^ mark). Later when we implement ksh globbing only the pattern parser will be changed and in the parsed Comp structure Hat will still denote !(pattern) negation. And a change is necessary in subst.c as well because after your patch $foo:s/^/something/ stopps working. Perhaps it was a bug even before that this never worked with extendedglob set. We also have to double-check all places where the tokenized lexer output is used since an unexpected Hat or Pound token might cause problems. For example in the result of get_comp_string() although right now I'm unable to produce any bug related to this. Zoltan *** Src/subst.c 1996/07/28 22:29:59 2.48 --- Src/subst.c 1996/09/10 23:30:38 *************** *** 1568,1573 **** --- 1568,1574 ---- for (tt = hsubl; *tt; tt++) if (INULL(*tt)) chuck(tt--); + untokenize(hsubl); for (tt = hsubr = ztrdup(ptr2); *tt; tt++) if (INULL(*tt)) chuck(tt--); *** Src/glob.c.orig Wed Sep 11 00:51:32 1996 --- Src/glob.c Wed Sep 11 01:33:59 1996 *************** *** 1710,1717 **** pat++; continue; } ! if (*pat == Hat && isset(EXTENDEDGLOB)) ! return 1 - doesmatch(c->next); /* following pattern is negated */ if (*pat == Inbrack) { /* Match groups of characters */ #define PAT(X) (pat[X] == Meta ? pat[(X)+1] ^ 32 : untok(pat[X])) --- 1710,1717 ---- pat++; continue; } ! if (*pat == Hat) /* following pattern is negated */ ! return 1 - doesmatch(c->next); if (*pat == Inbrack) { /* Match groups of characters */ #define PAT(X) (pat[X] == Meta ? pat[(X)+1] ^ 32 : untok(pat[X]))