-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[regexp] Replace whitespace and digit comparison instructions with ge…
…neric set comparisons (#105) ## Summary In preparation for fixes to case insensitive mode we are moving some special comparison instructions to generic set comparisons. This PR refactors whitespace and digit comparison instructions to use the generic set comparison path, meaning individual comparisons are emitted for each range in the set. Also fixes generating a set for the unimplemented "Assigned" binary property. ## Tests Verify that bytecode snapshot tests for digit and whitespace character classes are updated with the new comparison instructions.
- Loading branch information
1 parent
1bafa68
commit 72b163a
Showing
11 changed files
with
89 additions
and
184 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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/\d\D/; | ||
|
||
// Shorthand as single element of class | ||
/[\d][\D]/; | ||
|
||
// Shorthand mixed in class | ||
/[\da][\D4]/; | ||
/[\da-z][\D4-6]/; | ||
|
||
// Union is the entire unicode range | ||
/[\d\D]/; |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
11 changes: 7 additions & 4 deletions
11
tests/js_regexp_bytecode/class/shorthand.js → ...regexp_bytecode/class/whitespace_class.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
// Shorthand digit and whitespace classes have own instructions | ||
/\d\D\s\S/; | ||
/\s\S/; | ||
|
||
// Shorthand as single element of class | ||
/[\d][\D][\s][\S]/; | ||
/[\s][\S]/; | ||
|
||
// Shorthand mixed in class | ||
/[\da][\Da][\sa][\Sa]/; | ||
/[\da-z][\Da-z][\sa-z][\Sa-z]/ | ||
/[\sa][\S\x0B]/; | ||
/[\sa-z][\S\x0A-\x0C]/; | ||
|
||
// Union is the entire unicode range | ||
/[\s\S]/; |
Binary file not shown.
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