1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:27:35 +00:00

LibRegex: Support property escapes of the form \p{Type=Value}

Before now, only binary properties could be parsed. Non-binary props are
of the form "Type=Value", where "Type" may be General_Category, Script,
or Script_Extension (or their aliases). Of these, LibUnicode currently
supports General_Category, so LibRegex can parse only that type.
This commit is contained in:
Timothy Flynn 2021-07-31 18:06:53 -04:00 committed by Ali Mohammad Pur
parent 011514a384
commit 4de4312827
2 changed files with 40 additions and 11 deletions

View file

@ -667,6 +667,12 @@ TEST_CASE(ECMA262_property_match)
{ "\\p{Cased_Letter}", "a", true, ECMAScriptFlags::Unicode },
{ "\\p{Cased_Letter}", "A", true, ECMAScriptFlags::Unicode },
{ "\\p{Cased_Letter}", "9", false, ECMAScriptFlags::Unicode },
{ "\\p{General_Category=Cased_Letter}", "a", true, ECMAScriptFlags::Unicode },
{ "\\p{General_Category=Cased_Letter}", "A", true, ECMAScriptFlags::Unicode },
{ "\\p{General_Category=Cased_Letter}", "9", false, ECMAScriptFlags::Unicode },
{ "\\p{gc=Cased_Letter}", "a", true, ECMAScriptFlags::Unicode },
{ "\\p{gc=Cased_Letter}", "A", true, ECMAScriptFlags::Unicode },
{ "\\p{gc=Cased_Letter}", "9", false, ECMAScriptFlags::Unicode },
};
for (auto& test : tests) {