]> git.saurik.com Git - bison.git/commitdiff
Port small part of master's 11707b2b so future ports are easier.
authorJoel E. Denny <jdenny@clemson.edu>
Tue, 22 Dec 2009 22:22:24 +0000 (17:22 -0500)
committerJoel E. Denny <jdenny@clemson.edu>
Tue, 29 Dec 2009 21:01:47 +0000 (16:01 -0500)
* data/lalr1.java (YYParser::yysyntax_error): Untabify.

ChangeLog
data/lalr1.java

index 28b33a1604eaca569e9c9976d3edb07517cc66be..0fd021ab3220b45d342d7a802bddceba5e0c3f6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-22  Joel E. Denny  <jdenny@clemson.edu>
+
+       Port small part of master's 11707b2b so future ports are easier.
+       * data/lalr1.java (YYParser::yysyntax_error): Untabify.
+
 2008-12-11  Akim Demaille  <demaille@gostai.com>
 
        Simplify the i18n of the error messages.
index 25bb1bdbd55af538e91bf3230d597300b2731285..8fe59539a5c04467dfc82e9285a50285c91d5636 100644 (file)
@@ -686,38 +686,38 @@ m4_popdef([b4_at_dollar])])dnl
         int yyn = yypact_[yystate];
         if (yypact_ninf_ < yyn && yyn <= yylast_)
           {
-           StringBuffer res;
-
-           /* Start YYX at -YYN if negative to avoid negative indexes in
-              YYCHECK.  In other words, skip the first -YYN actions for this
-              state because they are default actions.  */
-           int yyxbegin = yyn < 0 ? -yyn : 0;
-
-           /* Stay within bounds of both yycheck and yytname.  */
-           int yychecklim = yylast_ - yyn + 1;
-           int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
-           int count = 0;
-           for (int x = yyxbegin; x < yyxend; ++x)
-             if (yycheck_[x + yyn] == x && x != yyterror_
-                 && !yy_table_value_is_error_ (yytable_[x + yyn]))
-               ++count;
-
-           // FIXME: This method of building the message is not compatible
-           // with internationalization.
-           res = new StringBuffer ("syntax error, unexpected ");
-           res.append (yytnamerr_ (yytname_[tok]));
-           if (count < 5)
-             {
-               count = 0;
-               for (int x = yyxbegin; x < yyxend; ++x)
-                 if (yycheck_[x + yyn] == x && x != yyterror_
-                     && !yy_table_value_is_error_ (yytable_[x + yyn]))
-                   {
-                     res.append (count++ == 0 ? ", expecting " : " or ");
-                     res.append (yytnamerr_ (yytname_[x]));
-                   }
-             }
-           return res.toString ();
+            StringBuffer res;
+
+            /* Start YYX at -YYN if negative to avoid negative indexes in
+               YYCHECK.  In other words, skip the first -YYN actions for this
+               state because they are default actions.  */
+            int yyxbegin = yyn < 0 ? -yyn : 0;
+
+            /* Stay within bounds of both yycheck and yytname.  */
+            int yychecklim = yylast_ - yyn + 1;
+            int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
+            int count = 0;
+            for (int x = yyxbegin; x < yyxend; ++x)
+              if (yycheck_[x + yyn] == x && x != yyterror_
+                  && !yy_table_value_is_error_ (yytable_[x + yyn]))
+                ++count;
+
+            // FIXME: This method of building the message is not compatible
+            // with internationalization.
+            res = new StringBuffer ("syntax error, unexpected ");
+            res.append (yytnamerr_ (yytname_[tok]));
+            if (count < 5)
+              {
+                count = 0;
+                for (int x = yyxbegin; x < yyxend; ++x)
+                  if (yycheck_[x + yyn] == x && x != yyterror_
+                      && !yy_table_value_is_error_ (yytable_[x + yyn]))
+                    {
+                      res.append (count++ == 0 ? ", expecting " : " or ");
+                      res.append (yytnamerr_ (yytname_[x]));
+                    }
+              }
+        return res.toString ();
           }
       }