bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFA] Fix glr.c's YY_ERROR_VERBOSE vs. glr.cc's


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)

Currently, glr.cc testing is limited in calc.at because of a couple of bugs in glr.cc itself. These bugs are due to glr.cc's nature of thin wrapper around glr.c.

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
# ...
#endif

This 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]