|
From: | Paolo Bonzini |
Subject: | [RFA] Fix glr.c's YY_ERROR_VERBOSE vs. glr.cc's |
Date: | Tue, 12 Sep 2006 11:23:54 +0200 |
User-agent: | Thunderbird 1.5.0.5 (Macintosh/20060719) |
First, glr.cc sets YY_ERROR_VERBOSE to 0 and glr.c interprets it as a request to *have* verbose errors, thanks to these directives:
#ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # ... #endifThis can be considered a bug in glr.c actually, and the same bug is also there in yacc.c (if you want, the same glr.c hunk applies to yacc.c as well). This patch fixes it using some preprocessor magic.
Second, yy::parser::set_debug_level is never defined unless %debug is specified. This because it just sets "::yydebug" to its argument, and the variable is not defined in glr.c unless YYDEBUG is defined. This patch also fixes it by making the function do nothing unless %debug is specified.
Unluckily, the testsuite changes enabled by this patch are tangled in my %language work, and I'd rather wait for the copyright assignment. In the meanwhile, these are bug fixes (albeit glr.cc is undocumented) that could be applied as uncopyrightable.
Tested with no regressions. Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |