-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/regular expression metafunction #904
Feature/regular expression metafunction #904
Conversation
I am aiming to implement the POSIX extended specification with a few extras from perl. All in all I am sticking to the perl interpretation of regular expressions. |
The feature set is now complete as stated in https://en.wikipedia.org/wiki/Regular_expression. I grabbed the test suite from https://wiki.haskell.org/Regex_Posix https://hackage.haskell.org/package/regex-posix-unittest. I am currently working my way through the tests by fixing all the corner cases. Especially, the greed nature of |
I finished now the basic implementation and most of the test suite is passed. Some notable differences with respect to posix ERE:
I am now looking into performance tests and I will clean up the code. |
regression-tests/test-results/msvc-2022-c++20/pure2-assert-expected-not-null.cpp.output
Outdated
Show resolved
Hide resolved
@hsutter The regression tests are clean now except for one test where the source line of reflect.h2 has changed. I asked jarzec for help on this. Otherweise the branch is ready for a review. |
Thanks! I just pushed commit 0e1fdd5 which adds support for concatenated string literals that don't use interpolation, so you should now be able to write |
Ok, thanks. I changed it and it works now. Thanks for implementing it. |
…ssion_metafunction
Signed-off-by: Max Sagebaum <[email protected]>
…lar_expression_metafunction
…ssion_metafunction
a3776b5
to
788cf3d
Compare
Hurray. We are all green now. |
Thanks! I'll set aside a block of time to review, planning to start later this week. If you'll pause making commits to this branch by, say, Wednesday, then I can adjust things via commits to this branch without colliding? (I find fixing merge conflicts difficult, so I avoid making concurrent revisions in the same branch, especially since I plan to rename/move a file or two.) |
Sure, have fun. |
Probably line-ends Plus an MSVC minor version update Committing this just-whitespace update to clear the diff list before I make any review changes/renames...
In this project I'm trying to build *.h2 files in the same directory as the *.h they generate, and keep the same name In /include, "cpp2util.h" is named that way because it really is the Cpp2 run-time library... For regex, we could name it regex.h(2) or cpp2regex.h(2)... the argument for using "cpp2" is because it really does include additional run-time support for what will now be one of the Cpp2-built-in metafunctions... anyway we can always revisit that in the future...
Minus a couple of functions that aren't used And minor touchups, mainly int_to_string using more if-constexpr
Up to line ~1600 Looking good, mainly formatting tweaks to follow the repo's style
From line 1600 onward
Signed-off-by: Herb Sutter <[email protected]>
Looks very good, I think this great work is ready to move to |
Thanks. I am glad you found it ok. Now I know that curly braces have be on the next line. Sorry for the formatting. I will add some documentation next week in another pull request. So that users know how to apply this metafunction. |
Perfect, thanks! |
I will update this overview such that it is easy to grasp the status of the implementation.
Example file:
example.cpp2
Current status and planned on doing
Modifiers
Escape sequences (Complete)
Quantifiers (Complete)
Character Classes and other Special Escapes (Complete)
Assertions
Capture groups (Complete)
Quoting metacharacters (Complete)
Extended Patterns
Lookaround Assertions
Special Backtracking Control Verbs
Not planned (Mainly because of Unicode or perl specifics)
Modifiers
Escape sequences
Character Classes and other Special Escapes
Assertions
Extended Patterns
Script runs