-
Notifications
You must be signed in to change notification settings - Fork 256
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
Separation of metafunction and runtime regex code. #1219
Conversation
Instead of a separate file in ./source
Thanks! I've taken a pass at this to simplify (I hope), by moving all the metafunction stuff directly into Before I go further: Does that first step look okay? Then my second step would be to remember a global flag if |
Looks good. The global flag is probably the simplest way to implement this. But when we want to allow users, to write their own metafunctions. This functionality is probably required. |
Good point... better than a global flag is a function by which a metafunction can add a runtime |
The run-time support library stays in `cpp2util.h` and can use the `cpp2::regex::` subnamespace there The compile-time parts stay in `reflect.h2` and use the `cpp2::meta::` namespace there Eventually this can be generalized for user-written metafunctions when those are supported, but for right now this keeps things consistent for the metafunctions supplied in-the-box with cppfront
For metafunctions that require runtime support via #includes to be injected into lowered Cpp1 programs Also cleanup while I'm at it: - remove headers from `common.h` that are now already included via `cpp2util.h` - line up some thing that got un-lined-up (OCD)
OK, I've now finished adding to this PR, and I've updated the description to "closes #1199" which I think is accurate. I think this is ready to merge. Could you please take a look to see if you spot anything more, and if you don't find anything I'll merge it. Thanks again! |
Looks good. Adding the includes looks really simple. Would have needed quite some time to figure this out. |
You share credit for that! Your comment above:
directly motivated this line in the PR to solve the problem in #1199: t.add_runtime_support_include( "cpp2regex.h" ); Thanks! |
Closes #1199.
This MR separates
include/cpp2regex.h2
intoinclude/cpp2regex.h2
andsource/regex.h2
.cpp2regex.h2
contains all "runtime" functions for the regular expression matching.regex.h2
contains the parsing and generation functionality.