Skip to content

Commit b7dafab

Browse files
committed
glr: style changes
* data/skeletons/glr.c (yytnamerr): here. (yyprocessOneStack): Initialize variables.
1 parent 7e7a430 commit b7dafab

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

data/skeletons/glr.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -614,10 +614,10 @@ yytnamerr (char *yyres, const char *yystr)
614614
do_not_strip_quotes: ;
615615
}
616616

617-
if (! yyres)
617+
if (yyres)
618+
return yystpcpy (yyres, yystr) - yyres;
619+
else
618620
return (ptrdiff_t) strlen (yystr);
619-
620-
return yystpcpy (yyres, yystr) - yyres;
621621
}
622622
# endif
623623

@@ -672,7 +672,8 @@ struct yyGLRStateSet {
672672
* operation, yylookaheadNeeds[0] is not maintained since it would merely
673673
* duplicate yychar != YYEMPTY. */
674674
yybool* yylookaheadNeeds;
675-
ptrdiff_t yysize, yycapacity;
675+
ptrdiff_t yysize;
676+
ptrdiff_t yycapacity;
676677
};
677678

678679
struct yySemanticOption {
@@ -1991,13 +1992,10 @@ yyprocessOneStack (yyGLRStack* yystackp, ptrdiff_t yyk,
19911992
}
19921993
else
19931994
{
1994-
yySymbol yytoken;
1995-
int yyaction;
1995+
yySymbol yytoken = ]b4_yygetToken_call[;
19961996
const short* yyconflicts;
1997-
1997+
const int yyaction = yygetLRActions (yystate, yytoken, &yyconflicts);
19981998
yystackp->yytops.yylookaheadNeeds[yyk] = yytrue;
1999-
yytoken = ]b4_yygetToken_call[;
2000-
yyaction = yygetLRActions (yystate, yytoken, &yyconflicts);
20011999

20022000
while (*yyconflicts != 0)
20032001
{

0 commit comments

Comments
 (0)