Merge multiple regex transform plugin (#10447)

* feat: implement create-regexp-features-plugin

* fix: test input is not effective

* refactor: leverage create-regexp-features-plugin

* test: add more test cases

* test: update test fixture

* chore: add type annotation to features

* test: add regression test for issue 9892

* add regression test for issue 9199

* address review comments from Nicolò

* address review comments from Brian

* small tweaks

* Enable dotAllFlag when flags includes u
This commit is contained in:
Huáng Jùnliàng
2019-10-29 17:58:04 -04:00
committed by Nicolò Ribaudo
parent ec3345bb57
commit 8ffca0475a
38 changed files with 333 additions and 113 deletions

View File

@@ -0,0 +1,2 @@
var a = /\p{Unified_Ideograph}./u;
var b = /\p{Unified_Ideograph}./su;

View File

@@ -0,0 +1,3 @@
{
"plugins": ["transform-dotall-regex", "proposal-unicode-property-regex"]
}

View File

@@ -0,0 +1,2 @@
var a = /[\u3400-\u4DB5\u4E00-\u9FEF\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29\u{20000}-\u{2A6D6}\u{2A700}-\u{2B734}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}][\0-\t\x0B\f\x0E-\u2027\u202A-\u{10FFFF}]/u;
var b = /[\u3400-\u4DB5\u4E00-\u9FEF\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29\u{20000}-\u{2A6D6}\u{2A700}-\u{2B734}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}][\0-\u{10FFFF}]/u;