Refined some basic concepts of the crate #2
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.
Hi! I've started checking the code for memory soundness around the Box::leak idea you've used, and, as one would expect, it was leaking memory. So I ended up changing quite a bit of logic around the idea of how Text gets formatted and escaped to avoid memory leaks without breaking the convenience of using &str for chunks of the regex being built. I think the current version is far better in terms of its internal logic and it avoids making RE engine to escape things in the Text portions of the regex. But then I got carried away and changed other things as well... Hope you like them!
Another change is around Exactly, it was kind of misnamed, as it was matching whole words, not whole lines. Furthermore, the pattern of using Exactly(Word) was silly, so I moved things around a bit to make it possible to write something like
which feels far less cluttered then the original version with Exactly wrapping every Text tag.
Finally, I've moved grouping into its own trait and implemented it for Type as well as Input objects. This makes it possible to define groups over things like single Digit objects, which is quite nice to use.
Overall, I hope you like these changes, looking forward for your feedback.