From a873a190e10227c47c675b8c89e6619659784db9 Mon Sep 17 00:00:00 2001 From: Jim Derry Date: Wed, 25 Aug 2021 16:03:52 -0400 Subject: [PATCH] Logging for ParseScript(). Improved debug output. --- src/lexer.h | 2 ++ src/parser.c | 9 +++++++++ src/tidylib.c | 56 ++++++++++++++++++++++++++++++++++++++------------- 3 files changed, 53 insertions(+), 14 deletions(-) diff --git a/src/lexer.h b/src/lexer.h index 49fa7fc..83b92ef 100644 --- a/src/lexer.h +++ b/src/lexer.h @@ -322,6 +322,8 @@ struct _Node uint line; /**< current line of document */ uint column; /**< current column of document */ + + int idx; /**< general purpose register */ Bool closed; /**< true if closed by explicit end tag */ Bool implicit; /**< true if inferred */ diff --git a/src/parser.c b/src/parser.c index f50417d..8a36c7c 100644 --- a/src/parser.c +++ b/src/parser.c @@ -5154,6 +5154,12 @@ Node* TY_(ParseRowGroup)( TidyDocImpl* doc, Node *rowgroup, GetTokenMode ARG_UNU Node* TY_(ParseScript)( TidyDocImpl* doc, Node *script, GetTokenMode ARG_UNUSED(mode) ) { Node *node = NULL; +#if defined(ENABLE_DEBUG_LOG) + static int depth_parser = 0; + static int count_parser = 0; +#endif + + DEBUG_LOG_ENTER_WITH_NODE(script); doc->lexer->parent = script; node = TY_(GetToken)(doc, CdataContent); @@ -5167,10 +5173,12 @@ Node* TY_(ParseScript)( TidyDocImpl* doc, Node *script, GetTokenMode ARG_UNUSED( { /* handle e.g. a document like "