* tests/regression.at (Invalid input: 2): New.

* src/lex.c (unlexed_token_buffer): New.
(lex, unlex): Adjust: when unlexing, be sure to save token_buffer
too.
Reported by Wwp.
This commit is contained in:
Akim Demaille
2001-11-01 18:05:22 +00:00
parent f987e9d257
commit 561f9a30af
4 changed files with 52 additions and 3 deletions

View File

@@ -109,6 +109,45 @@ input.y:3: fatal error: no rules in the input grammar
AT_CLEANUP
## ----------------- ##
## Invalid input 1. ##
## ----------------- ##
AT_SETUP([Invalid input: 1])
AT_DATA([input.y],
[[%%
?
]])
AT_CHECK([bison input.y], [1], [],
[input.y:2: invalid input: `?'
input.y:3: fatal error: no rules in the input grammar
])
AT_CLEANUP
## ----------------- ##
## Invalid input 2. ##
## ----------------- ##
AT_SETUP([Invalid input: 2])
AT_DATA([input.y],
[[%%
default: 'a' }
]])
AT_CHECK([bison input.y], [1], [],
[input.y:2: invalid input: `}'
])
AT_CLEANUP
## --------------------- ##
## Invalid CPP headers. ##
## --------------------- ##