Added debug to several files. WIP

This commit is contained in:
Jim Derry 2017-10-03 21:09:59 -04:00
parent a137c068e5
commit ee54057d76

View file

@ -454,7 +454,7 @@ static void TrimInitialSpace( TidyDocImpl* doc, Node *element, Node *text )
node->end = element->start; node->end = element->start;
lexer->lexbuf[node->start] = ' '; lexer->lexbuf[node->start] = ' ';
TY_(InsertNodeBeforeElement)(element ,node); TY_(InsertNodeBeforeElement)(element ,node);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
SPRTF("TrimInitialSpace: Created text node, inserted before <%s>\n", SPRTF("TrimInitialSpace: Created text node, inserted before <%s>\n",
(element->element ? element->element : "unknown")); (element->element ? element->element : "unknown"));
#endif #endif
@ -794,7 +794,7 @@ static void AddClassNoIndent( TidyDocImpl* doc, Node *node )
*/ */
void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode) void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
{ {
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
static int in_parse_block = 0; static int in_parse_block = 0;
static int parse_block_cnt = 0; static int parse_block_cnt = 0;
#endif #endif
@ -802,7 +802,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
Node *node; Node *node;
Bool checkstack = yes; Bool checkstack = yes;
uint istackbase = 0; uint istackbase = 0;
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block++; in_parse_block++;
parse_block_cnt++; parse_block_cnt++;
SPRTF("Entering ParseBlock %d... %d %s\n",in_parse_block,parse_block_cnt, SPRTF("Entering ParseBlock %d... %d %s\n",in_parse_block,parse_block_cnt,
@ -810,7 +810,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
#endif #endif
if ( element->tag->model & CM_EMPTY ) { if ( element->tag->model & CM_EMPTY ) {
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block--; in_parse_block--;
SPRTF("Exit ParseBlockL 1 %d...\n",in_parse_block); SPRTF("Exit ParseBlockL 1 %d...\n",in_parse_block);
#endif #endif
@ -875,7 +875,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
element->closed = yes; element->closed = yes;
TrimSpaces( doc, element ); TrimSpaces( doc, element );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block--; in_parse_block--;
SPRTF("Exit ParseBlock 2 %d...\n",in_parse_block); SPRTF("Exit ParseBlock 2 %d...\n",in_parse_block);
#endif #endif
@ -929,7 +929,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
{ {
TY_(UngetToken)( doc ); TY_(UngetToken)( doc );
TrimSpaces( doc, element ); TrimSpaces( doc, element );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block--; in_parse_block--;
SPRTF("Exit ParseBlock 2 %d...\n",in_parse_block); SPRTF("Exit ParseBlock 2 %d...\n",in_parse_block);
#endif #endif
@ -1093,7 +1093,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
{ {
TY_(UngetToken)( doc ); TY_(UngetToken)( doc );
TrimSpaces( doc, element ); TrimSpaces( doc, element );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block--; in_parse_block--;
SPRTF("Exit ParseBlock 3 %d...\n",in_parse_block); SPRTF("Exit ParseBlock 3 %d...\n",in_parse_block);
#endif #endif
@ -1113,7 +1113,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
lexer->istackbase = istackbase; lexer->istackbase = istackbase;
TrimSpaces( doc, element ); TrimSpaces( doc, element );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block--; in_parse_block--;
SPRTF("Exit ParseBlock 4 %d...\n",in_parse_block); SPRTF("Exit ParseBlock 4 %d...\n",in_parse_block);
#endif #endif
@ -1172,7 +1172,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
element->parent->tag->parser == TY_(ParseList) ) element->parent->tag->parser == TY_(ParseList) )
{ {
TrimSpaces( doc, element ); TrimSpaces( doc, element );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block--; in_parse_block--;
SPRTF("Exit ParseBlock 5 %d...\n",in_parse_block); SPRTF("Exit ParseBlock 5 %d...\n",in_parse_block);
#endif #endif
@ -1187,7 +1187,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
if ( nodeIsDL(element->parent) ) if ( nodeIsDL(element->parent) )
{ {
TrimSpaces( doc, element ); TrimSpaces( doc, element );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block--; in_parse_block--;
SPRTF("Exit ParseBlock 6 %d...\n",in_parse_block); SPRTF("Exit ParseBlock 6 %d...\n",in_parse_block);
#endif #endif
@ -1202,7 +1202,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
/* In exiled mode, return so table processing can /* In exiled mode, return so table processing can
continue. */ continue. */
if (lexer->exiled) { if (lexer->exiled) {
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block--; in_parse_block--;
SPRTF("Exit ParseBlock 7 %d...\n",in_parse_block); SPRTF("Exit ParseBlock 7 %d...\n",in_parse_block);
#endif #endif
@ -1217,7 +1217,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
TY_(PopInline)( doc, NULL ); TY_(PopInline)( doc, NULL );
lexer->istackbase = istackbase; lexer->istackbase = istackbase;
TrimSpaces( doc, element ); TrimSpaces( doc, element );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block--; in_parse_block--;
SPRTF("Exit ParseBlock 8 %d...\n",in_parse_block); SPRTF("Exit ParseBlock 8 %d...\n",in_parse_block);
#endif #endif
@ -1227,7 +1227,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
else else
{ {
TrimSpaces( doc, element ); TrimSpaces( doc, element );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block--; in_parse_block--;
SPRTF("Exit ParseBlock 9 %d...\n",in_parse_block); SPRTF("Exit ParseBlock 9 %d...\n",in_parse_block);
#endif #endif
@ -1271,7 +1271,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
if (!(mode & Preformatted)) if (!(mode & Preformatted))
TrimSpaces(doc, element); TrimSpaces(doc, element);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block--; in_parse_block--;
SPRTF("Exit ParseBlock 9b %d...\n",in_parse_block); SPRTF("Exit ParseBlock 9b %d...\n",in_parse_block);
#endif #endif
@ -1339,7 +1339,7 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
} }
TrimSpaces( doc, element ); TrimSpaces( doc, element );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_block--; in_parse_block--;
SPRTF("Exit ParseBlock 10 %d...\n",in_parse_block); SPRTF("Exit ParseBlock 10 %d...\n",in_parse_block);
#endif #endif
@ -1539,18 +1539,18 @@ void TY_(ParseNamespace)(TidyDocImpl* doc, Node *basenode, GetTokenMode mode)
void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode ) void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode )
{ {
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
static int in_parse_inline = 0; static int in_parse_inline = 0;
#endif #endif
Lexer* lexer = doc->lexer; Lexer* lexer = doc->lexer;
Node *node, *parent; Node *node, *parent;
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline++; in_parse_inline++;
SPRTF("Entering ParseInline %d...\n",in_parse_inline); SPRTF("Entering ParseInline %d...\n",in_parse_inline);
#endif #endif
if (element->tag->model & CM_EMPTY) { if (element->tag->model & CM_EMPTY) {
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline--; in_parse_inline--;
SPRTF("Exit ParseInline 1 %d...\n",in_parse_inline); SPRTF("Exit ParseInline 1 %d...\n",in_parse_inline);
#endif #endif
@ -1632,7 +1632,7 @@ void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode )
element->closed = yes; element->closed = yes;
TrimSpaces( doc, element ); TrimSpaces( doc, element );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline--; in_parse_inline--;
SPRTF("Exit ParseInline 2 %d...\n",in_parse_inline); SPRTF("Exit ParseInline 2 %d...\n",in_parse_inline);
#endif #endif
@ -1723,7 +1723,7 @@ void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode )
if (!(mode & Preformatted)) if (!(mode & Preformatted))
TrimSpaces(doc, element); TrimSpaces(doc, element);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline--; in_parse_inline--;
SPRTF("Exit ParseInline 3 %d...\n",in_parse_inline); SPRTF("Exit ParseInline 3 %d...\n",in_parse_inline);
#endif #endif
@ -1813,7 +1813,7 @@ void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode )
TY_(InlineDup1)( doc, NULL, element ); /* dupe the <i>, after </b> */ TY_(InlineDup1)( doc, NULL, element ); /* dupe the <i>, after </b> */
if (!(mode & Preformatted)) if (!(mode & Preformatted))
TrimSpaces( doc, element ); TrimSpaces( doc, element );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline--; in_parse_inline--;
SPRTF("Exit ParseInline 4 %d...\n",in_parse_inline); SPRTF("Exit ParseInline 4 %d...\n",in_parse_inline);
#endif #endif
@ -1837,7 +1837,7 @@ void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode )
if (!(mode & Preformatted)) if (!(mode & Preformatted))
TrimSpaces(doc, element); TrimSpaces(doc, element);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline--; in_parse_inline--;
SPRTF("Exit ParseInline 5 %d...\n",in_parse_inline); SPRTF("Exit ParseInline 5 %d...\n",in_parse_inline);
#endif #endif
@ -1854,7 +1854,7 @@ void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode )
{ {
TY_(UngetToken)( doc ); TY_(UngetToken)( doc );
TrimSpaces(doc, element); TrimSpaces(doc, element);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline--; in_parse_inline--;
SPRTF("Exit ParseInline 6 %d...\n",in_parse_inline); SPRTF("Exit ParseInline 6 %d...\n",in_parse_inline);
#endif #endif
@ -1880,7 +1880,7 @@ void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode )
if (!(mode & Preformatted)) if (!(mode & Preformatted))
TrimSpaces(doc, element); TrimSpaces(doc, element);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline--; in_parse_inline--;
SPRTF("Exit ParseInline 7 %d...\n",in_parse_inline); SPRTF("Exit ParseInline 7 %d...\n",in_parse_inline);
#endif #endif
@ -1917,7 +1917,7 @@ void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode )
if (!(mode & Preformatted)) if (!(mode & Preformatted))
TrimSpaces(doc, element); TrimSpaces(doc, element);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline--; in_parse_inline--;
SPRTF("Exit ParseInline 8 %d...\n",in_parse_inline); SPRTF("Exit ParseInline 8 %d...\n",in_parse_inline);
#endif #endif
@ -2043,7 +2043,7 @@ void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode )
if (!(mode & Preformatted)) if (!(mode & Preformatted))
TrimSpaces(doc, element); TrimSpaces(doc, element);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline--; in_parse_inline--;
SPRTF("Exit ParseInline 9 %d...\n",in_parse_inline); SPRTF("Exit ParseInline 9 %d...\n",in_parse_inline);
#endif #endif
@ -2095,7 +2095,7 @@ void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode )
{ {
TY_(DiscardElement)( doc, element ); TY_(DiscardElement)( doc, element );
TY_(UngetToken)( doc ); TY_(UngetToken)( doc );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline--; in_parse_inline--;
SPRTF("Exit ParseInline 10 %d...\n",in_parse_inline); SPRTF("Exit ParseInline 10 %d...\n",in_parse_inline);
#endif #endif
@ -2108,7 +2108,7 @@ void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode )
if (!(mode & Preformatted)) if (!(mode & Preformatted))
TrimSpaces(doc, element); TrimSpaces(doc, element);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline--; in_parse_inline--;
SPRTF("Exit ParseInline 11 %d...\n",in_parse_inline); SPRTF("Exit ParseInline 11 %d...\n",in_parse_inline);
#endif #endif
@ -2139,7 +2139,7 @@ void TY_(ParseInline)( TidyDocImpl* doc, Node *element, GetTokenMode mode )
if (!(element->tag->model & CM_OPT)) if (!(element->tag->model & CM_OPT))
TY_(Report)(doc, element, node, MISSING_ENDTAG_FOR); TY_(Report)(doc, element, node, MISSING_ENDTAG_FOR);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_inline--; in_parse_inline--;
SPRTF("Exit ParseInline 12 %d...\n",in_parse_inline); SPRTF("Exit ParseInline 12 %d...\n",in_parse_inline);
#endif #endif
@ -2327,7 +2327,7 @@ static Bool FindLastLI( Node *list, Node **lastli )
void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode)) void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode))
{ {
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
static int in_parse_list = 0; static int in_parse_list = 0;
#endif #endif
Lexer* lexer = doc->lexer; Lexer* lexer = doc->lexer;
@ -2335,13 +2335,13 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode))
Bool wasblock; Bool wasblock;
Bool nodeisOL = nodeIsOL(list); Bool nodeisOL = nodeIsOL(list);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_list++; in_parse_list++;
SPRTF("Entering ParseList %d...\n",in_parse_list); SPRTF("Entering ParseList %d...\n",in_parse_list);
#endif #endif
if (list->tag->model & CM_EMPTY) if (list->tag->model & CM_EMPTY)
{ {
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_list--; in_parse_list--;
SPRTF("Exit ParseList 1 %d... CM_EMPTY\n",in_parse_list); SPRTF("Exit ParseList 1 %d... CM_EMPTY\n",in_parse_list);
#endif #endif
@ -2356,7 +2356,7 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode))
{ {
TY_(FreeNode)( doc, node); TY_(FreeNode)( doc, node);
list->closed = yes; list->closed = yes;
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_list--; in_parse_list--;
SPRTF("Exit ParseList 2 %d... Endtag\n",in_parse_list); SPRTF("Exit ParseList 2 %d... Endtag\n",in_parse_list);
#endif #endif
@ -2423,7 +2423,7 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode))
{ {
TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE); TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE);
TY_(UngetToken)( doc ); TY_(UngetToken)( doc );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_list--; in_parse_list--;
SPRTF("Exit ParseList 3 %d... No End Tag\n",in_parse_list); SPRTF("Exit ParseList 3 %d... No End Tag\n",in_parse_list);
#endif #endif
@ -2456,7 +2456,7 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode))
if (TY_(nodeHasCM)(node,CM_BLOCK) && lexer->excludeBlocks) if (TY_(nodeHasCM)(node,CM_BLOCK) && lexer->excludeBlocks)
{ {
TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE); TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_list--; in_parse_list--;
SPRTF("Exit ParseList 4 %d... No End Tag\n",in_parse_list); SPRTF("Exit ParseList 4 %d... No End Tag\n",in_parse_list);
#endif #endif
@ -2468,7 +2468,7 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode))
&& (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW) && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
|| nodeIsTABLE(node)) ) || nodeIsTABLE(node)) )
{ {
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_list--; in_parse_list--;
SPRTF("Exit ParseList 5 %d... exiled\n",in_parse_list); SPRTF("Exit ParseList 5 %d... exiled\n",in_parse_list);
#endif #endif
@ -2507,7 +2507,7 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode))
} }
TY_(Report)(doc, list, node, MISSING_ENDTAG_FOR); TY_(Report)(doc, list, node, MISSING_ENDTAG_FOR);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_list--; in_parse_list--;
SPRTF("Exit ParseList 6 %d... missing end tag\n",in_parse_list); SPRTF("Exit ParseList 6 %d... missing end tag\n",in_parse_list);
#endif #endif
@ -2931,7 +2931,7 @@ void TY_(ParseColGroup)(TidyDocImpl* doc, Node *colgroup, GetTokenMode ARG_UNUSE
void TY_(ParseTableTag)(TidyDocImpl* doc, Node *table, GetTokenMode ARG_UNUSED(mode)) void TY_(ParseTableTag)(TidyDocImpl* doc, Node *table, GetTokenMode ARG_UNUSED(mode))
{ {
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
static int in_parse_table = 0; static int in_parse_table = 0;
#endif #endif
Lexer* lexer = doc->lexer; Lexer* lexer = doc->lexer;
@ -2941,7 +2941,7 @@ void TY_(ParseTableTag)(TidyDocImpl* doc, Node *table, GetTokenMode ARG_UNUSED(m
TY_(DeferDup)( doc ); TY_(DeferDup)( doc );
istackbase = lexer->istackbase; istackbase = lexer->istackbase;
lexer->istackbase = lexer->istacksize; lexer->istackbase = lexer->istacksize;
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_table++; in_parse_table++;
SPRTF("Entering ParseTableTag %d...\n",in_parse_table); SPRTF("Entering ParseTableTag %d...\n",in_parse_table);
#endif #endif
@ -2966,7 +2966,7 @@ void TY_(ParseTableTag)(TidyDocImpl* doc, Node *table, GetTokenMode ARG_UNUSED(m
} }
lexer->istackbase = istackbase; lexer->istackbase = istackbase;
table->closed = yes; table->closed = yes;
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_table--; in_parse_table--;
SPRTF("Exit ParseTableTag 1 %d... EndTag\n",in_parse_table); SPRTF("Exit ParseTableTag 1 %d... EndTag\n",in_parse_table);
#endif #endif
@ -3046,7 +3046,7 @@ void TY_(ParseTableTag)(TidyDocImpl* doc, Node *table, GetTokenMode ARG_UNUSED(m
TY_(Report)(doc, table, node, MISSING_ENDTAG_BEFORE ); TY_(Report)(doc, table, node, MISSING_ENDTAG_BEFORE );
TY_(UngetToken)( doc ); TY_(UngetToken)( doc );
lexer->istackbase = istackbase; lexer->istackbase = istackbase;
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_table--; in_parse_table--;
SPRTF("Exit ParseTableTag 2 %d... missing EndTag\n",in_parse_table); SPRTF("Exit ParseTableTag 2 %d... missing EndTag\n",in_parse_table);
#endif #endif
@ -3060,7 +3060,7 @@ void TY_(ParseTableTag)(TidyDocImpl* doc, Node *table, GetTokenMode ARG_UNUSED(m
TY_(UngetToken)( doc ); TY_(UngetToken)( doc );
TY_(Report)(doc, table, node, TAG_NOT_ALLOWED_IN); TY_(Report)(doc, table, node, TAG_NOT_ALLOWED_IN);
lexer->istackbase = istackbase; lexer->istackbase = istackbase;
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_table--; in_parse_table--;
SPRTF("Exit ParseTableTag 3 %d... CM_TABLE\n",in_parse_table); SPRTF("Exit ParseTableTag 3 %d... CM_TABLE\n",in_parse_table);
#endif #endif
@ -3081,7 +3081,7 @@ void TY_(ParseTableTag)(TidyDocImpl* doc, Node *table, GetTokenMode ARG_UNUSED(m
TY_(Report)(doc, table, node, MISSING_ENDTAG_FOR); TY_(Report)(doc, table, node, MISSING_ENDTAG_FOR);
lexer->istackbase = istackbase; lexer->istackbase = istackbase;
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_table--; in_parse_table--;
SPRTF("Exit ParseTableTag 4 %d... missing end\n",in_parse_table); SPRTF("Exit ParseTableTag 4 %d... missing end\n",in_parse_table);
#endif #endif
@ -3317,14 +3317,14 @@ void TY_(ParseOptGroup)(TidyDocImpl* doc, Node *field, GetTokenMode ARG_UNUSED(m
void TY_(ParseSelect)(TidyDocImpl* doc, Node *field, GetTokenMode ARG_UNUSED(mode)) void TY_(ParseSelect)(TidyDocImpl* doc, Node *field, GetTokenMode ARG_UNUSED(mode))
{ {
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
static int in_parse_select = 0; static int in_parse_select = 0;
#endif #endif
Lexer* lexer = doc->lexer; Lexer* lexer = doc->lexer;
Node *node; Node *node;
lexer->insert = NULL; /* defer implicit inline start tags */ lexer->insert = NULL; /* defer implicit inline start tags */
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_select++; in_parse_select++;
SPRTF("Entering ParseSelect %d...\n",in_parse_select); SPRTF("Entering ParseSelect %d...\n",in_parse_select);
#endif #endif
@ -3336,7 +3336,7 @@ void TY_(ParseSelect)(TidyDocImpl* doc, Node *field, GetTokenMode ARG_UNUSED(mod
TY_(FreeNode)( doc, node); TY_(FreeNode)( doc, node);
field->closed = yes; field->closed = yes;
TrimSpaces(doc, field); TrimSpaces(doc, field);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_select--; in_parse_select--;
SPRTF("Exit ParseSelect 1 %d...\n",in_parse_select); SPRTF("Exit ParseSelect 1 %d...\n",in_parse_select);
#endif #endif
@ -3365,7 +3365,7 @@ void TY_(ParseSelect)(TidyDocImpl* doc, Node *field, GetTokenMode ARG_UNUSED(mod
} }
TY_(Report)(doc, field, node, MISSING_ENDTAG_FOR); TY_(Report)(doc, field, node, MISSING_ENDTAG_FOR);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_select--; in_parse_select--;
SPRTF("Exit ParseSelect 2 %d...\n",in_parse_select); SPRTF("Exit ParseSelect 2 %d...\n",in_parse_select);
#endif #endif
@ -3374,14 +3374,14 @@ void TY_(ParseSelect)(TidyDocImpl* doc, Node *field, GetTokenMode ARG_UNUSED(mod
/* HTML5 */ /* HTML5 */
void TY_(ParseDatalist)(TidyDocImpl* doc, Node *field, GetTokenMode ARG_UNUSED(mode)) void TY_(ParseDatalist)(TidyDocImpl* doc, Node *field, GetTokenMode ARG_UNUSED(mode))
{ {
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
static int in_parse_datalist = 0; static int in_parse_datalist = 0;
#endif #endif
Lexer* lexer = doc->lexer; Lexer* lexer = doc->lexer;
Node *node; Node *node;
lexer->insert = NULL; /* defer implicit inline start tags */ lexer->insert = NULL; /* defer implicit inline start tags */
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_datalist++; in_parse_datalist++;
SPRTF("Entering ParseDatalist %d...\n",in_parse_datalist); SPRTF("Entering ParseDatalist %d...\n",in_parse_datalist);
#endif #endif
@ -3393,7 +3393,7 @@ void TY_(ParseDatalist)(TidyDocImpl* doc, Node *field, GetTokenMode ARG_UNUSED(m
TY_(FreeNode)( doc, node); TY_(FreeNode)( doc, node);
field->closed = yes; field->closed = yes;
TrimSpaces(doc, field); TrimSpaces(doc, field);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_datalist--; in_parse_datalist--;
SPRTF("Exit ParseDatalist 1 %d...\n",in_parse_datalist); SPRTF("Exit ParseDatalist 1 %d...\n",in_parse_datalist);
#endif #endif
@ -3422,7 +3422,7 @@ void TY_(ParseDatalist)(TidyDocImpl* doc, Node *field, GetTokenMode ARG_UNUSED(m
} }
TY_(Report)(doc, field, node, MISSING_ENDTAG_FOR); TY_(Report)(doc, field, node, MISSING_ENDTAG_FOR);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
in_parse_datalist--; in_parse_datalist--;
SPRTF("Exit ParseDatalist 2 %d...\n",in_parse_datalist); SPRTF("Exit ParseDatalist 2 %d...\n",in_parse_datalist);
#endif #endif
@ -3628,7 +3628,7 @@ void TY_(ParseHead)(TidyDocImpl* doc, Node *head, GetTokenMode ARG_UNUSED(mode))
int HasTitle = 0; int HasTitle = 0;
int HasBase = 0; int HasBase = 0;
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
SPRTF("Enter ParseHead...\n"); SPRTF("Enter ParseHead...\n");
#endif #endif
while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL) while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
@ -3734,7 +3734,7 @@ void TY_(ParseHead)(TidyDocImpl* doc, Node *head, GetTokenMode ARG_UNUSED(mode))
TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED); TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
TY_(FreeNode)( doc, node); TY_(FreeNode)( doc, node);
} }
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
SPRTF("Exit ParseHead 1...\n"); SPRTF("Exit ParseHead 1...\n");
#endif #endif
} }
@ -3790,7 +3790,7 @@ void TY_(ParseBody)(TidyDocImpl* doc, Node *body, GetTokenMode mode)
checkstack = yes; checkstack = yes;
TY_(BumpObject)( doc, body->parent ); TY_(BumpObject)( doc, body->parent );
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
SPRTF("Enter ParseBody...\n"); SPRTF("Enter ParseBody...\n");
#endif #endif
@ -4057,7 +4057,7 @@ void TY_(ParseBody)(TidyDocImpl* doc, Node *body, GetTokenMode mode)
TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED); TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
TY_(FreeNode)( doc, node); TY_(FreeNode)( doc, node);
} }
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
SPRTF("Exit ParseBody 1...\n"); SPRTF("Exit ParseBody 1...\n");
#endif #endif
} }
@ -4246,7 +4246,7 @@ void TY_(ParseHTML)(TidyDocImpl* doc, Node *html, GetTokenMode mode)
Node *frameset = NULL; Node *frameset = NULL;
Node *noframes = NULL; Node *noframes = NULL;
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
SPRTF("Entering ParseHTML...\n"); SPRTF("Entering ParseHTML...\n");
#endif #endif
TY_(SetOptionBool)( doc, TidyXmlTags, no ); TY_(SetOptionBool)( doc, TidyXmlTags, no );
@ -4304,7 +4304,7 @@ void TY_(ParseHTML)(TidyDocImpl* doc, Node *html, GetTokenMode mode)
TY_(InsertNodeAtEnd)(html, node); TY_(InsertNodeAtEnd)(html, node);
TY_(ParseBody)(doc, node, mode); TY_(ParseBody)(doc, node, mode);
} }
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
SPRTF("Exit ParseHTML 1...\n"); SPRTF("Exit ParseHTML 1...\n");
#endif #endif
return; return;
@ -4475,7 +4475,7 @@ void TY_(ParseHTML)(TidyDocImpl* doc, Node *html, GetTokenMode mode)
TY_(InsertNodeAtEnd)(html, node); TY_(InsertNodeAtEnd)(html, node);
ParseTag(doc, node, mode); ParseTag(doc, node, mode);
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG)
SPRTF("Exit ParseHTML 2...\n"); SPRTF("Exit ParseHTML 2...\n");
#endif #endif
} }