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

feat: implement std.match as standard function #715

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

Conversation

rohitjangid
Copy link
Member

@rohitjangid rohitjangid commented Jun 27, 2023

Implement std.match in standard library

cpp-jsonnet PR: google/jsonnet#1100

@coveralls
Copy link

Coverage Status

coverage: 68.588% (+0.02%) from 68.568% when pulling 8528221 on rohitjangid:feat/stringmatch into fed90cd on google:master.

@sparkprime
Copy link
Contributor

I was hoping to merge google/jsonnet#1039 this release, but I don't think we have a go-jsonnet equivalent yet (@sbarzowski is that right?) Apparently the stdlib regexes in Go are similar enough that we can consider them compatible, in which case maybe all you have to do is make sure the API has the same function name / param name as the existing PR?

@rohitjangid
Copy link
Member Author

If that is the case, I could create a separate PR with equivalent implementation of all the api in go. Let me know if I should go ahead with that considering cpp PR is yet to be merged.

@rohitjangid
Copy link
Member Author

I didn't found any documentation for google/jsonnet#1039
Is that part of any other PR?

@sbarzowski
Copy link
Collaborator

Very cool that this is happening!

Yeah, both this and google/jsonnet#1039 are RE2 based, so I'd just use go standard library here. There are minor differences, but full regexp compatibility beyond simple cases cannot be guaranteed anyway – they are not specified precisely enough.

I didn't found any documentation for google/jsonnet#1039

it doesn't have docs (yet), but you can see the summary in the PR description. If we could have the functions as described there, it would be great.

@sparkprime
Copy link
Contributor

I think this is going to make a lot of users very happy

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.

4 participants