From 0e164d43d115b13f300892a4c0ab643ed03020c9 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Thu, 26 Jul 2012 16:44:45 +0200 Subject: [PATCH] glr.cc: fix the handling of yydebug * data/glr.cc (yydebug_): Remove, unused. (set_debug_level, debug_level): Work on yydebug instead. * doc/bison.texi, NEWS: Document this. --- NEWS | 4 +++- data/glr.cc | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index f4decfa8..b97956cc 100644 --- a/NEWS +++ b/NEWS @@ -6,7 +6,9 @@ GNU Bison NEWS ** Bug fixes - Type names are now properly escaped. +*** Type names are now properly escaped. + +*** glr.cc: set_debug_level and debug_level work as expected. * Noteworthy changes in release 2.6 (2012-07-19) [stable] diff --git a/data/glr.cc b/data/glr.cc index ba6ceac0..78a7ae51 100644 --- a/data/glr.cc +++ b/data/glr.cc @@ -131,7 +131,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl ]b4_parser_class_name::b4_parser_class_name[ (]b4_parse_param_decl[)]m4_ifset([b4_parse_param], [ :])[ #if ]b4_api_PREFIX[DEBUG - ]m4_ifset([b4_parse_param], [ ], [ :])[yydebug_ (false), + ]m4_ifset([b4_parse_param], [ ], [ :])[ yycdebug_ (&std::cerr)]m4_ifset([b4_parse_param], [,])[ #endif]b4_parse_param_cons[ { @@ -199,13 +199,14 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl ]b4_parser_class_name[::debug_level_type ]b4_parser_class_name[::debug_level () const { - return yydebug_; + return yydebug; } void ]b4_parser_class_name[::set_debug_level (debug_level_type l) { - yydebug_ = l; + // Actually, it is yydebug which is really used. + yydebug = l; } #endif @@ -320,7 +321,6 @@ b4_user_stype const location_type* yylocationp); private: /* Debugging. */ - int yydebug_; std::ostream* yycdebug_; # endif -- 2.45.2