timbray / quamina

Home of Quamina, a fast pattern-matching library in Go
Apache License 2.0
393 stars 19 forks source link

addresses issue #310 #311

Closed timbray closed 4 months ago

timbray commented 4 months ago

add a prettyprinter for NFAs

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 97.95918% with 2 lines in your changes missing coverage. Please review.

Project coverage is 96.39%. Comparing base (b74612e) to head (7c5c99d).

Files Patch % Lines
prettyprinter.go 97.40% 1 Missing and 1 partial :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #311 +/- ## ========================================== + Coverage 96.32% 96.39% +0.06% ========================================== Files 17 18 +1 Lines 1634 1718 +84 ========================================== + Hits 1574 1656 +82 - Misses 34 35 +1 - Partials 26 27 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

timbray commented 4 months ago

Once again, deep NFA twiddling, will push it myself if nobody wants to review. However, have a glance at TestPP() in prettyerinter_test.go to see what the prettyprinter output looks like for the wildcard pattern "x9". I found this output absolutely essential in debugging the transition from DFA to NFA. In that output, the abbreviation gS stands for "glob state", i.e. when you arrive at `and loop back on anything but a particular byte value. The state you reach when you see that particular value and exit the glob has a name includinggX` for "glob exit".

If you have an idea for an improvement in the prettyerinter output, feel free to comment.

timbray commented 4 months ago

LGTM, perhaps squash before merging

Thanks! Your input really improved this one. I'll let GitHub do the squashing, that seems to work OK with the CI.