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

Matching on streams #45

Open
cpitclaudel opened this issue Dec 14, 2016 · 2 comments
Open

Matching on streams #45

cpitclaudel opened this issue Dec 14, 2016 · 2 comments

Comments

@cpitclaudel
Copy link

Hi,

This is a cross-post of k-takata/Onigmo#83 ; I'm not sure where is would make most sense to implement this feature, or whether it would be feasible at all.

How hard would it be to extend this library to support matching on arbitrary streams, instead of strings? I'm looking for an equivalent of TRE's tre_reguexec.

The basic idea is that the caller can pass the equivalent of an iterator over something that may not be a string. This would make it possible to match over gap buffers, ropes, piece tables, and other string implementations that do not rely on a contiguous char array.

Thanks!

@kkos
Copy link
Owner

kkos commented Dec 18, 2016

It is difficult for me.
TRE uses indices to express current position of subject string, but Oniguruma uses pointers.
To your purpose, how about that you hack TRE?

@cpitclaudel
Copy link
Author

Things already work with TRE for my purpose. My ultimate goal would be to use oniguruma as Emacs' regex engine. The main thing that's missing at the moment is the ability to match on a gap buffer, which can essentially be thought of as two separate strings. Maybe two strings is easier to support than arbitrary streams?

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