katef / libfsm

DFA regular expression library & friends
BSD 2-Clause "Simplified" License
931 stars 52 forks source link

print API: Box end_ids and end_id_count in a struct for callbacks. #497

Closed silentbicycle closed 1 week ago

silentbicycle commented 1 week ago

Move the end_id array and its count into a struct for state metadata, and rename access throughout to end_ids and end_id_count.

Upcoming changes for eager output IDs will soon be passing more info to all of these callbacks, but only callers making use of those fields need to care. Instead of making callers add more (void) param; declarations all over the place to avoid warnings, just pass in a metadata struct pointer. Also, "count" is a pretty generic name and what it refers to will soon be ambiguous.

This should not be a functional change on its own, it's just clearing the way for new features.

silentbicycle commented 1 week ago

I also moved it into a struct in the IR, because the same issues apply there -- it's about to get a different ID type (eager output IDs) and "ids" and "count" bare are ambiguous.

silentbicycle commented 1 week ago

This failed due to the fuzzer hitting an unrelated bug, for (?<m. It may not be exactly the same bug as #386 but probably closely related if not.

katef commented 1 week ago

I might come back and rename this, the names are all too verbose for me...