mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-21 18:23:03 +00:00
lalr1.cc: don't generate location.hh when location_type is defined
* data/bison.m4 (b4_percent_define_get): Accept a default value. * data/c++.m4: Do not provide a default value for the %define variable location_type, rather, use b4_percent_define_get with a default argument where its value is needed. * data/lalr1.cc: Do not load location.cc (which outputs both location.hh and position.hh) if the user defined location_type. Do not include location.hh either.
This commit is contained in:
10
data/c++.m4
10
data/c++.m4
@@ -24,7 +24,12 @@ m4_include(b4_pkgdatadir/[c.m4])
|
||||
## ---------------- ##
|
||||
|
||||
b4_percent_define_default([[parser_class_name]], [[parser]])
|
||||
b4_percent_define_default([[location_type]], [[location]])
|
||||
|
||||
# Don't do that so that we remember whether we're using a user
|
||||
# request, or the default value.
|
||||
#
|
||||
# b4_percent_define_default([[location_type]], [[location_type]])
|
||||
|
||||
b4_percent_define_default([[filename_type]], [[std::string]])
|
||||
b4_percent_define_default([[api.namespace]], m4_defn([b4_prefix]))
|
||||
|
||||
@@ -123,7 +128,8 @@ m4_define([b4_public_types_declare],
|
||||
typedef YYSTYPE semantic_type;
|
||||
#endif]b4_locations_if([
|
||||
/// Symbol locations.
|
||||
typedef b4_percent_define_get([[location_type]]) location_type;])[
|
||||
typedef b4_percent_define_get([[location_type]],
|
||||
[[location]]) location_type;])[
|
||||
|
||||
/// Syntax errors thrown from user actions.
|
||||
struct syntax_error : std::runtime_error
|
||||
|
||||
Reference in New Issue
Block a user