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

Add String#byterindex #2193

Merged
merged 4 commits into from
Jul 6, 2024
Merged

Add String#byterindex #2193

merged 4 commits into from
Jul 6, 2024

Conversation

seven1m
Copy link
Member

@seven1m seven1m commented Jul 6, 2024

#217

Unfortunately there are some bits of the spec that we cannot pass with our current Onigmo library. I think we will need the patches that CRuby has for Onigmo that haven't been upstreamed.

I'm hesitant to vendor all the regex code from CRuby in our repository, as keeping it up-to-date would be a real pain. If we get ambitious someday, maybe we can try to upstream some of the Ruby changes to Onigmo... If that's even possible. I don't know if it's simply that no one has had time to upstream the changes, or if CRuby has a true fork of Onigmo at this point. 😬

In any case, I think this is good enough for now.

seven1m added 4 commits July 6, 2024 09:17
This might be as best we can do for now. In trying to get some of the
regexp handling to work with offsets, I noticed chunks of code in
CRuby's version of Onigmo that just don't exist in upstream. Without
this code, the backward matching of regular expressions will not match
CRuby. :-(

Checkout `backward_search_range` if you want to revisit this later.
@seven1m seven1m merged commit 29f62a1 into master Jul 6, 2024
15 checks passed
@seven1m seven1m deleted the string-byterindex branch July 6, 2024 16:49
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.

1 participant