zsh-workers
 help / color / mirror / code / Atom feed
* Re:  Identifier bug
@ 1998-12-18 10:59 Sven Wischnowsky
  1998-12-18 11:02 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 1998-12-18 10:59 UTC (permalink / raw)
  To: zsh-workers


Peter Stephenson wrote:

> 
> I was just about to put together another development version when I
> discovered this.
> 
> % foo=(a b)
> % foo[1]=c
> zsh: not an identifier: foo[1]

Ok, now I dare to propose this one.

But note that this still has problems if the string inside the `[...]'
contains unmatched opening or closing brackets.

Bye
 Sven

*** os/params.c	Thu Dec 17 15:06:20 1998
--- Src/params.c	Fri Dec 18 11:56:53 1998
***************
*** 661,669 ****
  	return 0;
  
      /* Require balanced [ ] pairs */
!     for (s = ss; *(s += strcspn(++ss, "[]")) && s > ss; ss = s)
! 	;
!     return (*ss == ']' && !ss[1]);
  #endif
  }
  
--- 661,669 ----
  	return 0;
  
      /* Require balanced [ ] pairs */
!     if (skipparens('[', ']', &ss))
! 	return 0;
!     return !*ss;
  #endif
  }
  

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Identifier bug
  1998-12-18 10:59 Identifier bug Sven Wischnowsky
@ 1998-12-18 11:02 ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 1998-12-18 11:02 UTC (permalink / raw)
  To: zsh-workers

Sven Wischnowsky wrote:
> Ok, now I dare to propose this one.

That, I understand.  I spent 10 minutes trying to work out what the
strcpsn() was supposed to do.

> But note that this still has problems if the string inside the `[...]'
> contains unmatched opening or closing brackets.

Probably the right thing to do in the long term is have the opening
and closing brackets remaining tokenized.  Then if there is an
unbalanced ] in the middle inside quotes it won't be seen as a
delimiter.  If it's not quoted, of course, you have the seem problem,
but that's just down to the syntax.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Identifier bug
@ 1998-12-18 10:24 Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 1998-12-18 10:24 UTC (permalink / raw)
  To: Zsh hackers list

I was just about to put together another development version when I
discovered this.

% foo=(a b)
% foo[1]=c
zsh: not an identifier: foo[1]

which is quite serious, because my functions use this all the time, so
I'll have to wait until it's fixed.  I would guess the problem is with
4826, fixing subscripts for associative arrays.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-12-18 11:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-18 10:59 Identifier bug Sven Wischnowsky
1998-12-18 11:02 ` Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
1998-12-18 10:24 Peter Stephenson

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