]> granicus.if.org Git - multimarkdown/commitdiff
UPDATED: Remove some old debugging statements that aren't necessary anymore
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 19 Jan 2019 15:46:39 +0000 (10:46 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 19 Jan 2019 15:46:39 +0000 (10:46 -0500)
Sources/libMultiMarkdown/mmd.c
Sources/libMultiMarkdown/parser.c
Sources/libMultiMarkdown/parser.y
Sources/libMultiMarkdown/token_pairs.c

index 7e816b952b68e5841c57d8b93e3f44eb0be8d1b4..7f802c5f1d6012fab6057c285a5de1083f6e0616 100644 (file)
@@ -1153,9 +1153,8 @@ void mmd_parse_token_chain(mmd_engine * e, token * chain) {
        token * walker = chain->child;                          // Walk the existing tree
        token * remainder;                                                      // Hold unparsed tail of chain
 
-#ifndef NDEBUG
-       ParseTrace(stderr, "parser >>");
-#endif
+       // Enable to monitor parsing steps
+       // ParseTrace(stderr, "parser >>");
 
        // Remove existing token tree
        e->root = NULL;
@@ -1171,19 +1170,12 @@ void mmd_parse_token_chain(mmd_engine * e, token * chain) {
                        remainder->prev = NULL;
                }
 
-#ifndef NDEBUG
-               fprintf(stderr, "\nNew line\n");
-#endif
-
                Parse(pParser, walker->type, walker, e);
 
                walker = remainder;
        }
 
        // Signal finish to parser
-#ifndef NDEBUG
-       fprintf(stderr, "\nFinish parse\n");
-#endif
        Parse(pParser, 0, NULL, e);
 
        // Disconnect of (now empty) root
@@ -2032,11 +2024,6 @@ void strip_line_tokens_from_block(mmd_engine * e, token * block) {
                return;
        }
 
-#ifndef NDEBUG
-       fprintf(stderr, "Strip line tokens from %d (%lu:%lu) (child %d)\n", block->type, block->start, block->len, block->child->type);
-       token_tree_describe(block, e->dstr->str);
-#endif
-
        token * l = block->child;
 
        // Custom actions
@@ -2265,10 +2252,6 @@ token * mmd_engine_parse_substring(mmd_engine * e, size_t byte_start, size_t byt
                stack_free(pair_stack);
 
                pair_emphasis_tokens(doc);
-
-#ifndef NDEBUG
-               token_tree_describe(doc, e->dstr->str);
-#endif
        }
 
        // Return original extensions
index db335c5211ba391341d5499e687232f9b1e07909..1ce6a9880615882ec23cdbe94296f1895ebf9b86 100644 (file)
@@ -1190,9 +1190,6 @@ static void yy_reduce(
                if (yymsp[-1].minor.yy0 == NULL) { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; yymsp[0].minor.yy0 = NULL;}
                yylhsminor.yy0 = yymsp[-1].minor.yy0;
                token_chain_append(yylhsminor.yy0, yymsp[0].minor.yy0);
-               #ifndef NDEBUG
-               fprintf(stderr, "Next block %d\n", yylhsminor.yy0->tail->type);
-               #endif
        }
   yymsp[-1].minor.yy0 = yylhsminor.yy0;
         break;
@@ -1200,9 +1197,6 @@ static void yy_reduce(
 {
                engine->root = yymsp[0].minor.yy0;      // In case the first block is metadata and we just want to know if it exists
                strip_line_tokens_from_block(engine, yymsp[0].minor.yy0);
-               #ifndef NDEBUG
-               fprintf(stderr, "First block %d\n", yymsp[0].minor.yy0->type);
-               #endif
                yylhsminor.yy0 = yymsp[0].minor.yy0;
        }
   yymsp[0].minor.yy0 = yylhsminor.yy0;
index 4bdf0e3f09fba815648df3a9b18c12d63a6e9196..8ff3bd265592fdc0bca7a213c49de18e4d2993de 100644 (file)
@@ -84,17 +84,11 @@ blocks(A)                   ::= blocks(B) block(C).
                if (B == NULL) { B = C; C = NULL;}
                A = B;
                token_chain_append(A, C);
-               #ifndef NDEBUG
-               fprintf(stderr, "Next block %d\n", A->tail->type);
-               #endif
        }
 blocks(A)                      ::= block(B).
        {
                engine->root = B;       // In case the first block is metadata and we just want to know if it exists
                strip_line_tokens_from_block(engine, B);
-               #ifndef NDEBUG
-               fprintf(stderr, "First block %d\n", B->type);
-               #endif
                A = B;
        }
 
index 5de98398939f56a790061b5fa3632686693f2ce3..f6316dac633aaa9b7e9d79282c770eba9f40194e 100644 (file)
@@ -213,9 +213,6 @@ close:
                                                opener_count[peek->type]--;
                                        }
 
-#ifndef NDEBUG
-                                       fprintf(stderr, "stack now sized %lu\n", s->size);
-#endif
                                        // Prune matched section
 
                                        if (e->should_prune[pair_type]) {
@@ -246,18 +243,11 @@ open:
                if (walker->can_open && e->can_open_pair[walker->type] && walker->unmatched) {
                        stack_push(s, walker);
                        opener_count[walker->type]++;
-#ifndef NDEBUG
-                       fprintf(stderr, "push token type %d to stack (%lu elements)\n", walker->type, s->size);
-#endif
                }
 
                walker = walker->next;
        }
 
-#ifndef NDEBUG
-       fprintf(stderr, "token stack has %lu elements (of %lu)\n", s->size, s->capacity);
-#endif
-
        // Remove unused tokens from stack and return to parent
        s->size = start_counter;
 }