- FOR_ALL_CONSTRAINTS (c)
- if (c->namelen > 1)
- printf (" case CONSTRAINT_%s: return %lu;\n", c->c_name,
- (unsigned long int) c->namelen);
+ for (i = 0; i < ARRAY_SIZE(constraints_by_letter_table); i++)
+ {
+ struct constraint_data *c = constraints_by_letter_table[i];
+
+ if (!c
+ || c->namelen == 1)
+ continue;
+
+ /* Constraints with multiple characters should have the same
+ length. */
+ {
+ struct constraint_data *c2 = c->next_this_letter;
+ size_t len = c->namelen;
+ while (c2)
+ {
+ if (c2->namelen != len)
+ error ("Multi-letter constraints with first letter '%c' "
+ "should have same length", i);
+ c2 = c2->next_this_letter;
+ }
+ }
+
+ printf (" case '%c': return %lu;\n",
+ i, (unsigned long int) c->namelen);
+ }