-
Notifications
You must be signed in to change notification settings - Fork 643
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Unicode property escape support to RegExp (#1295)
Summary: Extends RegExp to handle `\p` and `\P` Unicode property escapes, standalone and within character classes, for Unicode mode. The implementation extends the existing idea of tables of codepoint ranges to cover all of the properties explicitly required by ES262. The `genUnicodeTable.py` script was updated to generate code related to the binary and non-binary Unicode properties explicitly mentioned in ES262 ([ref](https://tc39.es/ecma262/multipage/text-processing.html#sec-runtime-semantics-unicodematchproperty-p)); based on the Unicode 15.1.0 data files. Closes #1027 Pull Request resolved: #1295 Test Plan: - Added `regexp_unicode_properties.js` to the Hermes test suite - Binary properties and the General_Category properties - Non-binary properties (Script=Latin, Script_Extensions=Thai) - Inverted character class escapes `\p{…}` and `\P{…}` - All of the above atom escapes in and out of character classes - Exercise the parser for the above forms, and incomplete forms - test262 suite via `hermes/utils/testsuite/run_testsuite.py` - I had to use `--test-skiplist` otherwise around 417 tests (in `test262/test/built-ins/RegExp/property-escapes`) are skipped with the reason "Skipping test with 'const'". This was confusing to me since most of these do pass, but I couldn't find an explainer for this skip. - There are some failures here, at least one of which is caused by [test262 not being updated for Unicode 15.1.0](tc39/test262#3945), which I see as test suite issue rather than an implementation issue. Reviewed By: avp Differential Revision: D56493540 Pulled By: neildhar fbshipit-source-id: 55c86e2d321fc03601b418e0244c099a98759f3f
- Loading branch information
1 parent
8991646
commit dcf8e7b
Showing
14 changed files
with
10,368 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.