[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [trunk]: new-error-verbose.patch
From: |
Akim Demaille |
Subject: |
Re: [trunk]: new-error-verbose.patch |
Date: |
28 Nov 2001 11:08:33 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence) |
| -#if YYDEBUG || YYERROR_VERBOSE
| +#if %%error_verbose
Err, what has happened with the YYDEBUG condition?
| /* YYTNME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
| static const char *const yytname[] =
| {
| @@ -826,7 +819,7 @@
| {
| ++yynerrs;
|
| -#if YYERROR_VERBOSE
| +#if %%error_verbose
I'm not sure this is the right move: the resulting code will be less
readable. I think defining YYERROR_VERBOSE and using it is better:
the reader will understand the CPP tricks, while #if 1 is totally
obscure. In addition, be ready to receive bug reports of people
saying that in that case, we'd better handle the #if 1 by ourselves:
keep or remove the corresponding code (which we don't want to implement).
| yyn = yypact[yystate];
|
| if (yyn > YYFLAG && yyn < YYLAST)
| @@ -869,7 +862,7 @@
| yyerror ("parse error; also virtual memory exhausted");
| }
| else
| -#endif /* YYERROR_VERBOSE */
| +#endif /* %%ERROR_VERBOSE */
Looks like a typo.
| yyerror ("parse error");
| }
| goto yyerrlab1;
| Index: src/getargs.c
| ===================================================================
| RCS file: /cvsroot/bison/bison/src/getargs.c,v
| retrieving revision 1.29
| diff -u -r1.29 getargs.c
| --- src/getargs.c 2001/11/26 21:06:22 1.29
| +++ src/getargs.c 2001/11/26 22:58:22
| @@ -34,6 +34,7 @@
| int no_parser_flag = 0;
| int token_table_flag = 0;
| int verbose_flag = 0;
| +int error_verbose_flag = 0;
| int yacc_flag = 0; /* for -y */
| int graph_flag = 0;
| int trace_flag = 0;
| @@ -163,6 +164,10 @@
|
| case 'v':
| verbose_flag = 1;
| + break;
| +
| + case 'e':
| + error_verbose_flag = 1;
Do not multiply the number of options. I don't think we need that
option really. I'm sorry I say `no' so often, but in that case we
want to keep things simple.
For instance I was *wrong* to add --locations. %locations was right.
Do not follow my own mistakes.
| --- src/muscle_tab.c 2001/11/22 21:45:14 1.4
| +++ src/muscle_tab.c 2001/11/26 22:58:22
| @@ -87,6 +87,7 @@
| muscle_insert ("maxtok", "0");
| muscle_insert ("ntbase", "0");
| muscle_insert ("verbose", "0");
| + muscle_insert ("error_verbose", "0");
I would much prefer that we keep `-' and `-' only everywhere. Is that
a problem somewhere?