mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 06:43:03 +00:00
c++: add support for api.position.file and api.location.file
* data/location.cc: Sort includes. (b4_position_file, b4_location_file): New. When there's a file for locations but not for positions, include the definition of position in the location file. * data/lalr1.cc (b4_shared_declarations): Include the position/location file when it exists. Otherwise, define the class. * data/glr.cc: Likewise. * tests/input.at (%define file variables): Check them. * tests/output.at (C++ output): Check various cases with api.position.file and api.location.file.
This commit is contained in:
@@ -1659,12 +1659,21 @@ AT_SETUP([["%define" file variables]])
|
||||
|
||||
AT_DATA([[input.y]],
|
||||
[[%skeleton "lalr1.cc"
|
||||
%locations
|
||||
%define api.stack.file bogus
|
||||
%define api.location.file {bogus}
|
||||
%define api.position.file bogus
|
||||
%%
|
||||
start: %empty;
|
||||
]])
|
||||
AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]],
|
||||
[[input.y:2.9-22: error: %define variable 'api.stack.file' requires 'none' or '"..."' values
|
||||
[[input.y:5.9-25: error: %define variable 'api.position.file' requires 'none' or '"..."' values
|
||||
%define api.position.file bogus
|
||||
^^^^^^^^^^^^^^^^^
|
||||
input.y:4.9-25: error: %define variable 'api.location.file' requires 'none' or '"..."' values
|
||||
%define api.location.file {bogus}
|
||||
^^^^^^^^^^^^^^^^^
|
||||
input.y:3.9-22: error: %define variable 'api.stack.file' requires 'none' or '"..."' values
|
||||
%define api.stack.file bogus
|
||||
^^^^^^^^^^^^^^
|
||||
]])
|
||||
|
||||
Reference in New Issue
Block a user