From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7923 invoked from network); 29 May 2000 08:27:49 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 May 2000 08:27:49 -0000 Received: (qmail 9723 invoked by alias); 29 May 2000 08:27:43 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11626 Received: (qmail 9716 invoked from network); 29 May 2000 08:27:37 -0000 Date: Mon, 29 May 2000 10:27:35 +0200 (MET DST) Message-Id: <200005290827.KAA03935@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Sat, 27 May 2000 08:13:47 +0000 Subject: Re: PATCH (!): Re: PATCH: (very) bad syntax error checking 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@informatik.hu-berlin.de