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

fix function signatures, to ensure compilation without warnings with latest V #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spytheman
Copy link

@spytheman spytheman commented Mar 31, 2023

With this PR:

#0 19:33:08 ᛋ master ~/.vmodules/srackham/pcre2❱v run examples/pcre2-example-1.v 
['nisi', 'dis', 'diam', 'natoque']
Lorem "nisi" "dis" "diam" a cras placerat "natoque"
Lorem NISI DIS DIAM a cras placerat NATOQUE
Lorem NISI DIS DIAM a cras placerat NATOQUE
#0 19:33:26 ᛋ master ~/.vmodules/srackham/pcre2❱

i.e. there are no more warnings.

srackham added a commit that referenced this pull request Apr 2, 2023
@srackham
Copy link
Owner

srackham commented Apr 2, 2023

Thanks for the PR and for alerting me to this issue.

The PR changes the find_match function signature so that instead of returning none on no match (PCRE2_ERROR_NOMATCH) it returns an error with a blank string error message. This fixes the error warning but it's kind of weird to class no match as an error.

I've pushed a commit (98f2fbe) that retains the current behaviour (returns none when there is no-match). The return of none is in keeping with Go regexp package convention of returning nil on no match.

I also updated the internal get function to conform to the new V split Option/Result behaviour.

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