mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
* 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:
@@ -907,7 +907,7 @@ MBEE_LISTV : /*EMPT*/
|
||||
LISTV : HIDENTIFIER { regDecl($1, type, KNOKD, CDEFLT);}
|
||||
| FPP_CATEG HDOTDOTDOT { regDecl(varargsid, TVARARGS, KNOKD, categ);}
|
||||
| HIDENTIFIER { regDecl($1, type, KNOKD, CDEFLT);}
|
||||
HPAREXPSEPARATOR LISTV
|
||||
HPAREXPSEPARATOR LISTV {}
|
||||
| FPP_SPEC
|
||||
| FPP_SPEC
|
||||
HPAREXPSEPARATOR LISTV
|
||||
@@ -947,7 +947,7 @@ FPP_PROC_DECL_IN_SPEC: MBEE_TYPE HPROCEDURE
|
||||
IDENTIFIER_LISTV: HIDENTIFIER { regDecl($1, type, kind, categ);}
|
||||
| HDOTDOTDOT { regDecl(varargsid, TVARARGS, kind, categ);}
|
||||
| HIDENTIFIER { regDecl($1, type, kind, categ);}
|
||||
HPAREXPSEPARATOR IDENTIFIER_LISTV
|
||||
HPAREXPSEPARATOR IDENTIFIER_LISTV {}
|
||||
;
|
||||
MBEE_MODE_PART : /*EMPT*/
|
||||
| MODE_PART
|
||||
@@ -1153,7 +1153,7 @@ EXPRESSION_SIMP : EXPRESSION_SIMP
|
||||
| HNONE { mout(MNONE);$$=NULL;}
|
||||
| HIDENTIFIER
|
||||
{ $<ident>$=$1;}
|
||||
MBEE_ARG_R_PT
|
||||
MBEE_ARG_R_PT {}
|
||||
| HTHIS HIDENTIFIER { mout(MTHIS);
|
||||
moutId($2);$$=NULL;}
|
||||
| HNEW
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user