Open DmitrySoshnikov opened 5 years ago
Given the complexity and large amounts of Unicode data involved, would it make sense to re-use the regexpu-core implementation for this?
I keep it up to date whenever Unicode updates, as well as the Test262 tests and V8 implementation.
Perhaps -- depending on how large this dependency is. Currently I try to keep regexp-tree with no/minumum number of dependencies on external libraries. The tool has transformation API, so it's kinda weird to involve a separate transformation API/parser/etc. I'll need to take a closer look.
I think it makes sense to have this transpiler be a separate regexp-tree plugin, in a separate repo + npm package (regardless of your decision to re-use regexpu-core or to do something else), for the reasons you describe.
FYI, the raw data (based on the Unicode data) lives in https://github.com/mathiasbynens/regenerate-unicode-properties. If you decide not to reuse regexpu-core perhaps you could still use this data.
Example:
Compiles to:
See example in https://mothereff.in/regexpu (@mathiasbynens)