- for (p = p->next; p && p->content.sym; p = p->next)
- {
- ++rule_length;
-
- /* Don't allow rule_length == INT_MAX, since that might
- cause confusion with strtol if INT_MAX == LONG_MAX. */
- if (rule_length == INT_MAX)
- complain (&rules[ruleno].location, fatal, _("rule is too long"));
-
- /* item_number = symbol_number.
- But the former needs to contain more: negative rule numbers. */
- ritem[itemno++] =
- symbol_number_as_item_number (p->content.sym->number);
- /* A rule gets by default the precedence and associativity
- of its last token. */
- if (p->content.sym->class == token_sym && default_prec)
- rules[ruleno].prec = p->content.sym;
- }
+ {
+ size_t rule_length = 0;
+ for (p = p->next; p->content.sym; p = p->next)
+ {
+ ++rule_length;
+
+ /* Don't allow rule_length == INT_MAX, since that might
+ cause confusion with strtol if INT_MAX == LONG_MAX. */
+ if (rule_length == INT_MAX)
+ complain (&rules[ruleno].location, fatal, _("rule is too long"));
+
+ /* item_number = symbol_number.
+ But the former needs to contain more: negative rule numbers. */
+ ritem[itemno++] =
+ symbol_number_as_item_number (p->content.sym->number);
+ /* A rule gets by default the precedence and associativity
+ of its last token. */
+ if (p->content.sym->class == token_sym && default_prec)
+ rules[ruleno].prec = p->content.sym;
+ }
+ }