bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

glr: style changes


From: Akim Demaille
Subject: glr: style changes
Date: Sun, 13 Oct 2019 16:25:52 +0200

commit b7dafab7267ea98128108534869c07d8afece125
Author: Akim Demaille <address@hidden>
Date:   Sat Oct 12 11:19:19 2019 +0200

    glr: style changes
    
    * data/skeletons/glr.c (yytnamerr): here.
    (yyprocessOneStack): Initialize variables.

diff --git a/data/skeletons/glr.c b/data/skeletons/glr.c
index 7184a35a..64f56a62 100644
--- a/data/skeletons/glr.c
+++ b/data/skeletons/glr.c
@@ -614,10 +614,10 @@ yytnamerr (char *yyres, const char *yystr)
     do_not_strip_quotes: ;
     }
 
-  if (! yyres)
+  if (yyres)
+    return yystpcpy (yyres, yystr) - yyres;
+  else
     return (ptrdiff_t) strlen (yystr);
-
-  return yystpcpy (yyres, yystr) - yyres;
 }
 # endif
 
@@ -672,7 +672,8 @@ struct yyGLRStateSet {
    *  operation, yylookaheadNeeds[0] is not maintained since it would merely
    *  duplicate yychar != YYEMPTY.  */
   yybool* yylookaheadNeeds;
-  ptrdiff_t yysize, yycapacity;
+  ptrdiff_t yysize;
+  ptrdiff_t yycapacity;
 };
 
 struct yySemanticOption {
@@ -1991,13 +1992,10 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
         }
       else
         {
-          yySymbol yytoken;
-          int yyaction;
+          yySymbol yytoken = ]b4_yygetToken_call[;
           const short* yyconflicts;
-
+          const int yyaction = yygetLRActions (yystate, yytoken, &yyconflicts);
           yystackp->yytops.yylookaheadNeeds[yyk] = yytrue;
-          yytoken = ]b4_yygetToken_call[;
-          yyaction = yygetLRActions (yystate, yytoken, &yyconflicts);
 
           while (*yyconflicts != 0)
             {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]