Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Standardizing OnigScanner's second parameter #81

Open
zikaari opened this issue Jul 7, 2018 · 0 comments
Open

Standardizing OnigScanner's second parameter #81

zikaari opened this issue Jul 7, 2018 · 0 comments

Comments

@zikaari
Copy link

zikaari commented Jul 7, 2018

I maintain WebAssembly port of oniguruma called onigasm which is, and preferably should remain, 1:1 API compatible with node-oniguruma.

Certain circumstances now require OnigScanner's ability to use regex syntaxes/flavours other than default oniguruma syntax.

Now, of course that change doesn't need to be part of node-oniguruma right now, but if only node-oniguruma and onigasm could sync up on the new spec that'd be super cool.

Current API as of [email protected]

OnigScanner(patterns: string[])
OnigRegExp(pattern: string)

Proposed API (whenever `node-oniguruma decides to get on board)

type OnigOptions = {
    syntax: 'perl' | 'java' | 'ruby' | 'grep' | 'posix'
}

OnigScanner(patterns: string[], options?: OnigOptions)
OnigRegExp(pattern: string, options?: OnigOptions)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant