+2002-11-05 Akim Demaille <akim@epita.fr>
+
+ * src/scan-gram.l: When it starts with `%', complain about the
+ whole directive, not just that `invalid character: %'.
+
2002-11-04 Akim Demaille <akim@epita.fr>
* Makefile.maint: Update from Autoconf.
%x SC_ESCAPED_STRING SC_ESCAPED_CHARACTER
%x SC_BRACED_CODE SC_PROLOGUE SC_EPILOGUE
-letter [.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]
-id {letter}({letter}|[0-9])*
-int [0-9]+
+letter [.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]
+id {letter}({letter}|[0-9])*
+directive %{letter}({letter}|[0-9]|-)*
+int [0-9]+
/* POSIX says that a tag must be both an id and a C union member, but
historically almost any character is allowed in a tag. We disallow
"%verbose" return PERCENT_VERBOSE;
"%yacc" return PERCENT_YACC;
+ {directive} {
+ complain_at (*yylloc, _("invalid directive: %s"), quote (yytext));
+ YY_STEP;
+ }
+
"=" return EQUAL;
":" rule_length = 0; return COLON;
"|" rule_length = 0; return PIPE;