* src/reader.c (grammar_current_rule_prec_set).

(grammar_current_rule_check): New, eved out from...
(readgram): here.
Remove `xaction', `first_rhs': useless.
* tests/input.at (Type clashes): New.
* tests/existing.at (GNU Cim Grammar): Adjust.
This commit is contained in:
Akim Demaille
2002-06-11 08:08:22 +00:00
parent 1485e106a4
commit 9af3fbce7c
5 changed files with 95 additions and 37 deletions

View File

@@ -24,7 +24,6 @@ AT_BANNER([[Input Processing.]])
## Invalid $n. ##
## ------------ ##
AT_SETUP([Invalid $n])
AT_DATA([input.y],
@@ -43,7 +42,6 @@ AT_CLEANUP
## Invalid @n. ##
## ------------ ##
AT_SETUP([Invalid @n])
AT_DATA([input.y],
@@ -56,3 +54,28 @@ AT_CHECK([bison input.y], [1], [],
]])
AT_CLEANUP
## -------------- ##
## Type clashes. ##
## -------------- ##
AT_SETUP([Type clashes])
AT_DATA([input.y],
[[%token foo
%type <bar> exp
%%
exp: foo {} foo
| foo
| /* Empty. */
;
]])
AT_CHECK([bison input.y], [1], [],
[[input.y:5: type clash (`bar' `') on default action
input.y:6: type clash (`bar' `') on default action
input.y:7: empty rule for typed nonterminal, and no action
]])
AT_CLEANUP