zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@cs.elte.hu>
To: pws@ifh.de (Peter Stephenson)
Cc: zsh-workers@math.gatech.edu
Subject: Re: Various problems with 3.0.1-test1
Date: Wed, 11 Sep 1996 01:53:13 +0200 (MET DST)	[thread overview]
Message-ID: <199609102353.BAA02545@hzoli.ppp.cs.elte.hu> (raw)
In-Reply-To: <199609101603.SAA04007@hydra.ifh.de> from Peter Stephenson at "Sep 10, 96 06:03:53 pm"

> 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]))


      reply	other threads:[~1996-09-11  4:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-10 12:10 Peter Stephenson
1996-09-10 13:57 ` Zoltan Hidvegi
1996-09-10 16:03   ` Peter Stephenson
1996-09-10 23:53     ` Zoltan Hidvegi [this message]

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=199609102353.BAA02545@hzoli.ppp.cs.elte.hu \
    --to=hzoli@cs.elte.hu \
    --cc=pws@ifh.de \
    --cc=zsh-workers@math.gatech.edu \
    /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).