Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Re: Bug in ${(z)...} lexing, or what?



I wrote:

> ...
> 
> Now we need a way to detect which opening parens in conditions are
> parts of words and I'm not sure where and when to do that (Peter?).

The parser uses the `trick' to increment/decrement incond at the
appropriate places. This seems to do the right thing to make
bufferwords() do the same (well, it only sets incond to 2 at the right 
places).

Anyone sees a problem with this?

Bye
 Sven

Index: Src/hist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/hist.c,v
retrieving revision 1.10
diff -u -r1.10 hist.c
--- Src/hist.c	2000/07/13 08:42:10	1.10
+++ Src/hist.c	2000/07/13 12:22:30
@@ -2099,6 +2099,10 @@
     strinbeg(0);
     noaliases = 1;
     do {
+	if (incond)
+	    incond = 1 + (tok != DINBRACK && tok != INPAR &&
+			  tok != DBAR && tok != DAMPER &&
+			  tok != BANG);
 	ctxtlex();
 	if (tok == ENDINPUT || tok == LEXERR)
 	    break;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author