mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:47:46 +00:00
Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
This commit is contained in:
parent
5c5665c1e7
commit
7d783d8b84
9 changed files with 108 additions and 103 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
//#define PARSER_DEBUG
|
||||
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/Utf32View.h>
|
||||
#include <LibTextCodec/Decoder.h>
|
||||
#include <LibWeb/DOM/Comment.h>
|
||||
|
@ -47,9 +48,9 @@
|
|||
|
||||
namespace Web::HTML {
|
||||
|
||||
#define PARSE_ERROR() \
|
||||
do { \
|
||||
dbg() << "Parse error! " << __PRETTY_FUNCTION__ << " @ " << __LINE__; \
|
||||
#define PARSE_ERROR() \
|
||||
do { \
|
||||
dbgln("Parse error! {} @ {}", __PRETTY_FUNCTION__, __LINE__); \
|
||||
} while (0)
|
||||
|
||||
static Vector<FlyString> s_quirks_public_ids = {
|
||||
|
@ -142,9 +143,8 @@ void HTMLDocumentParser::run(const URL& url)
|
|||
break;
|
||||
auto& token = optional_token.value();
|
||||
|
||||
#ifdef PARSER_DEBUG
|
||||
dbg() << "[" << insertion_mode_name() << "] " << token.to_string();
|
||||
#endif
|
||||
dbgln<debug_parser>("[{}] {}", insertion_mode_name(), token.to_string());
|
||||
|
||||
// FIXME: If the adjusted current node is a MathML text integration point and the token is a start tag whose tag name is neither "mglyph" nor "malignmark"
|
||||
// FIXME: If the adjusted current node is a MathML text integration point and the token is a character token
|
||||
// FIXME: If the adjusted current node is a MathML annotation-xml element and the token is a start tag whose tag name is "svg"
|
||||
|
@ -159,9 +159,7 @@ void HTMLDocumentParser::run(const URL& url)
|
|||
}
|
||||
|
||||
if (m_stop_parsing) {
|
||||
#ifdef PARSER_DEBUG
|
||||
dbg() << "Stop parsing" << (m_parsing_fragment ? " fragment" : "") << "! :^)";
|
||||
#endif
|
||||
dbgln<debug_parser>("Stop parsing{}! :^)", m_parsing_fragment ? " fragment" : "");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1407,7 +1405,7 @@ void HTMLDocumentParser::handle_in_body(HTMLToken& token)
|
|||
generate_implied_end_tags(HTML::TagNames::li);
|
||||
if (current_node().local_name() != HTML::TagNames::li) {
|
||||
PARSE_ERROR();
|
||||
dbg() << "Expected <li> current node, but had <" << current_node().local_name() << ">";
|
||||
dbgln("Expected <li> current node, but had <{}>", current_node().local_name());
|
||||
}
|
||||
m_stack_of_open_elements.pop_until_an_element_with_tag_name_has_been_popped(HTML::TagNames::li);
|
||||
return;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <AK/Debug.h>
|
||||
#include <LibTextCodec/Decoder.h>
|
||||
#include <LibWeb/HTML/Parser/Entities.h>
|
||||
#include <LibWeb/HTML/Parser/HTMLToken.h>
|
||||
|
@ -35,12 +36,10 @@ namespace Web::HTML {
|
|||
|
||||
#pragma GCC diagnostic ignored "-Wunused-label"
|
||||
|
||||
//#define TOKENIZER_TRACE
|
||||
|
||||
#ifdef TOKENIZER_TRACE
|
||||
# define PARSE_ERROR() \
|
||||
do { \
|
||||
dbg() << "Parse error (tokenization)" << __PRETTY_FUNCTION__ << " @ " << __LINE__; \
|
||||
# define PARSE_ERROR() \
|
||||
do { \
|
||||
dbgln("Parse error (tokenization) {} @ {}", __PRETTY_FUNCTION__, __LINE__) \
|
||||
} while (0)
|
||||
#else
|
||||
# define PARSE_ERROR()
|
||||
|
@ -222,9 +221,7 @@ Optional<u32> HTMLTokenizer::next_code_point()
|
|||
return {};
|
||||
m_prev_utf8_iterator = m_utf8_iterator;
|
||||
++m_utf8_iterator;
|
||||
#ifdef TOKENIZER_TRACE
|
||||
dbg() << "(Tokenizer) Next code_point: " << (char)*m_prev_utf8_iterator;
|
||||
#endif
|
||||
dbgln<debug_trace_tokenizer>("(Tokenizer) Next code_point: {}", (char)*m_prev_utf8_iterator);
|
||||
return *m_prev_utf8_iterator;
|
||||
}
|
||||
|
||||
|
@ -2621,23 +2618,17 @@ HTMLTokenizer::HTMLTokenizer(const StringView& input, const String& encoding)
|
|||
|
||||
void HTMLTokenizer::will_switch_to([[maybe_unused]] State new_state)
|
||||
{
|
||||
#ifdef TOKENIZER_TRACE
|
||||
dbg() << "[" << state_name(m_state) << "] Switch to " << state_name(new_state);
|
||||
#endif
|
||||
dbgln<debug_trace_tokenizer>("[{}] Switch to {}", state_name(m_state), state_name(new_state));
|
||||
}
|
||||
|
||||
void HTMLTokenizer::will_reconsume_in([[maybe_unused]] State new_state)
|
||||
{
|
||||
#ifdef TOKENIZER_TRACE
|
||||
dbg() << "[" << state_name(m_state) << "] Reconsume in " << state_name(new_state);
|
||||
#endif
|
||||
dbgln<debug_trace_tokenizer>("[{}] Reconsume in {}", state_name(m_state), state_name(new_state));
|
||||
}
|
||||
|
||||
void HTMLTokenizer::switch_to(Badge<HTMLDocumentParser>, State new_state)
|
||||
{
|
||||
#ifdef TOKENIZER_TRACE
|
||||
dbg() << "[" << state_name(m_state) << "] Parser switches tokenizer state to " << state_name(new_state);
|
||||
#endif
|
||||
dbgln<debug_trace_tokenizer>("[{}] Parser switches tokenizer state to {}", state_name(m_state), state_name(new_state));
|
||||
m_state = new_state;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue