parse.error: document and diagnose the incompatibility with %token-table

* doc/bison.texi (Tokens from Literals): Move to code using
%token-table to...
(Decl Summary: %token-table): here.
* data/skeletons/bison.m4: Implement mutual exclusion.
* tests/input.at: Check it.
* doc/local.mk: Be robust to the removal of doc/.
This commit is contained in:
Akim Demaille
2020-02-10 18:38:42 +01:00
parent 57647bb656
commit 77bdcc6f0c
4 changed files with 65 additions and 26 deletions

View File

@@ -2888,3 +2888,31 @@ input.y:9.1-21: definition of api.token.raw
AT_BISON_OPTION_POPDEFS
AT_CLEANUP
## ------------------------------ ##
## %token-table and parse.error. ##
## ------------------------------ ##
AT_SETUP([[%token-table and parse.error]])
# AT_TEST(DIRECTIVES, ERROR-LOCATION)
# -----------------------------------
m4_pushdef([AT_TEST],
[AT_DATA([[input.y]],
[[$1
%%
exp: %empty;
]])
AT_BISON_CHECK([[input.y]], [[1]], [[]],
[$2: error: '%token-table' and '%define parse.error (custom|detailed)' cannot be used together
])
])
AT_TEST([%define parse.error custom %token-table], [[input.y:1.1-26]])
AT_TEST([%define parse.error detailed %token-table],[[input.y:1.1-28]])
m4_popdef([AT_TEST])
AT_CLEANUP