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

Update path2regex. #168

Merged
merged 1 commit into from
Oct 10, 2022
Merged

Update path2regex. #168

merged 1 commit into from
Oct 10, 2022

Conversation

Lord-Kamina
Copy link

Updated the path2regex code to be in line with the latest version of the javascript code, this version does not rely on std::cregex_iterator to create the matching pattern., and thus solves #166

I haven't tested it too extensively, but I did test it with some of the examples from the wiki, as well as in the context of performous, and it appears to be working as expected.

Of note: This version does not allow modifiers outside a capturing group, so for example to match anything the route would be "(.*)" instead of ".*"

Updated the path2regex code to be in line with the latest version of the javascript code, this version does not rely on std::cregex_iterator to create the matching pattern.

# Conflicts:
#	dev/restinio/path2regex/path2regex.hpp
@eao197
Copy link
Member

eao197 commented Oct 7, 2022

Thanks, @Lord-Kamina

I'll try to take look at it a the beginning of the next week.

cc @ngrodzitski

@eao197 eao197 changed the base branch from master to 0.6-dev-pr-168 October 10, 2022 09:24
@eao197 eao197 merged commit 05ad38d into Stiffstream:0.6-dev-pr-168 Oct 10, 2022
@eao197
Copy link
Member

eao197 commented Oct 10, 2022

Sorry, I can't accept this PR because I can't compile it.

https://github.com/performous/restinio/blob/deeaf083d95cb80a1746048d4f9851050cb95b65/dev/restinio/path2regex/path2regex.hpp#L611-L618
There are no data members value and index in lextoken_t struct (but they are initialized in constructors).

https://github.com/performous/restinio/blob/deeaf083d95cb80a1746048d4f9851050cb95b65/dev/restinio/path2regex/path2regex.hpp#L622-L648
There is no closing } for switch statement.

After fixing those errors I got:

./restinio/third_party/optional-lite/optional.hpp:803:9: error: no matching 'operator new' function for non-allocating placement new expression; include <new>
        ::new( value_ptr() ) value_type( std::forward<Args>(args)... );
        ^~
./restinio/third_party/optional-lite/optional.hpp:797:9: note: in instantiation of function template specialization 'nonstd::optional_lite::detail::storage_t<const std::basic_string<char>>::emplace<const std::basic_string<char> &>' requested here
        emplace( std::forward<Args>(args)... );

in C++14 mode.

@Lord-Kamina
Copy link
Author

Lord-Kamina commented Oct 11, 2022

Huh... this seems like some kind of weird merge error.

How the eff did it compile for me, then?

Can you reopen the PR so I can fix it properly?

Edit: where is that optional-lite error coming from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants