mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
--update: when used, do not generate the output files
It is inconvenient that we also generate the output files when we update the grammar file, and it's somewhat unexpected. Let's not do that. * src/main.c (main): Skip generation when --update is passed. * src/getargs.c (usage): Update the help message. * doc/bison.texi (Bison Options): Likewise. * tests/input.at: Check that we don't generate the output.
This commit is contained in:
@@ -2500,7 +2500,7 @@ AT_DATA_GRAMMAR([[input.y]],
|
||||
%no-default_prec
|
||||
%no_default-prec
|
||||
%no_lines
|
||||
%output = "foo"
|
||||
%output = "output.c"
|
||||
%pure_parser
|
||||
%token_table
|
||||
%error-verbose
|
||||
@@ -2559,7 +2559,9 @@ AT_BISON_CHECK([[-ffixit input.y]], [], [], [experr])
|
||||
AT_CHECK([[sed -e '/^fix-it:/d' errors-all >experr]])
|
||||
AT_BISON_CHECK([[input.y]], [], [], [experr])
|
||||
|
||||
# Update the input file.
|
||||
|
||||
# Update the input file. Make sure we generated nothing.
|
||||
AT_CHECK([rm -f output.c])
|
||||
AT_CHECK([cp input.y input.y.orig])
|
||||
AT_CHECK([sed -e '/fix-it/d' <errors-all >experr])
|
||||
AT_CHECK([echo "bison: file 'input.y' was updated (backup: 'input.y~')" >>experr])
|
||||
@@ -2568,6 +2570,9 @@ AT_BISON_CHECK([[--update input.y]], [], [[]], [experr])
|
||||
# Check the backup.
|
||||
AT_CHECK([diff input.y.orig input.y~])
|
||||
|
||||
# Check we did not generate any file.
|
||||
AT_CHECK([test ! -f output.c])
|
||||
|
||||
# Check the update.
|
||||
AT_CHECK([cat input.y], [],
|
||||
[[%code top {
|
||||
@@ -2588,7 +2593,7 @@ AT_CHECK([cat input.y], [],
|
||||
%no-default-prec
|
||||
%no-default-prec
|
||||
%no-lines
|
||||
%output "foo"
|
||||
%output "output.c"
|
||||
%pure-parser
|
||||
%token-table
|
||||
%glr-parser
|
||||
|
||||
Reference in New Issue
Block a user