mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 18:53:04 +00:00
reader: recognize C++ even when it's not lalr1.cc or glr.cc
* src/reader.c (grammar_rule_check_and_complete): If a user uses her own skeleton but sets the language to C++, recognize it as C++.
This commit is contained in:
@@ -307,10 +307,10 @@ grammar_rule_check_and_complete (symbol_list *r)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Install the default action only for C++. */
|
/* Install the default action only for C++. */
|
||||||
bool is_cxx =
|
const bool is_cxx =
|
||||||
skeleton
|
STREQ (language->language, "c++")
|
||||||
? STREQ (skeleton, "glr.cc") || STREQ (skeleton, "lalr1.cc")
|
|| (skeleton && (STREQ (skeleton, "glr.cc")
|
||||||
: STREQ (language->language, "c++");
|
|| STREQ (skeleton, "lalr1.cc")));
|
||||||
if (is_cxx)
|
if (is_cxx)
|
||||||
{
|
{
|
||||||
code_props_rule_action_init (&r->action_props, "{ $$ = $1; }",
|
code_props_rule_action_init (&r->action_props, "{ $$ = $1; }",
|
||||||
|
|||||||
Reference in New Issue
Block a user