I did quite a few things here, all focused around the endleaf callbacks,
and by extension the endid mechanism. I fixed a few small bugs, and got distracted trying to tidy up a bit.
Anyway here's what we get:
.fsm syntax support for endids
we now have tests for .fsm syntax (gasp)
Add missing printing for endids for various formats (notably dot and .fsm)
Various work on ways to simplify the endids API, especially:
Removed &nwritten for fsm_endid_get(), we don't need partial gets
Removed the tri-state enums for fsm_endid_get/set()
We don't need to distinguish a state absent endids from a present but empty set of endids
Add missing calls to endleaf() callbacks for various formats
Reintroduced fsm_exec handling in re(1), and reworked related argv[] handling. This is neccessary bugfixes only, in particular I want to address #478 and #477 separately
Bugfixes around the api format codegen, that was quite out of date.
The .fsm syntax for endids looks like this:
; ./build/bin/re -r pcre -bpl fsm 'ab?c' 'abc*'
0 -> 1 "a"; # e.g. "a"
1 -> 2 "b"; # e.g. "ab"
1 -> 3 "c"; # e.g. "ac"
2 -> 4 "c"; # e.g. "abc"
4 -> 5 "c"; # e.g. "abcc"
5 -> 5 "c"; # e.g. "abcc"
start: 0;
end: 2 = [0], 3 = [0], 4 = [0, 1], 5 = [0];
I did quite a few things here, all focused around the endleaf callbacks, and by extension the endid mechanism. I fixed a few small bugs, and got distracted trying to tidy up a bit.
Anyway here's what we get:
The .fsm syntax for endids looks like this:
and renders out like: