mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibRegex: Allow references to capture groups that aren't parsed yet
This only applies to the ECMA262 parser. This behaviour is an ECMA262-specific quirk, such references always generate zero-length matches (even on subsequent passes). Also adds a test in LibJS's test suite. Fixes #6039.
This commit is contained in:
parent
804ab79995
commit
6bbb26fdaf
Notes:
sideshowbarker
2024-07-18 20:55:08 +09:00
Author: https://github.com/alimpfard
Commit: 6bbb26fdaf
Pull-request: https://github.com/SerenityOS/serenity/pull/6057
Issue: https://github.com/SerenityOS/serenity/issues/6039
6 changed files with 80 additions and 6 deletions
|
@ -768,7 +768,7 @@ public:
|
|||
|
||||
private:
|
||||
ALWAYS_INLINE static void compare_char(const MatchInput& input, MatchState& state, u32 ch1, bool inverse, bool& inverse_matched);
|
||||
ALWAYS_INLINE static bool compare_string(const MatchInput& input, MatchState& state, const char* str, size_t length);
|
||||
ALWAYS_INLINE static bool compare_string(const MatchInput& input, MatchState& state, const char* str, size_t length, bool& had_zero_length_match);
|
||||
ALWAYS_INLINE static void compare_character_class(const MatchInput& input, MatchState& state, CharClass character_class, u32 ch, bool inverse, bool& inverse_matched);
|
||||
ALWAYS_INLINE static void compare_character_range(const MatchInput& input, MatchState& state, u32 from, u32 to, u32 ch, bool inverse, bool& inverse_matched);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue