Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH (!): Re: PATCH: (very) bad syntax error checking
- X-seq: zsh-workers 11626
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: PATCH (!): Re: PATCH: (very) bad syntax error checking
- Date: Mon, 29 May 2000 10:27:35 +0200 (MET DST)
- In-reply-to: "Bart Schaefer"'s message of Sat, 27 May 2000 08:13:47 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
> ...
>
> Second, encountering the token "fi" alone on a line is not setting the
> returned token to LEXERR, so in init.c the test of (tok == LEXERR) fails
> (the value of `tok' is, not surpisingly, `FI').
>
> What follows appears to fix it, but Sven should confirm. For one thing,
> I wonder why parse_list() doesn't use YYERROR() ... is there some reason
> why `ecused' should not be set to 0 in that specific case?
It doesn't use YYERROR* because it has to return NULL and we have
YYERRORs only for void and integer, I think (I didn't change that
part).
And we don't need to reset ecused there, it's one of the top-level
functions that will set up their environments with init_parse() the
next time round.
Your patch looks good, as far as I can see.
> I included a hunk for the grammar test, but why is the line number `-1'?
Because ZTST_execchunk() uses eval to execute the test code and
bin_eval() uses parse_string() with a last argument of zero to turn of
line numbering. Hm, the fix would be to add a global variable where
bin_eval()/parse_string() (and other functions?) can store the old
line number and the error functions use (lineno < 0 ? savedlineno : lineno)
or something like that, right?
Bye
Sven
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author