summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibRegex/RegexByteCode.h
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-07-18 05:07:01 +0430
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-07-18 21:10:55 +0430
commitf364fcec5da902ca8ae84dc0bca0f23533cebaa4 (patch)
treec71724ba7f1074671212cbb30adf3b5e6561e923 /Userland/Libraries/LibRegex/RegexByteCode.h
parente5af15a6e913bde254657990628e31c598a4a94f (diff)
downloadserenity-f364fcec5da902ca8ae84dc0bca0f23533cebaa4.zip
LibRegex+Everywhere: Make LibRegex more unicode-aware
This commit makes LibRegex (mostly) capable of operating on any of the three main string views: - StringView for raw strings - Utf8View for utf-8 encoded strings - Utf32View for raw unicode strings As a result, regexps with unicode strings should be able to properly handle utf-8 and not stop in the middle of a code point. A future commit will update LibJS to use the correct type of string depending on the flags.
Diffstat (limited to 'Userland/Libraries/LibRegex/RegexByteCode.h')
-rw-r--r--Userland/Libraries/LibRegex/RegexByteCode.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibRegex/RegexByteCode.h b/Userland/Libraries/LibRegex/RegexByteCode.h
index d53ab64462..ba1d3214a2 100644
--- a/Userland/Libraries/LibRegex/RegexByteCode.h
+++ b/Userland/Libraries/LibRegex/RegexByteCode.h
@@ -682,7 +682,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, bool& had_zero_length_match);
+ ALWAYS_INLINE static bool compare_string(const MatchInput& input, MatchState& state, RegexStringView const& str, 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);
};