mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
lalr1.cc: check LAC support
* tests/conflicts.at, tests/input.at, tests/regression.at: here.
This commit is contained in:
@@ -541,7 +541,7 @@ AT_CONSISTENT_ERRORS_CHECK([[%define lr.type canonical-lr]],
|
||||
[AT_PREVIOUS_STATE_INPUT],
|
||||
[[$end]], [[ab]])
|
||||
|
||||
# Only LAC gets it right.
|
||||
# Only LAC gets it right. In C.
|
||||
AT_CONSISTENT_ERRORS_CHECK([[%define lr.type canonical-lr
|
||||
%define parse.lac full]],
|
||||
[AT_PREVIOUS_STATE_GRAMMAR],
|
||||
@@ -553,6 +553,20 @@ AT_CONSISTENT_ERRORS_CHECK([[%define lr.type ielr
|
||||
[AT_PREVIOUS_STATE_INPUT],
|
||||
[[$end]], [[b]])
|
||||
|
||||
# Only LAC gets it right. In C++.
|
||||
AT_CONSISTENT_ERRORS_CHECK([[%language "c++"
|
||||
%define lr.type canonical-lr
|
||||
%define parse.lac full]],
|
||||
[AT_PREVIOUS_STATE_GRAMMAR],
|
||||
[AT_PREVIOUS_STATE_INPUT],
|
||||
[[$end]], [[b]])
|
||||
AT_CONSISTENT_ERRORS_CHECK([[%language "c++"
|
||||
%define lr.type ielr
|
||||
%define parse.lac full]],
|
||||
[AT_PREVIOUS_STATE_GRAMMAR],
|
||||
[AT_PREVIOUS_STATE_INPUT],
|
||||
[[$end]], [[b]])
|
||||
|
||||
m4_popdef([AT_PREVIOUS_STATE_GRAMMAR])
|
||||
m4_popdef([AT_PREVIOUS_STATE_INPUT])
|
||||
|
||||
|
||||
@@ -2247,6 +2247,7 @@ AT_CLEANUP
|
||||
## ------------------------- ##
|
||||
|
||||
AT_SETUP([[LAC: Errors for %define]])
|
||||
AT_KEYWORDS([lac])
|
||||
|
||||
AT_DATA([[input.y]],
|
||||
[[%%
|
||||
@@ -2263,6 +2264,16 @@ AT_BISON_CHECK([[-Dparse.lac.memory-trace=full input.y]],
|
||||
[[<command line>:3: error: %define variable 'parse.lac.memory-trace' is not used
|
||||
]])
|
||||
|
||||
# parse.lac.* options are useless in C++ even if LAC isn't actually activated.
|
||||
AT_BISON_CHECK([[-Dparse.lac.es-capacity-initial=1 -L C++ -Dparse.lac input.y]],
|
||||
[[1]], [],
|
||||
[[<command line>:3: error: %define variable 'parse.lac.es-capacity-initial' is not used
|
||||
]])
|
||||
AT_BISON_CHECK([[-Dparse.lac.memory-trace=full -L C++ -Dparse.lac input.y]],
|
||||
[[1]], [],
|
||||
[[<command line>:3: error: %define variable 'parse.lac.memory-trace' is not used
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
@@ -1375,6 +1375,8 @@ AT_LAC_CHECK([[%define api.push-pull pull %define api.pure]])
|
||||
AT_LAC_CHECK([[%define api.push-pull both]])
|
||||
AT_LAC_CHECK([[%define api.push-pull both %define api.pure]])
|
||||
|
||||
AT_LAC_CHECK([[%skeleton "lalr1.cc"]])
|
||||
|
||||
m4_popdef([AT_LAC_CHECK])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
Reference in New Issue
Block a user