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

Question about Oniguruma implementation #2297

Open
Truncated opened this issue Jun 19, 2024 · 1 comment
Open

Question about Oniguruma implementation #2297

Truncated opened this issue Jun 19, 2024 · 1 comment

Comments

@Truncated
Copy link

Flavor Request

Apologies as I'm not honestly sure how to ask this question, but here's what I'm trying to figure out:

I'm trying to write a VSCode Textmate Grammar-based language for VSCode, and having a heck of a time figuring out the regex implementation differences.

I found that VSCode uses its own mod of textMate grammars and directly pulls Oniguruma via a dedicated binding here. This is updated, but not frequently. It's at 6.9.8 right now, which is really only .1 out of latest.

So Ruby and PHP both use Oniguruma, but they tend to be a lot more further back in versions. https://rubular.com/ uses Ruby 2.5.9., which I believe has version of Oniguruma v6.1.3.- PCRE is in the ballpark, but it's got enough differences to be problematic.

I'd like to see a raw version of Oni directly implemented, but selfishly I'd like to see the most compatible with the VSCode implementation. Is this even a flavor request or does it need to be some kind of implementation through an intermediary?

@slevithan
Copy link

Yes this is a flavor request. Oniguruma is a solid regex flavor but has quite a few differences from PCRE including lots of frustrating little quirks.

Note that, although you're right that TextMate grammars use Oniguruma, Ruby doesn't. Or rather, Ruby 1.9 did. Ruby 1.8 used a different flavor, and I believe Ruby 2.0+ uses Onigmo by default (which is an Oniguruma fork that extends it into its own new flavor).

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

No branches or pull requests

2 participants