X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/c8f002c7d3407d5c91a5882466916160a72aa8c4..f7aed660541ed7b05c4d892334dfe64ba200a4a2:/src/gram.c diff --git a/src/gram.c b/src/gram.c index 263411a4..ebb7e739 100644 --- a/src/gram.c +++ b/src/gram.c @@ -268,17 +268,18 @@ grammar_dump (FILE *out, const char *title) { rule_t *rule = &rules[i]; item_number_t *r = NULL; - int rhs_count = 0; + unsigned int rhs_itemno = rule->rhs - ritem; + unsigned int rhs_count = 0; /* Find the last RHS index in ritems. */ for (r = rule->rhs; *r >= 0; ++r) ++rhs_count; - fprintf (out, "%3d (%2d, %2d, %2d, %2d-%2d) %2d ->", + fprintf (out, "%3d (%2d, %2d, %2d, %2u-%2u) %2d ->", i, rule->prec ? rule->prec->prec : 0, rule->prec ? rule->prec->assoc : 0, rule->useful, - rule->rhs - ritem, - rule->rhs - ritem + rhs_count - 1, + rhs_itemno, + rhs_itemno + rhs_count - 1, rule->lhs->number); /* Dumped the RHS. */ for (r = rule->rhs; *r >= 0; r++)