diff options
| author | Maxime Coste <mawww@kakoune.org> | 2022-08-05 20:29:43 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2022-08-05 20:31:39 +1000 |
| commit | ca71d8997d6144fd7bc770ff458d469a989d576c (patch) | |
| tree | 877d54e0cd206ccddbf17dbed20479959e090aa1 /src/regex_impl.hh | |
| parent | 26d14d52bb922ccdf896fd1dae392f6cbbbb132e (diff) | |
Reuse existing character classes when possible in regex
Diffstat (limited to 'src/regex_impl.hh')
| -rw-r--r-- | src/regex_impl.hh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/regex_impl.hh b/src/regex_impl.hh index ca859592..73d69790 100644 --- a/src/regex_impl.hh +++ b/src/regex_impl.hh @@ -33,12 +33,18 @@ constexpr bool with_bit_ops(Meta::Type<CharacterType>) { return true; } struct CharacterClass { - struct Range { Codepoint min, max; }; + struct Range + { + Codepoint min, max; + friend bool operator==(const Range&, const Range&) = default; + }; Vector<Range, MemoryDomain::Regex> ranges; CharacterType ctypes = CharacterType::None; bool negative = false; bool ignore_case = false; + + friend bool operator==(const CharacterClass&, const CharacterClass&) = default; }; bool is_character_class(const CharacterClass& character_class, Codepoint cp); |
