1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

LibRegex: In non-Unicode mode, parse \u{4} as a repetition pattern

This commit is contained in:
Timothy Flynn 2021-08-15 10:29:03 -04:00 committed by Ali Mohammad Pur
parent e85c62e3a0
commit a9716ad44e
2 changed files with 8 additions and 4 deletions

View file

@ -1489,13 +1489,15 @@ bool ECMA262Parser::parse_atom_escape(ByteCode& stack, size_t& match_length_mini
if (try_skip("u")) {
if (match(TokenType::LeftCurly)) {
consume();
if (!unicode) {
// FIXME: In non-Unicode mode, this should be parsed as a repetition symbol (repeating the 'u').
TODO();
// In non-Unicode mode, this should be parsed as a repetition symbol (repeating the 'u').
match_length_minimum += 1;
stack.insert_bytecode_compare_values({ { CharacterCompareType::Char, (ByteCodeValueType)'u' } });
return true;
}
consume();
auto code_point = read_digits(ReadDigitsInitialZeroState::Allow, true, 6);
if (code_point.has_value() && is_unicode(*code_point) && match(TokenType::RightCurly)) {
consume();