mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibRegex: Make Match::capture_group_name an index into the string table
This removes another Match member that required destruction. The "API" for accessing the strings is definitely a bit awkward. We'll think of something nicer eventually.
This commit is contained in:
parent
9d47cc54f8
commit
54edf29f1b
Notes:
github-actions[bot]
2025-04-14 15:41:26 +00:00
Author: https://github.com/awesomekling
Commit: 54edf29f1b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4351
5 changed files with 11 additions and 10 deletions
|
@ -426,10 +426,10 @@ TEST_CASE(named_capture_group)
|
|||
EXPECT_EQ(result.count, 2u);
|
||||
EXPECT_EQ(result.matches.at(0).view, "Opacity=255");
|
||||
EXPECT_EQ(result.capture_group_matches.at(0).at(0).view, "255");
|
||||
EXPECT_EQ(result.capture_group_matches.at(0).at(0).capture_group_name, "Test");
|
||||
EXPECT_EQ(re.parser_result.bytecode.get_string(result.capture_group_matches.at(0).at(0).capture_group_name.value()), "Test");
|
||||
EXPECT_EQ(result.matches.at(1).view, "AudibleBeep=0");
|
||||
EXPECT_EQ(result.capture_group_matches.at(1).at(0).view, "0");
|
||||
EXPECT_EQ(result.capture_group_matches.at(1).at(0).capture_group_name, "Test");
|
||||
EXPECT_EQ(re.parser_result.bytecode.get_string(result.capture_group_matches.at(1).at(0).capture_group_name.value()), "Test");
|
||||
}
|
||||
|
||||
TEST_CASE(ecma262_named_capture_group_with_dollar_sign)
|
||||
|
@ -449,10 +449,10 @@ TEST_CASE(ecma262_named_capture_group_with_dollar_sign)
|
|||
EXPECT_EQ(result.count, 2u);
|
||||
EXPECT_EQ(result.matches.at(0).view, "Opacity=255");
|
||||
EXPECT_EQ(result.capture_group_matches.at(0).at(0).view, "255");
|
||||
EXPECT_EQ(result.capture_group_matches.at(0).at(0).capture_group_name, "$Test$");
|
||||
EXPECT_EQ(re.parser_result.bytecode.get_string(result.capture_group_matches.at(0).at(0).capture_group_name.value()), "$Test$");
|
||||
EXPECT_EQ(result.matches.at(1).view, "AudibleBeep=0");
|
||||
EXPECT_EQ(result.capture_group_matches.at(1).at(0).view, "0");
|
||||
EXPECT_EQ(result.capture_group_matches.at(1).at(0).capture_group_name, "$Test$");
|
||||
EXPECT_EQ(re.parser_result.bytecode.get_string(result.capture_group_matches.at(1).at(0).capture_group_name.value()), "$Test$");
|
||||
}
|
||||
|
||||
TEST_CASE(a_star)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue