Skip to content

Commit

Permalink
Making the hole bigger; #576
Browse files Browse the repository at this point in the history
  • Loading branch information
the-moisrex committed Dec 30, 2024
1 parent 9d3c324 commit d77214a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion webpp/unicode/normalization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ namespace webpp::unicode {
if (prev_ccc < ccc && replaced_cp != replacement_char<char32_t>) {
// found a composition of cp1 and cp2
cp1 = replaced_cp;
hole.mark_code_point(cp2_pin.iter(), reducer.end());
hole.append_code_point(cp2_pin.iter(), reducer.end(), reducer.all_pins());
continue;
}
if (ccc == 0) [[likely]] {
Expand Down
12 changes: 12 additions & 0 deletions webpp/unicode/utf_reducer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,14 @@ namespace webpp::unicode {
this->append(other, iters);
}

template <typename IterableT>
constexpr void append_code_point(IterT start, IterT str_end, IterableT& iters) noexcept {
auto const end =
stl::next(start, checked::code_point_length<IterT, difference_type>(start, str_end));
utf_range_marker other(start, end);
this->append(other, iters);
}

constexpr void clear() noexcept {
beginp = endp = IterT{};
}
Expand Down Expand Up @@ -351,6 +359,10 @@ namespace webpp::unicode {
// do nothing
}

constexpr void append_code_point([[maybe_unused]] auto&&... args) noexcept {
// do nothing
}

[[nodiscard]] constexpr bool empty() const noexcept {
return true;
}
Expand Down

0 comments on commit d77214a

Please sign in to comment.