mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
c++: when api.location.file is defined, don't generate stack.hh
Make it easier to have fewer files. * data/stack.hh: Don't generate stack.hh when api.location.file is specified. * tests/calc++.at, tests/output.at: Adjust tests.
This commit is contained in:
@@ -22,7 +22,9 @@
|
||||
b4_percent_define_ifdef([[api.stack.file]],
|
||||
[b4_percent_define_check_values([[[[api.stack.file]],
|
||||
[[none]]]])],
|
||||
[b4_defines_if([m4_define([b4_stack_file], [stack.hh])])])
|
||||
[b4_defines_if([b4_percent_define_ifdef([[api.location.file]],
|
||||
[],
|
||||
[m4_define([b4_stack_file], [stack.hh])])])])
|
||||
|
||||
|
||||
# b4_stack_define
|
||||
|
||||
@@ -694,8 +694,8 @@ AT_CHECK_CALC_LALR1_CC([%defines %locations %define parse.error verbose %debug %
|
||||
AT_CHECK_CALC_LALR1_CC([%define parse.error verbose %debug %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
|
||||
AT_CHECK_CALC_LALR1_CC([%defines %locations %define parse.error verbose %debug %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count}])
|
||||
|
||||
AT_CHECK_CALC_LALR1_CC([%locations %defines %define api.stack.file none %define api.location.file none %define api.position.file none])
|
||||
AT_CHECK_CALC_LALR1_CC([%defines %locations %define api.stack.file none %define api.position.file none %define api.location.file "my-location.hh"])
|
||||
AT_CHECK_CALC_LALR1_CC([%defines %locations %define api.location.file none])
|
||||
AT_CHECK_CALC_LALR1_CC([%defines %locations %define api.location.file "my-location.hh"])
|
||||
|
||||
|
||||
# --------------------------- #
|
||||
|
||||
@@ -195,13 +195,17 @@ AT_CHECK_OUTPUT([foo.yy],
|
||||
[],
|
||||
[foo.tab.cc foo.tab.hh location.hh])
|
||||
|
||||
# api.location.file=none => api.position.file=none
|
||||
# api.location.file=none => api.position.file=none and api.stack.file=none.
|
||||
AT_CHECK_OUTPUT([foo.yy],
|
||||
[%skeleton "lalr1.cc" %defines %define api.stack.file none %locations %define api.location.file none],
|
||||
[%skeleton "lalr1.cc" %defines %locations %define api.location.file none],
|
||||
[],
|
||||
[foo.tab.cc foo.tab.hh])
|
||||
|
||||
# api.location.file="*" => api.position.file=none
|
||||
# api.location.file="*" => api.position.file=none and api.stack.file=none.
|
||||
AT_CHECK_OUTPUT([foo.yy],
|
||||
[%skeleton "lalr1.cc" %defines %locations %define api.location.file "foo.loc.hh"],
|
||||
[],
|
||||
[foo.loc.hh foo.tab.cc foo.tab.hh])
|
||||
AT_CHECK_OUTPUT([foo.yy],
|
||||
[%skeleton "lalr1.cc" %defines %define api.stack.file none %locations %define api.location.file "foo.loc.hh"],
|
||||
[],
|
||||
|
||||
Reference in New Issue
Block a user