mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
api.value.type: diagnose guaranteed failure with --yacc
Instead of generating invalid C code, generate an error when --yacc and '%define api.value.type union' are used together. * data/bison.m4: Issue an error in this case. * tests/types.at (%yacc vs. %define api.value.type union): New, check this error. * doc/bison.texi (Type Generation): Document it. * tests/output.at: Check that '-o y.tab.c' and '-y' behave equally wrt generated file names. * NEWS (Use of YACC='bison -y'): New. Promote the use of 'bison -o y.tab.c'.
This commit is contained in:
@@ -37,6 +37,26 @@ AT_BISON_CHECK([[input.y]], [[1]], [[]],
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
## ---------------------------------------- ##
|
||||
## %yacc vs. %define api.value.type union. ##
|
||||
## ---------------------------------------- ##
|
||||
|
||||
AT_SETUP([[%yacc vs. %define api.value.type union]])
|
||||
|
||||
AT_DATA([[input.y]],
|
||||
[[%yacc
|
||||
%define api.value.type "union"
|
||||
%%
|
||||
exp: %empty;
|
||||
]])
|
||||
|
||||
AT_BISON_CHECK([[input.y]], [[1]], [[]],
|
||||
[[input.y:2.9-22: error: '%yacc' and '%define api.value.type "union"' cannot be used together
|
||||
]])
|
||||
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## api.value.type. ##
|
||||
## ---------------- ##
|
||||
|
||||
Reference in New Issue
Block a user