mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 00:33:03 +00:00
* src/reader.c (read_declarations): Don't abort on tok_illegal,
issue an error message. * tests/regression.at (Invalid %directive): New. Reported by Hans Aberg.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2001-11-26 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/reader.c (read_declarations): Don't abort on tok_illegal,
|
||||||
|
issue an error message.
|
||||||
|
* tests/regression.at (Invalid %directive): New.
|
||||||
|
Reported by Hans Aberg.
|
||||||
|
|
||||||
2001-11-26 Akim Demaille <akim@epita.fr>
|
2001-11-26 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
* configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
|
* configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
|
||||||
|
|||||||
@@ -1018,10 +1018,10 @@ read_declarations (void)
|
|||||||
case tok_stropt:
|
case tok_stropt:
|
||||||
case tok_intopt:
|
case tok_intopt:
|
||||||
case tok_obsolete:
|
case tok_obsolete:
|
||||||
case tok_illegal:
|
|
||||||
abort ();
|
abort ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case tok_illegal:
|
||||||
default:
|
default:
|
||||||
complain (_("unrecognized: %s"), token_buffer);
|
complain (_("unrecognized: %s"), token_buffer);
|
||||||
skip_to_char ('%');
|
skip_to_char ('%');
|
||||||
|
|||||||
@@ -380,9 +380,9 @@ AT_DATA([input.y],
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_CHECK([bison input.y], [1], [],
|
AT_CHECK([bison input.y], [1], [],
|
||||||
[input.y:2: invalid input: `?'
|
[[input.y:2: invalid input: `?'
|
||||||
input.y:3: fatal error: no rules in the input grammar
|
input.y:3: fatal error: no rules in the input grammar
|
||||||
])
|
]])
|
||||||
|
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
@@ -400,8 +400,29 @@ default: 'a' }
|
|||||||
]])
|
]])
|
||||||
|
|
||||||
AT_CHECK([bison input.y], [1], [],
|
AT_CHECK([bison input.y], [1], [],
|
||||||
[input.y:2: invalid input: `}'
|
[[input.y:2: invalid input: `}'
|
||||||
])
|
]])
|
||||||
|
|
||||||
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## -------------------- ##
|
||||||
|
## Invalid %directive. ##
|
||||||
|
## -------------------- ##
|
||||||
|
|
||||||
|
|
||||||
|
AT_SETUP([Invalid %directive])
|
||||||
|
|
||||||
|
AT_DATA([input.y],
|
||||||
|
[[%invalid
|
||||||
|
]])
|
||||||
|
|
||||||
|
AT_CHECK([bison input.y], [1], [],
|
||||||
|
[[input.y:1: unrecognized: %invalid
|
||||||
|
input.y:1: Skipping to next %
|
||||||
|
input.y:2: fatal error: no input grammar
|
||||||
|
]])
|
||||||
|
|
||||||
AT_CLEANUP
|
AT_CLEANUP
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user