]> git.saurik.com Git - bison.git/commitdiff
* src/reader.c (read_declarations): Don't abort on tok_illegal,
authorAkim Demaille <akim@epita.fr>
Mon, 26 Nov 2001 09:49:58 +0000 (09:49 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 26 Nov 2001 09:49:58 +0000 (09:49 +0000)
issue an error message.
* tests/regression.at (Invalid %directive): New.
Reported by Hans Aberg.

ChangeLog
src/reader.c
tests/regression.at

index 2fccc9396a51db3612c7e9c47930a5b3c28eee26..b813cbac62d80889244f10ce13f1b12505c16a86 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
 2001-11-26  Akim Demaille  <akim@epita.fr>
 
        * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
index ec920d19edf72c5851b8c2a6d5756bc1f9df22a9..f693b9650d7097f0462068abe74963c4659ffb86 100644 (file)
@@ -1018,10 +1018,10 @@ read_declarations (void)
            case tok_stropt:
            case tok_intopt:
            case tok_obsolete:
            case tok_stropt:
            case tok_intopt:
            case tok_obsolete:
-           case tok_illegal:
              abort ();
              break;
 
              abort ();
              break;
 
+           case tok_illegal:
            default:
              complain (_("unrecognized: %s"), token_buffer);
              skip_to_char ('%');
            default:
              complain (_("unrecognized: %s"), token_buffer);
              skip_to_char ('%');
index a18bfc451dfed1986eedce79d332c91916e0606a..68f02adc99b4451f39e9b769e5d71338c6e109e7 100644 (file)
@@ -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