mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
c++: make position.hh completely useless
Let's put the definition of position into location.hh, there's no real value in keeping them separate: they are small, and share the same requirements. To help users transition to this new model, still generate position.hh by default, but as a simple include to location.hh. * data/location.cc (api.position.file): Accept only 'none' as possible value. (position.hh): Make it a stub. (location.hh): Adjust. (b4_position_define): Merge into... (b4_location_define): this. * data/glr.cc, data/lalr1.cc, tests/input.at, tests/output.at: Adjust.
This commit is contained in:
@@ -1667,9 +1667,10 @@ AT_DATA([[input.y]],
|
||||
start: %empty;
|
||||
]])
|
||||
AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]],
|
||||
[[input.y:5.9-25: error: %define variable 'api.position.file' requires 'none' or '"..."' values
|
||||
[[input.y:5.9-25: error: invalid value for %define variable 'api.position.file': 'bogus'
|
||||
%define api.position.file bogus
|
||||
^^^^^^^^^^^^^^^^^
|
||||
input.y:5.9-25: accepted value: 'none'
|
||||
input.y:4.9-25: error: %define variable 'api.location.file' requires 'none' or '"..."' values
|
||||
%define api.location.file {bogus}
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -195,26 +195,18 @@ AT_CHECK_OUTPUT([foo.yy],
|
||||
[],
|
||||
[foo.tab.cc foo.tab.hh location.hh])
|
||||
|
||||
# api.location.file=none => api.position.file=none
|
||||
AT_CHECK_OUTPUT([foo.yy],
|
||||
[%skeleton "lalr1.cc" %defines %define api.stack.file none %locations %define api.position.file none %define api.location.file none],
|
||||
[%skeleton "lalr1.cc" %defines %define api.stack.file none %locations %define api.location.file none],
|
||||
[],
|
||||
[foo.tab.cc foo.tab.hh])
|
||||
|
||||
# api.location.file="*" => api.position.file=none
|
||||
AT_CHECK_OUTPUT([foo.yy],
|
||||
[%skeleton "lalr1.cc" %defines %define api.stack.file none %locations %define api.position.file none %define api.location.file "foo.loc.hh"],
|
||||
[%skeleton "lalr1.cc" %defines %define api.stack.file none %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.position.file "foo.pos.hh" %define api.location.file "foo.loc.hh"],
|
||||
[],
|
||||
[foo.loc.hh foo.pos.hh foo.tab.cc foo.tab.hh])
|
||||
|
||||
AT_CHECK_OUTPUT([gram_dir/foo.yy],
|
||||
[%skeleton "lalr1.cc" %verbose %defines %file-prefix "output_dir/foo"],
|
||||
[],
|
||||
[output_dir/foo.output output_dir/foo.tab.cc output_dir/foo.tab.hh])
|
||||
|
||||
|
||||
# AT_CHECK_CONFLICTING_OUTPUT(INPUT-FILE, DIRECTIVES, FLAGS, STDERR,
|
||||
# [EXIT-STATUS])
|
||||
|
||||
Reference in New Issue
Block a user