diff options
author | 2016-10-22 11:31:49 +0200 | |
---|---|---|
committer | 2016-10-22 11:31:49 +0200 | |
commit | 23ad94073f4c2f7131fa0c95b6202f2f9027db41 (patch) | |
tree | 4f4e1e27a22ace8fea49b63030d4462db7cb68a1 /src/tools/srcclean.cpp | |
parent | 255bf78b316a9dc9e4c53a65143000471a6927d3 (diff) |
use standard types uintptr_t, char16_t and char32_t instead of FPTR, utf16_char, unicode_char (nw)
Diffstat (limited to 'src/tools/srcclean.cpp')
-rw-r--r-- | src/tools/srcclean.cpp | 260 |
1 files changed, 130 insertions, 130 deletions
diff --git a/src/tools/srcclean.cpp b/src/tools/srcclean.cpp index 55ee72444fd..504392e7fa0 100644 --- a/src/tools/srcclean.cpp +++ b/src/tools/srcclean.cpp @@ -95,55 +95,55 @@ public: virtual void summarise(std::ostream &os) const; protected: - static constexpr unicode_char HORIZONTAL_TAB = 0x0000'0009U; - static constexpr unicode_char LINE_FEED = 0x0000'000aU; - static constexpr unicode_char VERTICAL_TAB = 0x0000'000bU; - static constexpr unicode_char SPACE = 0x0000'0020U; - static constexpr unicode_char DOUBLE_QUOTE = 0x0000'0022U; - static constexpr unicode_char SINGLE_QUOTE = 0x0000'0027U; - static constexpr unicode_char HYPHEN_MINUS = 0x0000'002dU; - static constexpr unicode_char QUESTION_MARK = 0x0000'003fU; - static constexpr unicode_char BACKSLASH = 0x0000'005cU; - static constexpr unicode_char BASIC_LATIN_LAST = 0x0000'007fU; - static constexpr unicode_char CYRILLIC_SUPPLEMENT_LAST = 0x0000'052fU; + static constexpr char32_t HORIZONTAL_TAB = 0x0000'0009U; + static constexpr char32_t LINE_FEED = 0x0000'000aU; + static constexpr char32_t VERTICAL_TAB = 0x0000'000bU; + static constexpr char32_t SPACE = 0x0000'0020U; + static constexpr char32_t DOUBLE_QUOTE = 0x0000'0022U; + static constexpr char32_t SINGLE_QUOTE = 0x0000'0027U; + static constexpr char32_t HYPHEN_MINUS = 0x0000'002dU; + static constexpr char32_t QUESTION_MARK = 0x0000'003fU; + static constexpr char32_t BACKSLASH = 0x0000'005cU; + static constexpr char32_t BASIC_LATIN_LAST = 0x0000'007fU; + static constexpr char32_t CYRILLIC_SUPPLEMENT_LAST = 0x0000'052fU; template <typename OutputIt> cleaner_base(OutputIt &&output, newline newline_mode, unsigned tab_width); - void output_character(unicode_char ch); + void output_character(char32_t ch); void set_tab_limit(); void reset_tab_limit(); private: - static constexpr unicode_char CARRIAGE_RETURN = 0x0000'000dU; - static constexpr unicode_char HIGH_SURROGATE_FIRST = 0x0000'd800U; - static constexpr unicode_char HIGH_SURROGATE_LAST = 0x0000'dbffU; - static constexpr unicode_char LOW_SURROGATE_FIRST = 0x0000'dc00U; - static constexpr unicode_char LOW_SURROGATE_LAST = 0x0000'dfffU; - static constexpr unicode_char NONCHARACTER_FIRST = 0x0000'fdd0U; - static constexpr unicode_char NONCHARACTER_LAST = 0x0000'fdefU; - static constexpr unicode_char ZERO_WIDTH_NB_SPACE = 0x0000'feffU; - static constexpr unicode_char REPLACEMENT_CHARACTER = 0x0000'fffdU; - static constexpr unicode_char SUPPLEMENTARY_FIRST = 0x0001'0000U; - static constexpr unicode_char SUPPLEMENTARY_LAST = 0x0010'ffffU; - - static constexpr unicode_char CODE_LENGTH_THRESHOLDS[6]{ + static constexpr char32_t CARRIAGE_RETURN = 0x0000'000dU; + static constexpr char32_t HIGH_SURROGATE_FIRST = 0x0000'd800U; + static constexpr char32_t HIGH_SURROGATE_LAST = 0x0000'dbffU; + static constexpr char32_t LOW_SURROGATE_FIRST = 0x0000'dc00U; + static constexpr char32_t LOW_SURROGATE_LAST = 0x0000'dfffU; + static constexpr char32_t NONCHARACTER_FIRST = 0x0000'fdd0U; + static constexpr char32_t NONCHARACTER_LAST = 0x0000'fdefU; + static constexpr char32_t ZERO_WIDTH_NB_SPACE = 0x0000'feffU; + static constexpr char32_t REPLACEMENT_CHARACTER = 0x0000'fffdU; + static constexpr char32_t SUPPLEMENTARY_FIRST = 0x0001'0000U; + static constexpr char32_t SUPPLEMENTARY_LAST = 0x0010'ffffU; + + static constexpr char32_t CODE_LENGTH_THRESHOLDS[6]{ 0x0000'0000U, 0x0000'0080U, 0x0000'0800U, 0x0001'0000U, 0x0020'0000U, 0x0400'0000 }; typedef std::function<void (char)> output_function; - virtual void process_characters(unicode_char const *begin, unicode_char const *end) = 0; + virtual void process_characters(char32_t const *begin, char32_t const *end) = 0; virtual void input_complete() = 0; void flush_whitespace(); - void output_utf8(unicode_char ch); - void commit_character(unicode_char ch); + void output_utf8(char32_t ch); + void commit_character(char32_t ch); void process_if_full(); void handle_lead_byte(std::uint8_t ch); - void handle_codepoint(unicode_char cp); + void handle_codepoint(char32_t cp); - static constexpr bool is_character(unicode_char ch) + static constexpr bool is_character(char32_t ch) { return (ch <= SUPPLEMENTARY_LAST) && @@ -151,17 +151,17 @@ private: ((ch & 0x0000'fffeU) != 0x0000'fffeU); } - static constexpr bool is_high_surrogate(unicode_char ch) + static constexpr bool is_high_surrogate(char32_t ch) { return (ch >= HIGH_SURROGATE_FIRST) && (ch <= HIGH_SURROGATE_LAST); } - static constexpr bool is_low_surrogate(unicode_char ch) + static constexpr bool is_low_surrogate(char32_t ch) { return (ch >= LOW_SURROGATE_FIRST) && (ch <= LOW_SURROGATE_LAST); } - static constexpr unicode_char combine_surrogates(unicode_char high, unicode_char low) + static constexpr char32_t combine_surrogates(char32_t high, char32_t low) { return SUPPLEMENTARY_FIRST + (((high & 0x0000'03ffU) << 10U) | (low & 0x0000'03ffU)); } @@ -175,16 +175,16 @@ private: unsigned m_output_column = 0U; unsigned m_indent; unsigned m_tab_limit = std::numeric_limits<unsigned>::max(); - std::vector<unicode_char> m_whitespace; + std::vector<char32_t> m_whitespace; // input state management - unicode_char m_buffer[1024]; + char32_t m_buffer[1024]; bool m_stream_start = true; std::size_t m_position = 0U; - unicode_char m_surrogate = 0U; + char32_t m_surrogate = 0U; unsigned m_code_length = 0U; unsigned m_required_bytes = 0U; - unicode_char m_newline_lead = 0U; + char32_t m_newline_lead = 0U; // statistics std::uint64_t m_overlong = 0U; @@ -207,7 +207,7 @@ private: bool m_final_newline = false; }; -constexpr unicode_char cleaner_base::CODE_LENGTH_THRESHOLDS[6]; +constexpr char32_t cleaner_base::CODE_LENGTH_THRESHOLDS[6]; /*-------------------------------------------------- @@ -226,7 +226,7 @@ void cleaner_base::process(InputIt begin, InputIt end) if ((byte & 0xc0U) == 0x80U) { m_buffer[m_position] <<= 6U; - m_buffer[m_position] |= unicode_char(byte & 0x3fU); + m_buffer[m_position] |= char32_t(byte & 0x3fU); --m_required_bytes; } else @@ -401,7 +401,7 @@ cleaner_base::cleaner_base( normalisation and line ending translation --------------------------------------------------*/ -void cleaner_base::output_character(unicode_char ch) +void cleaner_base::output_character(char32_t ch) { switch (ch) { @@ -455,7 +455,7 @@ void cleaner_base::set_tab_limit() if (!m_output_column) { unsigned limit(0U); - for (unicode_char ch : m_whitespace) + for (char32_t ch : m_whitespace) limit += (HORIZONTAL_TAB == ch) ? (m_tab_width - (limit % m_tab_width)) : 1U; m_tab_limit = limit; } @@ -488,7 +488,7 @@ void cleaner_base::flush_whitespace() bool const set_indent(!m_output_column); bool expand(m_output_column); unsigned space_count(0U); - for (unicode_char space : m_whitespace) + for (char32_t space : m_whitespace) { assert(!expand || !space_count); assert(space_count < m_tab_width); @@ -562,7 +562,7 @@ void cleaner_base::flush_whitespace() convert codepoint to UFF-8 and send to output --------------------------------------------------*/ -void cleaner_base::output_utf8(unicode_char ch) +void cleaner_base::output_utf8(char32_t ch) { if (0x0000'0080U > ch) { @@ -589,7 +589,7 @@ void cleaner_base::output_utf8(unicode_char ch) replacing noncharacters --------------------------------------------------*/ -void cleaner_base::commit_character(unicode_char ch) +void cleaner_base::commit_character(char32_t ch) { assert(ARRAY_LENGTH(m_buffer) > m_position); assert(1U <= m_code_length); @@ -716,7 +716,7 @@ void cleaner_base::handle_lead_byte(std::uint8_t byte) m_code_length = m_required_bytes + 1U; if (m_required_bytes) { - m_buffer[m_position] = ((unicode_char(1U) << (6U - m_required_bytes)) - 1) & unicode_char(byte); + m_buffer[m_position] = ((char32_t(1U) << (6U - m_required_bytes)) - 1) & char32_t(byte); } else if ((byte & 0xc0U) == 0x80U) { @@ -741,7 +741,7 @@ void cleaner_base::handle_lead_byte(std::uint8_t byte) surrogates --------------------------------------------------*/ -void cleaner_base::handle_codepoint(unicode_char cp) +void cleaner_base::handle_codepoint(char32_t cp) { if (m_surrogate) { @@ -790,7 +790,7 @@ public: } private: - virtual void process_characters(unicode_char const *begin, unicode_char const *end) override + virtual void process_characters(char32_t const *begin, char32_t const *end) override { while (begin != end) output_character(*begin++); @@ -817,29 +817,29 @@ public: virtual void summarise(std::ostream &os) const override; protected: - void output_character(unicode_char ch); + void output_character(char32_t ch); private: - static constexpr unicode_char ASTERISK = 0x0000'002aU; - static constexpr unicode_char SLASH = 0x0000'002fU; - static constexpr unicode_char UPPERCASE_FIRST = 0x0000'0041U; - static constexpr unicode_char UPPERCASE_B = 0x0000'0042U; - static constexpr unicode_char UPPERCASE_X = 0x0000'0058U; - static constexpr unicode_char UPPERCASE_LAST = 0x0000'005aU; - static constexpr unicode_char UNDERSCORE = 0x0000'005fU; - static constexpr unicode_char LOWERCASE_FIRST = 0x0000'0061U; - static constexpr unicode_char LOWERCASE_B = 0x0000'0062U; - static constexpr unicode_char LOWERCASE_X = 0x0000'0078U; - static constexpr unicode_char LOWERCASE_LAST = 0x0000'007aU; - - static constexpr unicode_char DIGIT_FIRST = 0x0000'0030U; - static constexpr unicode_char DIGIT_BINARY_LAST = 0x0000'0031U; - static constexpr unicode_char DIGIT_OCTAL_LAST = 0x0000'0037U; - static constexpr unicode_char DIGIT_DECIMAL_LAST = 0x0000'0039U; - static constexpr unicode_char DIGIT_HEX_UPPER_FIRST = 0x0000'0041U; - static constexpr unicode_char DIGIT_HEX_UPPER_LAST = 0x0000'0046U; - static constexpr unicode_char DIGIT_HEX_LOWER_FIRST = 0x0000'0061U; - static constexpr unicode_char DIGIT_HEX_LOWER_LAST = 0x0000'0066U; + static constexpr char32_t ASTERISK = 0x0000'002aU; + static constexpr char32_t SLASH = 0x0000'002fU; + static constexpr char32_t UPPERCASE_FIRST = 0x0000'0041U; + static constexpr char32_t UPPERCASE_B = 0x0000'0042U; + static constexpr char32_t UPPERCASE_X = 0x0000'0058U; + static constexpr char32_t UPPERCASE_LAST = 0x0000'005aU; + static constexpr char32_t UNDERSCORE = 0x0000'005fU; + static constexpr char32_t LOWERCASE_FIRST = 0x0000'0061U; + static constexpr char32_t LOWERCASE_B = 0x0000'0062U; + static constexpr char32_t LOWERCASE_X = 0x0000'0078U; + static constexpr char32_t LOWERCASE_LAST = 0x0000'007aU; + + static constexpr char32_t DIGIT_FIRST = 0x0000'0030U; + static constexpr char32_t DIGIT_BINARY_LAST = 0x0000'0031U; + static constexpr char32_t DIGIT_OCTAL_LAST = 0x0000'0037U; + static constexpr char32_t DIGIT_DECIMAL_LAST = 0x0000'0039U; + static constexpr char32_t DIGIT_HEX_UPPER_FIRST = 0x0000'0041U; + static constexpr char32_t DIGIT_HEX_UPPER_LAST = 0x0000'0046U; + static constexpr char32_t DIGIT_HEX_LOWER_FIRST = 0x0000'0061U; + static constexpr char32_t DIGIT_HEX_LOWER_LAST = 0x0000'0066U; enum class parse_state { @@ -852,17 +852,17 @@ private: NUMERIC_CONSTANT }; - virtual void process_characters(unicode_char const *begin, unicode_char const *end) override; + virtual void process_characters(char32_t const *begin, char32_t const *end) override; virtual void input_complete() override; - void process_default(unicode_char ch); - void process_comment(unicode_char ch); - void process_line_comment(unicode_char ch); - void process_token(unicode_char ch); - void process_text(unicode_char ch); - void process_numeric(unicode_char ch); + void process_default(char32_t ch); + void process_comment(char32_t ch); + void process_line_comment(char32_t ch); + void process_token(char32_t ch); + void process_text(char32_t ch); + void process_numeric(char32_t ch); - bool tail_is(unicode_char ch) const + bool tail_is(char32_t ch) const { return !m_tail.empty() && (m_tail.front() == ch); } @@ -873,7 +873,7 @@ private: m_tail.pop_front(); } - void replace_tail(unicode_char ch) + void replace_tail(char32_t ch) { assert(!m_tail.empty()); *m_tail.begin() = ch; @@ -881,12 +881,12 @@ private: void flush_tail() { - for (unicode_char tail : m_tail) + for (char32_t tail : m_tail) cleaner_base::output_character(tail); m_tail.clear(); } - static constexpr bool is_token_lead(unicode_char ch) + static constexpr bool is_token_lead(char32_t ch) { return ((UPPERCASE_FIRST <= ch) && (UPPERCASE_LAST >= ch)) || @@ -894,34 +894,34 @@ private: (UNDERSCORE == ch); } - static constexpr bool is_token_continuation(unicode_char ch) + static constexpr bool is_token_continuation(char32_t ch) { return is_token_lead(ch) || ((DIGIT_FIRST <= ch) && (DIGIT_DECIMAL_LAST >= ch)); } - static constexpr bool is_numeric_lead(unicode_char ch) + static constexpr bool is_numeric_lead(char32_t ch) { return (DIGIT_FIRST <= ch) && (DIGIT_DECIMAL_LAST >= ch); } - static constexpr bool is_binary_digit(unicode_char ch) + static constexpr bool is_binary_digit(char32_t ch) { return (DIGIT_FIRST <= ch) && (DIGIT_BINARY_LAST >= ch); } - static constexpr bool is_octal_digit(unicode_char ch) + static constexpr bool is_octal_digit(char32_t ch) { return (DIGIT_FIRST <= ch) && (DIGIT_OCTAL_LAST >= ch); } - static constexpr bool is_decimal_digit(unicode_char ch) + static constexpr bool is_decimal_digit(char32_t ch) { return (DIGIT_FIRST <= ch) && (DIGIT_DECIMAL_LAST >= ch); } - static constexpr bool is_hexadecimal_digit(unicode_char ch) + static constexpr bool is_hexadecimal_digit(char32_t ch) { return ((DIGIT_FIRST <= ch) && (DIGIT_DECIMAL_LAST >= ch)) || @@ -932,9 +932,9 @@ private: parse_state m_parse_state; std::uint64_t m_input_line; bool m_escape; - std::deque<unicode_char> m_tail; + std::deque<char32_t> m_tail; std::uint64_t m_comment_line; - unicode_char m_lead_digit; + char32_t m_lead_digit; unsigned m_radix; std::uint64_t m_tabs_escaped = 0U; @@ -990,7 +990,7 @@ void cpp_cleaner::summarise(std::ostream &os) const } -void cpp_cleaner::output_character(unicode_char ch) +void cpp_cleaner::output_character(char32_t ch) { switch (m_parse_state) { @@ -1032,11 +1032,11 @@ void cpp_cleaner::output_character(unicode_char ch) } -void cpp_cleaner::process_characters(unicode_char const *begin, unicode_char const *end) +void cpp_cleaner::process_characters(char32_t const *begin, char32_t const *end) { while (begin != end) { - unicode_char const ch(*begin++); + char32_t const ch(*begin++); switch (m_parse_state) { case parse_state::DEFAULT: @@ -1083,7 +1083,7 @@ void cpp_cleaner::input_complete() } -void cpp_cleaner::process_default(unicode_char ch) +void cpp_cleaner::process_default(char32_t ch) { switch (ch) { @@ -1123,7 +1123,7 @@ void cpp_cleaner::process_default(unicode_char ch) } -void cpp_cleaner::process_comment(unicode_char ch) +void cpp_cleaner::process_comment(char32_t ch) { switch (ch) { @@ -1144,7 +1144,7 @@ void cpp_cleaner::process_comment(unicode_char ch) } -void cpp_cleaner::process_line_comment(unicode_char ch) +void cpp_cleaner::process_line_comment(char32_t ch) { switch (ch) { @@ -1165,7 +1165,7 @@ void cpp_cleaner::process_line_comment(unicode_char ch) } -void cpp_cleaner::process_token(unicode_char ch) +void cpp_cleaner::process_token(char32_t ch) { if (is_token_continuation(ch)) { @@ -1179,7 +1179,7 @@ void cpp_cleaner::process_token(unicode_char ch) } -void cpp_cleaner::process_text(unicode_char ch) +void cpp_cleaner::process_text(char32_t ch) { switch (ch) { @@ -1187,7 +1187,7 @@ void cpp_cleaner::process_text(unicode_char ch) ++m_tabs_escaped; if (!m_escape) output_character(BACKSLASH); - output_character(unicode_char(std::uint8_t('t'))); + output_character(char32_t(std::uint8_t('t'))); break; case LINE_FEED: if (parse_state::CHARACTER_CONSTANT == m_parse_state) @@ -1210,7 +1210,7 @@ void cpp_cleaner::process_text(unicode_char ch) ++m_tabs_escaped; if (!m_escape) output_character(BACKSLASH); - output_character(unicode_char(std::uint8_t('v'))); + output_character(char32_t(std::uint8_t('v'))); break; default: output_character(ch); @@ -1221,7 +1221,7 @@ void cpp_cleaner::process_text(unicode_char ch) } -void cpp_cleaner::process_numeric(unicode_char ch) +void cpp_cleaner::process_numeric(char32_t ch) { if (!m_lead_digit) { @@ -1337,12 +1337,12 @@ public: virtual void summarise(std::ostream &os) const override; protected: - void output_character(unicode_char ch); + void output_character(char32_t ch); private: - static constexpr unicode_char EQUALS = 0x0000'003dU; - static constexpr unicode_char LEFT_BRACKET = 0x0000'005bU; - static constexpr unicode_char RIGHT_BRACKET = 0x0000'005dU; + static constexpr char32_t EQUALS = 0x0000'003dU; + static constexpr char32_t LEFT_BRACKET = 0x0000'005bU; + static constexpr char32_t RIGHT_BRACKET = 0x0000'005dU; enum class parse_state { @@ -1353,14 +1353,14 @@ private: LONG_STRING_CONSTANT }; - virtual void process_characters(unicode_char const *begin, unicode_char const *end) override; + virtual void process_characters(char32_t const *begin, char32_t const *end) override; virtual void input_complete() override; - void process_default(unicode_char ch); - void process_short_comment(unicode_char ch); - void process_long_comment(unicode_char ch); - void process_string_constant(unicode_char ch); - void process_long_string_constant(unicode_char ch); + void process_default(char32_t ch); + void process_short_comment(char32_t ch); + void process_long_comment(char32_t ch); + void process_string_constant(char32_t ch); + void process_long_string_constant(char32_t ch); parse_state m_parse_state; std::uint64_t m_input_line; @@ -1369,7 +1369,7 @@ private: std::uint32_t m_block_line; int m_block_level; bool m_comment_start; - unicode_char m_string_quote; + char32_t m_string_quote; std::uint64_t m_tabs_escaped = 0U; std::uint64_t m_newlines_escaped = 0U; @@ -1417,7 +1417,7 @@ void lua_cleaner::summarise(std::ostream &os) const } -void lua_cleaner::output_character(unicode_char ch) +void lua_cleaner::output_character(char32_t ch) { switch (m_parse_state) { @@ -1445,11 +1445,11 @@ void lua_cleaner::output_character(unicode_char ch) } -void lua_cleaner::process_characters(unicode_char const *begin, unicode_char const *end) +void lua_cleaner::process_characters(char32_t const *begin, char32_t const *end) { while (begin != end) { - unicode_char const ch(*begin++); + char32_t const ch(*begin++); switch (m_parse_state) { case parse_state::DEFAULT: @@ -1491,7 +1491,7 @@ void lua_cleaner::input_complete() } -void lua_cleaner::process_default(unicode_char ch) +void lua_cleaner::process_default(char32_t ch) { switch (ch) { @@ -1534,7 +1534,7 @@ void lua_cleaner::process_default(unicode_char ch) } -void lua_cleaner::process_short_comment(unicode_char ch) +void lua_cleaner::process_short_comment(char32_t ch) { if (0 <= m_long_bracket_level) { @@ -1565,7 +1565,7 @@ void lua_cleaner::process_short_comment(unicode_char ch) } -void lua_cleaner::process_long_comment(unicode_char ch) +void lua_cleaner::process_long_comment(char32_t ch) { if (0 <= m_long_bracket_level) { @@ -1597,7 +1597,7 @@ void lua_cleaner::process_long_comment(unicode_char ch) } -void lua_cleaner::process_string_constant(unicode_char ch) +void lua_cleaner::process_string_constant(char32_t ch) { switch (ch) { @@ -1605,13 +1605,13 @@ void lua_cleaner::process_string_constant(unicode_char ch) ++m_tabs_escaped; if (!m_escape) output_character(BACKSLASH); - output_character(unicode_char(std::uint8_t('t'))); + output_character(char32_t(std::uint8_t('t'))); break; case LINE_FEED: if (m_escape) { ++m_newlines_escaped; - output_character(unicode_char(std::uint8_t('n'))); + output_character(char32_t(std::uint8_t('n'))); } else { @@ -1622,7 +1622,7 @@ void lua_cleaner::process_string_constant(unicode_char ch) ++m_tabs_escaped; if (!m_escape) output_character(BACKSLASH); - output_character(unicode_char(std::uint8_t('v'))); + output_character(char32_t(std::uint8_t('v'))); break; default: output_character(ch); @@ -1633,7 +1633,7 @@ void lua_cleaner::process_string_constant(unicode_char ch) } -void lua_cleaner::process_long_string_constant(unicode_char ch) +void lua_cleaner::process_long_string_constant(char32_t ch) { // this works because they're both closed by a matching long bracket process_long_comment(ch); @@ -1652,9 +1652,9 @@ public: xml_cleaner(OutputIt &&output, newline newline_mode, unsigned tab_width); private: - static constexpr unicode_char EXCLAMATION = 0x0000'0021U; - static constexpr unicode_char LEFT_ANGLE_BRACKET = 0x0000'003cU; - static constexpr unicode_char RIGHT_ANGLE_BRACKET = 0x0000'003eU; + static constexpr char32_t EXCLAMATION = 0x0000'0021U; + static constexpr char32_t LEFT_ANGLE_BRACKET = 0x0000'003cU; + static constexpr char32_t RIGHT_ANGLE_BRACKET = 0x0000'003eU; enum class parse_state { @@ -1662,11 +1662,11 @@ private: COMMENT }; - virtual void process_characters(unicode_char const *begin, unicode_char const *end) override; + virtual void process_characters(char32_t const *begin, char32_t const *end) override; virtual void input_complete() override; - void process_default(unicode_char ch); - void process_comment(unicode_char ch); + void process_default(char32_t ch); + void process_comment(char32_t ch); parse_state m_parse_state; std::uint64_t m_input_line; @@ -1689,11 +1689,11 @@ xml_cleaner::xml_cleaner( } -void xml_cleaner::process_characters(unicode_char const *begin, unicode_char const *end) +void xml_cleaner::process_characters(char32_t const *begin, char32_t const *end) { while (begin != end) { - unicode_char const ch(*begin++); + char32_t const ch(*begin++); switch (m_parse_state) { case parse_state::DEFAULT: @@ -1717,7 +1717,7 @@ void xml_cleaner::input_complete() } -void xml_cleaner::process_default(unicode_char ch) +void xml_cleaner::process_default(char32_t ch) { assert(4U > m_escape); @@ -1746,7 +1746,7 @@ void xml_cleaner::process_default(unicode_char ch) } -void xml_cleaner::process_comment(unicode_char ch) +void xml_cleaner::process_comment(char32_t ch) { assert(3U > m_escape); |