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

Re: ksh (with PATCH)



I wrote:

> ...
>
> - test -d .  -a '(' ! -f . ')' isn't parsed correctly.

Sorry, wrong line. The offending one was: [[ '!' = ! ]]. The problem
is that the ! (without quotes) is reported as the BANG token when we
are in conditions. The patch tries to minimally invasive, making the
lexer report it as BANG only when we are in the first word of a
condition.

> - [[ $(print -r - "$(print -r - 'abc*|" \')") !=  'abc*|" \' ]] isn't
>   parsed correctly either.

Maybe this is just that we use quoting differently?

Bye
 Sven

diff -ru ../z.old/Src/lex.c Src/lex.c
--- ../z.old/Src/lex.c	Mon Mar 13 10:34:59 2000
+++ Src/lex.c	Mon Mar 13 10:35:28 2000
@@ -1526,7 +1526,7 @@
 	    } else if (incond && !strcmp(yytext, "]]")) {
 		tok = DOUTBRACK;
 		incond = 0;
-	    } else if (incond && yytext[0] == '!' && !yytext[1])
+	    } else if (incond == 1 && yytext[0] == '!' && !yytext[1])
 		tok = BANG;
 	}
 	inalmore = 0;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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