Convert underscores to dashes in some %define variable names.

For now, just api.push-pull and lr.keep-unreachable-states.
Maintain old names for backward compatibility.
* NEWS (2.5): Document.
* data/c.m4 (b4_identification): Update comment.
* data/yacc.c: Update access.
* doc/bison.texinfo: Update.
* etc/bench.pl.in (bench_grammar): Update use.
* src/files.c (tr): Move to...
* src/getargs.c, src/getargs.h (tr): ... here because I can't
think of a better place to expose it.  My logic is that, for all
uses of tr so far, command-line arguments can be involved, and
getargs.h is already included.
* src/main.c (main): Update access.
* src/muscle_tab.c (muscle_percent_define_insert): Convert old
variable names to new variable names before assigning value.
* src/reader.c (reader): Update setting default.
* tests/calc.at: Update uses.
* tests/conflicts.at (Unreachable States After Conflict
Resolution): Update use.
* tests/input.at (%define enum variables): Update use.
(%define backward compatibility): New test group.
* tests/push.at: Update uses.
* tests/reduce.at: Update uses.
* tests/torture.at: Update uses.
This commit is contained in:
Joel E. Denny
2009-04-30 01:04:33 -04:00
parent 1c4aa81df1
commit 812775a039
20 changed files with 164 additions and 65 deletions

View File

@@ -950,18 +950,59 @@ input.y:1.9-29: accepted value: `accepting'
]])
# Back-end.
AT_DATA([[input.y]],
[[%define api.push-pull "neither"
%%
start: ;
]])
AT_BISON_CHECK([[input.y]], [1], [],
[[input.y:1.9-21: invalid value for %define variable `api.push-pull': `neither'
input.y:1.9-21: accepted value: `pull'
input.y:1.9-21: accepted value: `push'
input.y:1.9-21: accepted value: `both'
]])
AT_CLEANUP
## -------------------------------- ##
## %define backward compatibility. ##
## -------------------------------- ##
AT_SETUP([[%define backward compatibility]])
# The error messages tell us whether underscores in these variables are
# being converted to dashes.
AT_DATA([[input.y]],
[[%define api.push_pull "neither"
%%
start: ;
]])
AT_BISON_CHECK([[input.y]], [1], [],
[[input.y:1.9-21: invalid value for %define variable `api.push_pull': `neither'
[[input.y:1.9-21: invalid value for %define variable `api.push-pull': `neither'
input.y:1.9-21: accepted value: `pull'
input.y:1.9-21: accepted value: `push'
input.y:1.9-21: accepted value: `both'
]])
AT_DATA([[input.y]],
[[%define lr.keep_unreachable_states "maybe"
%%
start: ;
]])
AT_BISON_CHECK([[input.y]], [1], [],
[[input.y:1.9-34: invalid value for %define Boolean variable `lr.keep-unreachable-states'
]])
AT_DATA([[input.y]],
[[%define foo_bar "baz"
%%
start: ;
]])
AT_BISON_CHECK([[input.y]], [0], [],
[[input.y:1.9-15: warning: %define variable `foo_bar' is not used
]])
AT_CLEANUP
## ------------------------- ##