From d9c3bd0b1b54b7bb38e80cafee837062a27a0923 Mon Sep 17 00:00:00 2001 From: Ivan Gagis Date: Sun, 17 Nov 2024 22:05:55 +0200 Subject: [PATCH] update --- src/mikroxml/mikroxml.cpp | 9 +++++---- src/mikroxml/mikroxml.hpp | 16 +++++++++++----- tests/unit/samples.cpp | 2 +- tool-configs | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/mikroxml/mikroxml.cpp b/src/mikroxml/mikroxml.cpp index 86859f4..144f480 100644 --- a/src/mikroxml/mikroxml.cpp +++ b/src/mikroxml/mikroxml.cpp @@ -507,7 +507,6 @@ void parser::process_parsed_tag_name() this->cur_state = state::declaration; return; case '!': - // TRACE(<< "this->buf = " << std::string(&*this->buf.begin(), this->buf.size()) << std::endl) if (starts_with(this->buf, doctype_tag_word)) { this->cur_state = state::doctype; } else { @@ -574,8 +573,9 @@ void parser::parse_tag(utki::span::iterator& i, utki::spanbuf.empty()) { this->process_parsed_tag_name(); - // After parsing usual tag we expect attributes, but since we got '/' the tag has no any attributes, - // so it is empty. In other cases, like '!DOCTYPE' tag the cur_state should remain. + // After parsing usual tag we expect attributes, but since we got '/' + // the tag has no any attributes, so it is empty. In other cases, like + // '!DOCTYPE' tag the cur_state should remain. if (this->cur_state == state::attributes) { this->cur_state = state::tag_empty; } @@ -726,7 +726,8 @@ void parser::parse_doctype_entity_seek_to_value( default: throw malformed_xml( this->line_number, - "unexpected character encountered while seeking to DOCTYPE entity value, expected '\"'." + "unexpected character encountered while seeking to " + "DOCTYPE entity value, expected '\"'." ); } } diff --git a/src/mikroxml/mikroxml.hpp b/src/mikroxml/mikroxml.hpp index ebbaf31..f21d1bc 100644 --- a/src/mikroxml/mikroxml.hpp +++ b/src/mikroxml/mikroxml.hpp @@ -105,7 +105,11 @@ class parser void process_parsed_ref_char(); std::vector buf; - std::vector name; // general variable for storing name of something (attribute name, entity name, etc.) + + // general variable for storing name of something + // (attribute name, entity name, etc.) + std::vector name; + std::vector ref_char_buf; char attr_value_quote_char = 0; @@ -133,21 +137,23 @@ class parser /** * @brief Element end. - * @param name - name of the element which has ended. Name is empty if empty element has ended. + * @param name - name of the element which has ended. Name is empty if empty + * element has ended. */ virtual void on_element_end(utki::span name) = 0; /** * @brief Attributes section end notification. - * This callback is called when all attributes of the last element have been parsed. + * This callback is called when all attributes of the last element have been + * parsed. * @param is_empty_element - indicates weather the element is empty element or not. */ virtual void on_attributes_end(bool is_empty_element) = 0; /** * @brief Attribute parsed notification. - * This callback may be called after 'on_element_start' notification. It can be called several times, once for each - * parsed attribute. + * This callback may be called after 'on_element_start' notification. It can + * be called several times, once for each parsed attribute. * @param name - name of the parsed attribute. * @param value - value of the parsed attribute. */ diff --git a/tests/unit/samples.cpp b/tests/unit/samples.cpp index e1d3a6f..4187000 100644 --- a/tests/unit/samples.cpp +++ b/tests/unit/samples.cpp @@ -109,7 +109,7 @@ const tst::set set("samples", [](tst::suite& suite){ auto cmp_data = papki::fs_file(in_file_name + ".cmp").load(); - if(out_data != cmp_data){ + if(utki::deep_not_equals(out_data, utki::make_span(cmp_data))){ papki::fs_file failed_file(p + ".out"); { diff --git a/tool-configs b/tool-configs index 77ac560..5ae4631 160000 --- a/tool-configs +++ b/tool-configs @@ -1 +1 @@ -Subproject commit 77ac56047405a2184f9ceed6e91f67bcd01a297a +Subproject commit 5ae463168087816fd3db83a5450cc9dafc35553d