mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:58:11 +00:00
LibRegex: Support property escapes of Unicode General Categories
This changes LibRegex to parse the property escape as a Variant of Unicode Property & General Category values. A byte code instruction is added to perform matching based on General Category values.
This commit is contained in:
parent
5de6d3dd90
commit
1e10d6d7ce
5 changed files with 77 additions and 19 deletions
|
@ -661,6 +661,12 @@ TEST_CASE(ECMA262_property_match)
|
|||
{ "\\p{ASCII_Hex_Digit}", "x", false, ECMAScriptFlags::Unicode },
|
||||
{ "\\p{Any}", "\xcd\xb8", true, ECMAScriptFlags::Unicode }, // U+0378, which is an unassigned code point.
|
||||
{ "\\p{Assigned}", "\xcd\xb8", false, ECMAScriptFlags::Unicode }, // U+0378, which is an unassigned code point.
|
||||
{ "\\p{Lu}", "a", false, ECMAScriptFlags::Unicode },
|
||||
{ "\\p{Lu}", "A", true, ECMAScriptFlags::Unicode },
|
||||
{ "\\p{Lu}", "9", false, ECMAScriptFlags::Unicode },
|
||||
{ "\\p{Cased_Letter}", "a", true, ECMAScriptFlags::Unicode },
|
||||
{ "\\p{Cased_Letter}", "A", true, ECMAScriptFlags::Unicode },
|
||||
{ "\\p{Cased_Letter}", "9", false, ECMAScriptFlags::Unicode },
|
||||
};
|
||||
|
||||
for (auto& test : tests) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue