Skip to content
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

Improve boilerplate implementation #154

Merged
merged 3 commits into from May 2, 2022
Merged

Improve boilerplate implementation #154

merged 3 commits into from May 2, 2022

Conversation

Headline
Copy link
Owner

@Headline Headline commented Apr 30, 2022

Fixes #152
This is an extension to the boilerplate implementation, we'll see a few things developed on this branch.

This patch will move some of the regex creation to be in the constants.rs and prevent regex recompilation after every compilation request, something that we needed to bring lazy_static in to accomplish.

Our end goal is to move function declarations out of main methods, that way functions can be created and moved to their correct places as needed.

We'll need a regex made that allows us to detect function definitions. Unlike our main regexes, we'd need to match functions that could have templated/generic return types. Let's use C++ as an example.

std::vector < int > myfunc(int a, int b) {
    return std::vector{a, b};
}
for (auto i : myfunc(3, 5)) {
    std::cout << i << std::endl;
}

A request in this form should not trip up our detection, so correctly matching any function call regardless of it's return type form might be tricky, we'll have to see.

@Headline Headline added enhancement New feature or request dependencies Pull requests that update a dependency file labels Apr 30, 2022
@Headline Headline merged commit 4d9056b into master May 2, 2022
@Headline Headline deleted the boilerplate-ext branch May 2, 2022 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Language auto-boilerplate
1 participant