Implemented handling of expressions matching no input #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, attempting to take the intersection of regular expressions with
non-overlapping multipliers (eg "aa" & "aaaa") would raise an Exception, instead
of producing a no match regular expression "[]". These (and other no-match)
expressions are now handled.
o Added a lego.multiplier representing 'never', by making the
multiplier.min/.max both 'inf' (bound(None)), a previously unused
configuration. This turns out to require little additional logic, and
actually cleans up some code.
o Handle multiplying an fsm by None to produce null (no match) fsm
o Optimize search for unused state number slightly to ~O(1) vs. O(n)
o Simplified - , while adding handling for never
o Allow representation of {} (never) and {0} (empty string) multipliers,
since they are always reduced
o Intersection of non-overlapping multipliers now produces new 'never'
multiplier, instead of producing invalid (inverted) multiplier Exception
o Prevent elimination of {}, {0} on lego string rendering; should virtually
never occur anyway, due to elimination by reduce()
o Moved bound/multiplier testing to start of unit tests, due to their
foundational nature.
o Added some empty/no-match unit tests
o Expand main.py to allow playing around with more expression variants,
including timing, and an interactive mode for testing input against union,
intersection and concatenation of supplied expression(s).
o Moved the lego.py multiplier tests to original order to minimize merge
o Restored restriction on representing zero/never multipliers in regexes
o Corrected processing of test input vectors in main.py example code