mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 17:53:02 +00:00
glr2.cc: style: clarify control flow
* data/skeletons/glr2.cc (yypreference): Be more functional-style.
This commit is contained in:
@@ -3202,8 +3202,8 @@ namespace ]b4_namespace_ref[
|
|||||||
static int
|
static int
|
||||||
yypreference (const semantic_option& y0, const semantic_option& y1)
|
yypreference (const semantic_option& y0, const semantic_option& y1)
|
||||||
{
|
{
|
||||||
rule_num r0 = y0.yyrule, r1 = y1.yyrule;
|
const rule_num r0 = y0.yyrule, r1 = y1.yyrule;
|
||||||
int p0 = yydprec[r0], p1 = yydprec[r1];
|
const int p0 = yydprec[r0], p1 = yydprec[r1];
|
||||||
|
|
||||||
if (p0 == p1)
|
if (p0 == p1)
|
||||||
{
|
{
|
||||||
@@ -3212,13 +3212,14 @@ namespace ]b4_namespace_ref[
|
|||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (p0 == 0 || p1 == 0)
|
else if (p0 == 0 || p1 == 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (p0 < p1)
|
else if (p0 < p1)
|
||||||
return 3;
|
return 3;
|
||||||
if (p1 < p0)
|
else if (p1 < p0)
|
||||||
return 2;
|
return 2;
|
||||||
return 0;
|
else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
]b4_parse_param_vars[
|
]b4_parse_param_vars[
|
||||||
|
|||||||
Reference in New Issue
Block a user