mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
* 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:
@@ -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. ##
|
||||
## --------------------- ##
|
||||
|
||||
Reference in New Issue
Block a user