]> git.saurik.com Git - bison.git/blobdiff - data/lalr1.cc
lalr1.cc: don't discard non-existent lookahead on syntax error.
[bison.git] / data / lalr1.cc
index ac2fa35bc6e294d3778511b053d65a0ce8b4caee..6174e824edeb507beb4d33f60ae74cbfbd6d7367 100644 (file)
@@ -29,7 +29,7 @@ m4_define([b4_integral_parser_table_declare],
 ])
 
 # b4_integral_parser_table_define(TABLE-NAME, CONTENT, COMMENT)
-# ---------------------------------------------
+# -------------------------------------------------------------
 # Define "parser::yy<TABLE-NAME>_" which contents is CONTENT.
 m4_define([b4_integral_parser_table_define],
 [  const b4_int_type_for([$2])
@@ -321,7 +321,7 @@ do {                                                            \
       /// The state.
       state_type state;
 
-      /// Return the type corresponding to this state.
+      /// The type (corresponding to \a state).
       inline int type_get_ () const;
     };
 
@@ -398,7 +398,7 @@ m4_if(b4_prefix, [yy], [],
 b4_percent_code_get[]dnl
 
 [#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -876,7 +876,7 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param)));])[
         /* Return failure if at end of input.  */
         if (yyla.type == yyeof_)
           YYABORT;
-        else
+        else if (!yyempty)
           {
             yy_destroy_ ("Error: discarding", yyla);
             yyempty = true;