-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fsm_print_fsm: add option for printing grouped edges, add CLI flag.
Add a flag to `struct fsm_options`, `group_edges`, which tells fsm to print edges in a group whenever the output method supports it. This can make fsm output much easier to read with FSMs from unanchored regexes, which often have hundreds of "...and everything else 0x00 - 0xFF goes back to state X" edges. Without the `-g` flag, this output would be 1798 lines long: 0; 1; 2; 3; 4; 5; 6; 7; 0 -> 0 "\x00" .. "a", "c" .. "\xff"; 0 -> 1 "b"; 1 -> 0 "\x00" .. "`", "c" .. "\xff"; 1 -> 1 "b"; 1 -> 2 "a"; 2 -> 0 "\x00" .. "a", "c" .. "m", "o" .. "\xff"; 2 -> 1 "b"; 2 -> 3 "n"; 3 -> 0 "\x00" .. "`", "c" .. "\xff"; 3 -> 1 "b"; 3 -> 4 "a"; 4 -> 0 "\x00" .. "a", "c" .. "m", "o" .. "\xff"; 4 -> 1 "b"; 4 -> 5 "n"; 5 -> 0 "\x00" .. "`", "c" .. "\xff"; 5 -> 1 "b"; 5 -> 6 "a"; 6 -> 0 "\x00" .. "a", "c" .. "r", "t" .. "\xff"; 6 -> 1 "b"; 6 -> 7 "s"; 7 -> 7 ?; start: 0; end: 7; Note that this change does not update the man page, any other output modes (it would be nice to support this in `dot` later), or make fsm able to read that input back in yet.
- Loading branch information
1 parent
bad9947
commit 4ff6cba
Showing
3 changed files
with
151 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters