yacc.c: make sure we properly propagated the user's number for error

* data/skeletons/yacc.c (YYERRCODE): Be truthful.
* tests/input.at (Redefining the error token): Check that.
This commit is contained in:
Akim Demaille
2020-03-08 07:56:39 +01:00
parent cfcd823e16
commit e3812bb8c3
3 changed files with 18 additions and 8 deletions

View File

@@ -326,6 +326,21 @@ input.y:2.14-16: error: redefining user token number of error
| ^~~
]])
# While at it, make sure we properly used the user's number for
# "error".
AT_DATA([input.y],
[[%token error 123
%%
exp:
]])
AT_BISON_CHECK([input.y])
AT_CHECK([$EGREP -E '123|256' input.tab.c], [],
[[ 0, 123, 257
#define YYERRCODE 123
]])
AT_CLEANUP