bison: catch bad symbol names.

* src/scan-gram.l({int}{id}): Report as an invalid identifier.
	* tests/input.at: Adjust.
This commit is contained in:
Akim Demaille
2009-05-04 21:23:55 +02:00
parent cdf3f11338
commit 84a1cb5ad0
3 changed files with 16 additions and 4 deletions

View File

@@ -657,13 +657,13 @@ AT_COMPILE([input.o], [-c input.c])
# Digits cannot.
AT_DATA_GRAMMAR([input.y],
[[%token .GOOD
%token -GOOD
%token 1NV4L1D
-GOOD
1NV4L1D
%%
start: .GOOD -GOOD
]])
AT_BISON_CHECK([-o input.c input.y], [1], [],
[[input.y:11.8: syntax error, unexpected integer, expecting char or identifier or <tag>
[[input.y:11.10-16: invalid identifier: `1NV4L1D'
]])
AT_CLEANUP