]> granicus.if.org Git - multimarkdown/commitdiff
UPDATED: Update astyle settings
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 7 Jan 2019 14:33:18 +0000 (09:33 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Mon, 7 Jan 2019 14:33:18 +0000 (09:33 -0500)
15 files changed:
.astylerc
Sources/libMultiMarkdown/aho-corasick.c
Sources/libMultiMarkdown/char_lookup.c
Sources/libMultiMarkdown/critic_markup.c
Sources/libMultiMarkdown/d_string.c
Sources/libMultiMarkdown/file.c
Sources/libMultiMarkdown/itmz-parser.c
Sources/libMultiMarkdown/itmz-reader.c
Sources/libMultiMarkdown/mmd.c
Sources/libMultiMarkdown/opml-parser.c
Sources/libMultiMarkdown/opml-reader.c
Sources/libMultiMarkdown/token.c
Sources/libMultiMarkdown/token_pairs.c
Sources/libMultiMarkdown/writer.c
Sources/multimarkdown/main.c

index 0ff809fce6c3b03c351ec473c36ed8b6ea199c6f..4db6063f789f0fd5b6ea140004869f9911263da7 100644 (file)
--- a/.astylerc
+++ b/.astylerc
@@ -21,7 +21,7 @@
 # Indent pre-processor directives
 --indent-preproc-block
 --indent-preproc-define
---indent-preproc-cond
+#--indent-preproc-cond
 
 
 # Line endings
index a9963806a09d1ab3396e238ad2556b4f4e07b2f8..90cd8bcb6feed37f752b0fcfb4f422f74cff2ee2 100644 (file)
@@ -478,9 +478,9 @@ void match_set_filter_leftmost_longest(match * header) {
                                        m->next->start > m->start &&
                                        m->next->start < m->start + m->len) {
                                // This match is "lefter" than next
-                               #ifndef __clang_analyzer__
+#ifndef __clang_analyzer__
                                match_excise(m->next);
-                               #endif
+#endif
                        }
 
                        while (m->next &&
@@ -497,9 +497,9 @@ void match_set_filter_leftmost_longest(match * header) {
                                m->prev->start >= m->start) {
                        // We are "lefter" than previous
                        n = m->prev;
-                       #ifndef __clang_analyzer__
+#ifndef __clang_analyzer__
                        match_excise(n);
-                       #endif
+#endif
                }
 
                m = m->next;
index fc5c10ea10e98821d9ccf3c6b496d7bc53eb5547..dc9604410e4ed04f365cba9a339f896b5600e89c 100644 (file)
@@ -139,7 +139,7 @@ int main( int argc, char** argv ) {
 
 
        // Extended ASCII
-       #ifdef USE_EXTENDED_ASCII
+#ifdef USE_EXTENDED_ASCII
 
        // Punctuation ranges
        for (int i = 132; i < 138; ++i) {
@@ -198,7 +198,7 @@ int main( int argc, char** argv ) {
                }
        }
 
-       #endif
+#endif
 
 
        // Print output as 16 x 16 table
index 0ad27c587be13dc4bcd8920783ab468f5f297287..3f14be1bf7a55015ac448eb985d56d9b52799833 100644 (file)
@@ -347,9 +347,9 @@ void mmd_critic_markup_reject(DString * d) {
 
 #ifdef TEST
 void Test_critic(CuTest* tc) {
-       #ifdef kUseObjectPool
+#ifdef kUseObjectPool
        token_pool_init();
-       #endif
+#endif
 
        DString * test = d_string_new("{--foo bar--}");
        mmd_critic_markup_reject(test);
@@ -416,11 +416,11 @@ void Test_critic(CuTest* tc) {
        mmd_critic_markup_reject(test);
        CuAssertStrEquals(tc, "", test->str);
 
-       #ifdef kUseObjectPool
+#ifdef kUseObjectPool
        // Decrement counter and clean up token pool
        token_pool_drain();
 
        token_pool_free();
-       #endif
+#endif
 }
 #endif
index 4779f0f13e621d688e35701f809b7b1ac92b62a5..efbcc95af963c6708f5fba074fa522978d267831 100644 (file)
@@ -89,13 +89,13 @@ int vasprintf(char** strp, const char* fmt, va_list ap) {
        va_list ap2;
        va_copy(ap2, ap);
 
-       #if (defined(_WIN32) || defined(__WIN32__))
+#if (defined(_WIN32) || defined(__WIN32__))
        char *tmp = NULL;
        int size = vsnprintf(tmp, 0, fmt, ap2);
-       #else
+#else
        char tmp[1];
        int size = vsnprintf(tmp, 1, fmt, ap2);
-       #endif
+#endif
 
        if (size <= 0) {
                return size;
index 406b1f048a9b4071150f0a62b9011927de406a39..59dc736df22101abaddc63fd428405a5aa19fafa 100644 (file)
@@ -126,16 +126,16 @@ DString * scan_file(const char * fname) {
 
        FILE * file;
 
-       #if defined(__WIN32)
+#if defined(__WIN32)
        int wchars_num = MultiByteToWideChar(CP_UTF8, 0, fname, -1, NULL, 0);
        wchar_t wstr[wchars_num];
        MultiByteToWideChar(CP_UTF8, 0, fname, -1, wstr, wchars_num);
 
        if ((file = _wfopen(wstr, L"rb")) == NULL) {
-       #else
+#else
 
        if ((file = fopen(fname, "r")) == NULL ) {
-       #endif
+#endif
 
                return NULL;
        }
@@ -182,11 +182,11 @@ DString * stdin_buffer(void) {
 /// Windows can use either `\` or `/` as a separator -- thanks to t-beckmann on github
 ///    for suggesting a fix for this.
 bool is_separator(char c) {
-       #if defined(__WIN32)
+#if defined(__WIN32)
        return c == '\\' || c == '/';
-       #else
+#else
        return c == '/';
-       #endif
+#endif
 }
 
 
@@ -194,26 +194,26 @@ bool is_separator(char c) {
 void Test_is_separator(CuTest* tc) {
        char * test = "a/\\";
 
-       #if defined(__WIN32)
+#if defined(__WIN32)
        CuAssertIntEquals(tc, false, is_separator(test[0]));
        CuAssertIntEquals(tc, true, is_separator(test[1]));
        CuAssertIntEquals(tc, true, is_separator(test[2]));
-       #else
+#else
        CuAssertIntEquals(tc, false, is_separator(test[0]));
        CuAssertIntEquals(tc, true, is_separator(test[1]));
        CuAssertIntEquals(tc, false, is_separator(test[2]));
-       #endif
+#endif
 }
 #endif
 
 
 /// Ensure that path ends in separator
 void add_trailing_sep(DString * path) {
-       #if defined(__WIN32)
+#if defined(__WIN32)
        char sep = '\\';
-       #else
+#else
        char sep = '/';
-       #endif
+#endif
 
        // Ensure that folder ends in separator
        if ((path->currentStringLength == 0) || (!is_separator(path->str[path->currentStringLength - 1]))) {
@@ -307,11 +307,11 @@ void Test_path_from_dir_base(CuTest* tc) {
 
        char * path = path_from_dir_base(dir, base);
 
-       #if defined(__WIN32)
+#if defined(__WIN32)
        CuAssertStrEquals(tc, "/foo\\bar", path);
-       #else
+#else
        CuAssertStrEquals(tc, "/foo/bar", path);
-       #endif
+#endif
 
        free(path);
        strcpy(base, "/bar");
@@ -334,11 +334,11 @@ void Test_path_from_dir_base(CuTest* tc) {
 void split_path_file(char ** dir, char ** file, const char * path) {
        const char * slash = path, * next;
 
-       #if defined(__WIN32)
+#if defined(__WIN32)
        const char sep[] = "\\/";       // Windows allows either variant
-       #else
+#else
        const char sep[] = "/";
-       #endif
+#endif
 
        while ((next = strpbrk(slash + 1, sep))) {
                slash = next;
@@ -371,13 +371,13 @@ void Test_split_path_file(CuTest* tc) {
        path = "\\foo\\bar.txt";
        split_path_file(&dir, &file, path);
 
-       #if defined(__WIN32)
+#if defined(__WIN32)
        CuAssertStrEquals(tc, "\\foo\\", dir);
        CuAssertStrEquals(tc, "bar.txt", file);
-       #else
+#else
        CuAssertStrEquals(tc, "", dir);
        CuAssertStrEquals(tc, "\\foo\\bar.txt", file);
-       #endif
+#endif
 }
 #endif
 
@@ -421,15 +421,15 @@ char *realpath(const char *path, char *resolved_path) {
 // Convert argument to absolute path
 char * absolute_path_for_argument(const char * arg) {
        char * result = NULL;
-       #ifdef PATH_MAX
+#ifdef PATH_MAX
        // If PATH_MAX defined, use it
        char absolute[PATH_MAX + 1];
        realpath(arg, absolute);
        result = my_strdup(absolute);
-       #else
+#else
        // If undefined, then we *should* be able to use a NULL pointer to allocate
        result = realpath(arg, NULL);
-       #endif
+#endif
 
        return result;
 }
index 7e1ec5f6d70d2f3c8370eff1bd2e04259f024aff..8533b4f45ffacecc1f36181d9774dd42101b9131 100644 (file)
@@ -275,20 +275,20 @@ typedef struct yyStackEntry yyStackEntry;
 ** the following structure */
 struct yyParser {
        yyStackEntry *yytos;          /* Pointer to top element of the stack */
-       #ifdef YYTRACKMAXSTACKDEPTH
+#ifdef YYTRACKMAXSTACKDEPTH
        int yyhwm;                    /* High-water mark of the stack */
-       #endif
-       #ifndef YYNOERRORRECOVERY
+#endif
+#ifndef YYNOERRORRECOVERY
        int yyerrcnt;                 /* Shifts left before out of the error */
-       #endif
+#endif
        ITMZARG_SDECL                /* A place to hold %extra_argument */
-       #if YYSTACKDEPTH<=0
+#if YYSTACKDEPTH<=0
        int yystksz;                  /* Current side of the stack */
        yyStackEntry *yystack;        /* The parser's stack */
        yyStackEntry yystk0;          /* First stack entry */
-       #else
+#else
        yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
-       #endif
+#endif
 };
 typedef struct yyParser yyParser;
 
@@ -390,14 +390,14 @@ static int yyGrowStack(yyParser *p) {
        if ( pNew ) {
                p->yystack = pNew;
                p->yytos = &p->yystack[idx];
-               #ifndef NDEBUG
+#ifndef NDEBUG
 
                if ( yyTraceFILE ) {
                        fprintf(yyTraceFILE, "%sStack grows from %d to %d entries.\n",
                                        yyTracePrompt, p->yystksz, newSize);
                }
 
-               #endif
+#endif
                p->yystksz = newSize;
        }
 
@@ -431,10 +431,10 @@ void *ITMZAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)) {
        pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
 
        if ( pParser ) {
-               #ifdef YYTRACKMAXSTACKDEPTH
+#ifdef YYTRACKMAXSTACKDEPTH
                pParser->yyhwm = 0;
-               #endif
-               #if YYSTACKDEPTH<=0
+#endif
+#if YYSTACKDEPTH<=0
                pParser->yytos = NULL;
                pParser->yystack = NULL;
                pParser->yystksz = 0;
@@ -444,10 +444,10 @@ void *ITMZAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)) {
                        pParser->yystksz = 1;
                }
 
-               #endif
-               #ifndef YYNOERRORRECOVERY
+#endif
+#ifndef YYNOERRORRECOVERY
                pParser->yyerrcnt = -1;
-               #endif
+#endif
                pParser->yytos = pParser->yystack;
                pParser->yystack[0].stateno = 0;
                pParser->yystack[0].major = 0;
@@ -499,7 +499,7 @@ static void yy_pop_parser_stack(yyParser *pParser) {
        assert( pParser->yytos != 0 );
        assert( pParser->yytos > pParser->yystack );
        yytos = pParser->yytos--;
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE ) {
                fprintf(yyTraceFILE, "%sPopping %s\n",
@@ -507,7 +507,7 @@ static void yy_pop_parser_stack(yyParser *pParser) {
                                yyTokenName[yytos->major]);
        }
 
-       #endif
+#endif
        yy_destructor(pParser, yytos->major, &yytos->minor);
 }
 
@@ -524,25 +524,25 @@ void ITMZFree(
        void (*freeProc)(void*)     /* Function used to reclaim memory */
 ) {
        yyParser *pParser = (yyParser*)p;
-       #ifndef YYPARSEFREENEVERNULL
+#ifndef YYPARSEFREENEVERNULL
 
        if ( pParser == 0 ) {
                return;
        }
 
-       #endif
+#endif
 
        while ( pParser->yytos > pParser->yystack ) {
                yy_pop_parser_stack(pParser);
        }
 
-       #if YYSTACKDEPTH<=0
+#if YYSTACKDEPTH<=0
 
        if ( pParser->yystack != &pParser->yystk0 ) {
                free(pParser->yystack);
        }
 
-       #endif
+#endif
        (*freeProc)((void*)pParser);
 }
 
@@ -579,39 +579,39 @@ static unsigned int yy_find_shift_action(
                i += iLookAhead;
 
                if ( i < 0 || i >= YY_ACTTAB_COUNT || yy_lookahead[i] != iLookAhead ) {
-                       #ifdef YYFALLBACK
+#ifdef YYFALLBACK
                        YYCODETYPE iFallback;            /* Fallback token */
 
                        if ( iLookAhead < sizeof(yyFallback) / sizeof(yyFallback[0])
                                        && (iFallback = yyFallback[iLookAhead]) != 0 ) {
-                               #ifndef NDEBUG
+#ifndef NDEBUG
 
                                if ( yyTraceFILE ) {
                                        fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
                                                        yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
                                }
 
-                               #endif
+#endif
                                assert( yyFallback[iFallback] == 0 ); /* Fallback loop must terminate */
                                iLookAhead = iFallback;
                                continue;
                        }
 
-                       #endif
-                       #ifdef YYWILDCARD
+#endif
+#ifdef YYWILDCARD
                        {
                                int j = i - iLookAhead + YYWILDCARD;
 
                                if (
-                               #if YY_SHIFT_MIN+YYWILDCARD<0
+#if YY_SHIFT_MIN+YYWILDCARD<0
                                        j >= 0 &&
-                               #endif
-                               #if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
+#endif
+#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
                                        j < YY_ACTTAB_COUNT &&
-                               #endif
+#endif
                                        yy_lookahead[j] == YYWILDCARD && iLookAhead > 0
                                ) {
-                                       #ifndef NDEBUG
+#ifndef NDEBUG
 
                                        if ( yyTraceFILE ) {
                                                fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
@@ -619,11 +619,11 @@ static unsigned int yy_find_shift_action(
                                                                yyTokenName[YYWILDCARD]);
                                        }
 
-                                       #endif /* NDEBUG */
+#endif /* NDEBUG */
                                        return yy_action[j];
                                }
                        }
-                       #endif /* YYWILDCARD */
+#endif /* YYWILDCARD */
                        return yy_default[stateno];
                } else {
                        return yy_action[i];
@@ -640,29 +640,29 @@ static int yy_find_reduce_action(
        YYCODETYPE iLookAhead     /* The look-ahead token */
 ) {
        int i;
-       #ifdef YYERRORSYMBOL
+#ifdef YYERRORSYMBOL
 
        if ( stateno > YY_REDUCE_COUNT ) {
                return yy_default[stateno];
        }
 
-       #else
+#else
        assert( stateno <= YY_REDUCE_COUNT );
-       #endif
+#endif
        i = yy_reduce_ofst[stateno];
        assert( i != YY_REDUCE_USE_DFLT );
        assert( iLookAhead != YYNOCODE );
        i += iLookAhead;
-       #ifdef YYERRORSYMBOL
+#ifdef YYERRORSYMBOL
 
        if ( i < 0 || i >= YY_ACTTAB_COUNT || yy_lookahead[i] != iLookAhead ) {
                return yy_default[stateno];
        }
 
-       #else
+#else
        assert( i >= 0 && i < YY_ACTTAB_COUNT );
        assert( yy_lookahead[i] == iLookAhead );
-       #endif
+#endif
        return yy_action[i];
 }
 
@@ -672,13 +672,13 @@ static int yy_find_reduce_action(
 static void yyStackOverflow(yyParser *yypParser) {
        ITMZARG_FETCH;
        yypParser->yytos--;
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE ) {
                fprintf(yyTraceFILE, "%sStack Overflow!\n", yyTracePrompt);
        }
 
-       #endif
+#endif
 
        while ( yypParser->yytos > yypParser->yystack ) {
                yy_pop_parser_stack(yypParser);
@@ -722,22 +722,22 @@ static void yy_shift(
 ) {
        yyStackEntry *yytos;
        yypParser->yytos++;
-       #ifdef YYTRACKMAXSTACKDEPTH
+#ifdef YYTRACKMAXSTACKDEPTH
 
        if ( (int)(yypParser->yytos - yypParser->yystack) > yypParser->yyhwm ) {
                yypParser->yyhwm++;
                assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
        }
 
-       #endif
-       #if YYSTACKDEPTH>0
+#endif
+#if YYSTACKDEPTH>0
 
        if ( yypParser->yytos >= &yypParser->yystack[YYSTACKDEPTH] ) {
                yyStackOverflow(yypParser);
                return;
        }
 
-       #else
+#else
 
        if ( yypParser->yytos >= &yypParser->yystack[yypParser->yystksz] ) {
                if ( yyGrowStack(yypParser) ) {
@@ -746,7 +746,7 @@ static void yy_shift(
                }
        }
 
-       #endif
+#endif
 
        if ( yyNewState > YY_MAX_SHIFT ) {
                yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
@@ -800,7 +800,7 @@ static void yy_reduce(
        int yysize;                     /* Amount to pop the stack */
        ITMZARG_FETCH;
        yymsp = yypParser->yytos;
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE && yyruleno < (int)(sizeof(yyRuleName) / sizeof(yyRuleName[0])) ) {
                yysize = yyRuleInfo[yyruleno].nrhs;
@@ -808,28 +808,28 @@ static void yy_reduce(
                                yyRuleName[yyruleno], yymsp[-yysize].stateno);
        }
 
-       #endif /* NDEBUG */
+#endif /* NDEBUG */
 
        /* Check that the stack is large enough to grow by a single entry
        ** if the RHS of the rule is empty.  This ensures that there is room
        ** enough on the stack to push the LHS value */
        if ( yyRuleInfo[yyruleno].nrhs == 0 ) {
-               #ifdef YYTRACKMAXSTACKDEPTH
+#ifdef YYTRACKMAXSTACKDEPTH
 
                if ( (int)(yypParser->yytos - yypParser->yystack) > yypParser->yyhwm ) {
                        yypParser->yyhwm++;
                        assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
                }
 
-               #endif
-               #if YYSTACKDEPTH>0
+#endif
+#if YYSTACKDEPTH>0
 
                if ( yypParser->yytos >= &yypParser->yystack[YYSTACKDEPTH - 1] ) {
                        yyStackOverflow(yypParser);
                        return;
                }
 
-               #else
+#else
 
                if ( yypParser->yytos >= &yypParser->yystack[yypParser->yystksz - 1] ) {
                        if ( yyGrowStack(yypParser) ) {
@@ -840,7 +840,7 @@ static void yy_reduce(
                        yymsp = yypParser->yytos;
                }
 
-               #endif
+#endif
        }
 
        switch ( yyruleno ) {
@@ -912,13 +912,13 @@ static void yy_parse_failed(
        yyParser *yypParser           /* The parser */
 ) {
        ITMZARG_FETCH;
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE ) {
                fprintf(yyTraceFILE, "%sFail!\n", yyTracePrompt);
        }
 
-       #endif
+#endif
 
        while ( yypParser->yytos > yypParser->yystack ) {
                yy_pop_parser_stack(yypParser);
@@ -947,7 +947,7 @@ static void yy_syntax_error(
        /************ Begin %syntax_error code ****************************************/
 
        fprintf(stderr, "Parser syntax error.\n");
-       #ifndef NDEBUG
+#ifndef NDEBUG
        fprintf(stderr, "Parser syntax error.\n");
        int n = sizeof(yyTokenName) / sizeof(yyTokenName[0]);
 
@@ -959,7 +959,7 @@ static void yy_syntax_error(
                }
        }
 
-       #endif
+#endif
        /************ End %syntax_error code ******************************************/
        ITMZARG_STORE; /* Suppress warning about unused %extra_argument variable */
 }
@@ -971,16 +971,16 @@ static void yy_accept(
        yyParser *yypParser           /* The parser */
 ) {
        ITMZARG_FETCH;
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE ) {
                fprintf(yyTraceFILE, "%sAccept!\n", yyTracePrompt);
        }
 
-       #endif
-       #ifndef YYNOERRORRECOVERY
+#endif
+#ifndef YYNOERRORRECOVERY
        yypParser->yyerrcnt = -1;
-       #endif
+#endif
        assert( yypParser->yytos == yypParser->yystack );
        /* Here code is inserted which will be executed whenever the
        ** parser accepts */
@@ -1018,54 +1018,54 @@ void ITMZ(
 ) {
        YYMINORTYPE yyminorunion;
        unsigned int yyact;   /* The parser action. */
-       #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
+#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
        int yyendofinput;     /* True if we are at the end of input */
-       #endif
-       #ifdef YYERRORSYMBOL
+#endif
+#ifdef YYERRORSYMBOL
        int yyerrorhit = 0;   /* True if yymajor has invoked an error */
-       #endif
+#endif
        yyParser *yypParser;  /* The parser */
 
        yypParser = (yyParser*)yyp;
        assert( yypParser->yytos != 0 );
-       #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
+#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
        yyendofinput = (yymajor == 0);
-       #endif
+#endif
        ITMZARG_STORE;
 
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE ) {
                fprintf(yyTraceFILE, "%sInput '%s'\n", yyTracePrompt, yyTokenName[yymajor]);
        }
 
-       #endif
+#endif
 
        do {
                yyact = yy_find_shift_action(yypParser, (YYCODETYPE)yymajor);
 
                if ( yyact <= YY_MAX_SHIFTREDUCE ) {
                        yy_shift(yypParser, yyact, yymajor, yyminor);
-                       #ifndef YYNOERRORRECOVERY
+#ifndef YYNOERRORRECOVERY
                        yypParser->yyerrcnt--;
-                       #endif
+#endif
                        yymajor = YYNOCODE;
                } else if ( yyact <= YY_MAX_REDUCE ) {
                        yy_reduce(yypParser, yyact - YY_MIN_REDUCE);
                } else {
                        assert( yyact == YY_ERROR_ACTION );
                        yyminorunion.yy0 = yyminor;
-                       #ifdef YYERRORSYMBOL
+#ifdef YYERRORSYMBOL
                        int yymx;
-                       #endif
-                       #ifndef NDEBUG
+#endif
+#ifndef NDEBUG
 
                        if ( yyTraceFILE ) {
                                fprintf(yyTraceFILE, "%sSyntax Error!\n", yyTracePrompt);
                        }
 
-                       #endif
-                       #ifdef YYERRORSYMBOL
+#endif
+#ifdef YYERRORSYMBOL
 
                        /* A syntax error has occurred.
                        ** The response to an error depends upon whether or not the
@@ -1093,14 +1093,14 @@ void ITMZ(
                        yymx = yypParser->yytos->major;
 
                        if ( yymx == YYERRORSYMBOL || yyerrorhit ) {
-                               #ifndef NDEBUG
+#ifndef NDEBUG
 
                                if ( yyTraceFILE ) {
                                        fprintf(yyTraceFILE, "%sDiscard input token %s\n",
                                                        yyTracePrompt, yyTokenName[yymajor]);
                                }
 
-                               #endif
+#endif
                                yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
                                yymajor = YYNOCODE;
                        } else {
@@ -1116,9 +1116,9 @@ void ITMZ(
                                if ( yypParser->yytos < yypParser->yystack || yymajor == 0 ) {
                                        yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
                                        yy_parse_failed(yypParser);
-                                       #ifndef YYNOERRORRECOVERY
+#ifndef YYNOERRORRECOVERY
                                        yypParser->yyerrcnt = -1;
-                                       #endif
+#endif
                                        yymajor = YYNOCODE;
                                } else if ( yymx != YYERRORSYMBOL ) {
                                        yy_shift(yypParser, yyact, YYERRORSYMBOL, yyminor);
@@ -1127,7 +1127,7 @@ void ITMZ(
 
                        yypParser->yyerrcnt = 3;
                        yyerrorhit = 1;
-                       #elif defined(YYNOERRORRECOVERY)
+#elif defined(YYNOERRORRECOVERY)
                        /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
                        ** do any kind of error recovery.  Instead, simply invoke the syntax
                        ** error routine and continue going as if nothing had happened.
@@ -1139,7 +1139,7 @@ void ITMZ(
                        yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
                        yymajor = YYNOCODE;
 
-                       #else  /* YYERRORSYMBOL is not defined */
+#else  /* YYERRORSYMBOL is not defined */
 
                        /* This is what we do if the grammar does not define ERROR:
                        **
@@ -1159,17 +1159,17 @@ void ITMZ(
 
                        if ( yyendofinput ) {
                                yy_parse_failed(yypParser);
-                               #ifndef YYNOERRORRECOVERY
+#ifndef YYNOERRORRECOVERY
                                yypParser->yyerrcnt = -1;
-                               #endif
+#endif
                        }
 
                        yymajor = YYNOCODE;
-                       #endif
+#endif
                }
        } while ( yymajor != YYNOCODE && yypParser->yytos > yypParser->yystack );
 
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE ) {
                yyStackEntry *i;
@@ -1184,6 +1184,6 @@ void ITMZ(
                fprintf(yyTraceFILE, "]\n");
        }
 
-       #endif
+#endif
        return;
 }
index 69561ba784f98b7cd71e8cdf1801f335853d7258..8ac08d6c788fef54a2835d2cbd9c83085c38940b 100644 (file)
@@ -196,9 +196,9 @@ void parse_itmz_token_chain(mmd_engine * e, token * chain) {
        token * walker = chain->next;                           // Walk the existing tree
        token * remainder;                                                      // Hold unparsed tail of chain
 
-       #ifndef NDEBUG
+#ifndef NDEBUG
        ITMZTrace(stderr, "parser >>");
-       #endif
+#endif
 
        // Remove existing token tree
        e->root = NULL;
@@ -212,9 +212,9 @@ void parse_itmz_token_chain(mmd_engine * e, token * chain) {
        }
 
        // Signal finish to parser
-       #ifndef NDEBUG
+#ifndef NDEBUG
        fprintf(stderr, "\nFinish parse\n");
-       #endif
+#endif
        ITMZ(pParser, 0, NULL, e);
 
        if (e->root) {
index 874bbc0e9b45ca8b4ff9a4dca77516fecb99937f..6c39c6bdbafb50c5446f991cd95cab7dd3d5e583 100644 (file)
@@ -1141,9 +1141,9 @@ 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
+#ifndef NDEBUG
        ParseTrace(stderr, "parser >>");
-       #endif
+#endif
 
        // Remove existing token tree
        e->root = NULL;
@@ -1159,9 +1159,9 @@ void mmd_parse_token_chain(mmd_engine * e, token * chain) {
                        remainder->prev = NULL;
                }
 
-               #ifndef NDEBUG
+#ifndef NDEBUG
                fprintf(stderr, "\nNew line\n");
-               #endif
+#endif
 
                Parse(pParser, walker->type, walker, e);
 
@@ -1169,9 +1169,9 @@ void mmd_parse_token_chain(mmd_engine * e, token * chain) {
        }
 
        // Signal finish to parser
-       #ifndef NDEBUG
+#ifndef NDEBUG
        fprintf(stderr, "\nFinish parse\n");
-       #endif
+#endif
        Parse(pParser, 0, NULL, e);
 
        // Disconnect of (now empty) root
@@ -2020,10 +2020,10 @@ void strip_line_tokens_from_block(mmd_engine * e, token * block) {
                return;
        }
 
-       #ifndef NDEBUG
+#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
+#endif
 
        token * l = block->child;
 
@@ -2249,9 +2249,9 @@ token * mmd_engine_parse_substring(mmd_engine * e, size_t byte_start, size_t byt
 
                pair_emphasis_tokens(doc);
 
-               #ifndef NDEBUG
+#ifndef NDEBUG
                token_tree_describe(doc, e->dstr->str);
-               #endif
+#endif
        }
 
        // Return original extensions
index 427204a103438384708816b9752adc2e216d2caf..410b6d141e000f5550725bfab65623727410ac8b 100644 (file)
@@ -274,20 +274,20 @@ typedef struct yyStackEntry yyStackEntry;
 ** the following structure */
 struct yyParser {
        yyStackEntry *yytos;          /* Pointer to top element of the stack */
-       #ifdef YYTRACKMAXSTACKDEPTH
+#ifdef YYTRACKMAXSTACKDEPTH
        int yyhwm;                    /* High-water mark of the stack */
-       #endif
-       #ifndef YYNOERRORRECOVERY
+#endif
+#ifndef YYNOERRORRECOVERY
        int yyerrcnt;                 /* Shifts left before out of the error */
-       #endif
+#endif
        OPMLARG_SDECL                /* A place to hold %extra_argument */
-       #if YYSTACKDEPTH<=0
+#if YYSTACKDEPTH<=0
        int yystksz;                  /* Current side of the stack */
        yyStackEntry *yystack;        /* The parser's stack */
        yyStackEntry yystk0;          /* First stack entry */
-       #else
+#else
        yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
-       #endif
+#endif
 };
 typedef struct yyParser yyParser;
 
@@ -394,14 +394,14 @@ static int yyGrowStack(yyParser *p) {
        if ( pNew ) {
                p->yystack = pNew;
                p->yytos = &p->yystack[idx];
-               #ifndef NDEBUG
+#ifndef NDEBUG
 
                if ( yyTraceFILE ) {
                        fprintf(yyTraceFILE, "%sStack grows from %d to %d entries.\n",
                                        yyTracePrompt, p->yystksz, newSize);
                }
 
-               #endif
+#endif
                p->yystksz = newSize;
        }
 
@@ -435,10 +435,10 @@ void *OPMLAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)) {
        pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
 
        if ( pParser ) {
-               #ifdef YYTRACKMAXSTACKDEPTH
+#ifdef YYTRACKMAXSTACKDEPTH
                pParser->yyhwm = 0;
-               #endif
-               #if YYSTACKDEPTH<=0
+#endif
+#if YYSTACKDEPTH<=0
                pParser->yytos = NULL;
                pParser->yystack = NULL;
                pParser->yystksz = 0;
@@ -448,10 +448,10 @@ void *OPMLAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)) {
                        pParser->yystksz = 1;
                }
 
-               #endif
-               #ifndef YYNOERRORRECOVERY
+#endif
+#ifndef YYNOERRORRECOVERY
                pParser->yyerrcnt = -1;
-               #endif
+#endif
                pParser->yytos = pParser->yystack;
                pParser->yystack[0].stateno = 0;
                pParser->yystack[0].major = 0;
@@ -503,7 +503,7 @@ static void yy_pop_parser_stack(yyParser *pParser) {
        assert( pParser->yytos != 0 );
        assert( pParser->yytos > pParser->yystack );
        yytos = pParser->yytos--;
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE ) {
                fprintf(yyTraceFILE, "%sPopping %s\n",
@@ -511,7 +511,7 @@ static void yy_pop_parser_stack(yyParser *pParser) {
                                yyTokenName[yytos->major]);
        }
 
-       #endif
+#endif
        yy_destructor(pParser, yytos->major, &yytos->minor);
 }
 
@@ -528,25 +528,25 @@ void OPMLFree(
        void (*freeProc)(void*)     /* Function used to reclaim memory */
 ) {
        yyParser *pParser = (yyParser*)p;
-       #ifndef YYPARSEFREENEVERNULL
+#ifndef YYPARSEFREENEVERNULL
 
        if ( pParser == 0 ) {
                return;
        }
 
-       #endif
+#endif
 
        while ( pParser->yytos > pParser->yystack ) {
                yy_pop_parser_stack(pParser);
        }
 
-       #if YYSTACKDEPTH<=0
+#if YYSTACKDEPTH<=0
 
        if ( pParser->yystack != &pParser->yystk0 ) {
                free(pParser->yystack);
        }
 
-       #endif
+#endif
        (*freeProc)((void*)pParser);
 }
 
@@ -583,39 +583,39 @@ static unsigned int yy_find_shift_action(
                i += iLookAhead;
 
                if ( i < 0 || i >= YY_ACTTAB_COUNT || yy_lookahead[i] != iLookAhead ) {
-                       #ifdef YYFALLBACK
+#ifdef YYFALLBACK
                        YYCODETYPE iFallback;            /* Fallback token */
 
                        if ( iLookAhead < sizeof(yyFallback) / sizeof(yyFallback[0])
                                        && (iFallback = yyFallback[iLookAhead]) != 0 ) {
-                               #ifndef NDEBUG
+#ifndef NDEBUG
 
                                if ( yyTraceFILE ) {
                                        fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
                                                        yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
                                }
 
-                               #endif
+#endif
                                assert( yyFallback[iFallback] == 0 ); /* Fallback loop must terminate */
                                iLookAhead = iFallback;
                                continue;
                        }
 
-                       #endif
-                       #ifdef YYWILDCARD
+#endif
+#ifdef YYWILDCARD
                        {
                                int j = i - iLookAhead + YYWILDCARD;
 
                                if (
-                               #if YY_SHIFT_MIN+YYWILDCARD<0
+#if YY_SHIFT_MIN+YYWILDCARD<0
                                        j >= 0 &&
-                               #endif
-                               #if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
+#endif
+#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
                                        j < YY_ACTTAB_COUNT &&
-                               #endif
+#endif
                                        yy_lookahead[j] == YYWILDCARD && iLookAhead > 0
                                ) {
-                                       #ifndef NDEBUG
+#ifndef NDEBUG
 
                                        if ( yyTraceFILE ) {
                                                fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
@@ -623,11 +623,11 @@ static unsigned int yy_find_shift_action(
                                                                yyTokenName[YYWILDCARD]);
                                        }
 
-                                       #endif /* NDEBUG */
+#endif /* NDEBUG */
                                        return yy_action[j];
                                }
                        }
-                       #endif /* YYWILDCARD */
+#endif /* YYWILDCARD */
                        return yy_default[stateno];
                } else {
                        return yy_action[i];
@@ -644,29 +644,29 @@ static int yy_find_reduce_action(
        YYCODETYPE iLookAhead     /* The look-ahead token */
 ) {
        int i;
-       #ifdef YYERRORSYMBOL
+#ifdef YYERRORSYMBOL
 
        if ( stateno > YY_REDUCE_COUNT ) {
                return yy_default[stateno];
        }
 
-       #else
+#else
        assert( stateno <= YY_REDUCE_COUNT );
-       #endif
+#endif
        i = yy_reduce_ofst[stateno];
        assert( i != YY_REDUCE_USE_DFLT );
        assert( iLookAhead != YYNOCODE );
        i += iLookAhead;
-       #ifdef YYERRORSYMBOL
+#ifdef YYERRORSYMBOL
 
        if ( i < 0 || i >= YY_ACTTAB_COUNT || yy_lookahead[i] != iLookAhead ) {
                return yy_default[stateno];
        }
 
-       #else
+#else
        assert( i >= 0 && i < YY_ACTTAB_COUNT );
        assert( yy_lookahead[i] == iLookAhead );
-       #endif
+#endif
        return yy_action[i];
 }
 
@@ -676,13 +676,13 @@ static int yy_find_reduce_action(
 static void yyStackOverflow(yyParser *yypParser) {
        OPMLARG_FETCH;
        yypParser->yytos--;
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE ) {
                fprintf(yyTraceFILE, "%sStack Overflow!\n", yyTracePrompt);
        }
 
-       #endif
+#endif
 
        while ( yypParser->yytos > yypParser->yystack ) {
                yy_pop_parser_stack(yypParser);
@@ -726,22 +726,22 @@ static void yy_shift(
 ) {
        yyStackEntry *yytos;
        yypParser->yytos++;
-       #ifdef YYTRACKMAXSTACKDEPTH
+#ifdef YYTRACKMAXSTACKDEPTH
 
        if ( (int)(yypParser->yytos - yypParser->yystack) > yypParser->yyhwm ) {
                yypParser->yyhwm++;
                assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
        }
 
-       #endif
-       #if YYSTACKDEPTH>0
+#endif
+#if YYSTACKDEPTH>0
 
        if ( yypParser->yytos >= &yypParser->yystack[YYSTACKDEPTH] ) {
                yyStackOverflow(yypParser);
                return;
        }
 
-       #else
+#else
 
        if ( yypParser->yytos >= &yypParser->yystack[yypParser->yystksz] ) {
                if ( yyGrowStack(yypParser) ) {
@@ -750,7 +750,7 @@ static void yy_shift(
                }
        }
 
-       #endif
+#endif
 
        if ( yyNewState > YY_MAX_SHIFT ) {
                yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
@@ -807,7 +807,7 @@ static void yy_reduce(
        int yysize;                     /* Amount to pop the stack */
        OPMLARG_FETCH;
        yymsp = yypParser->yytos;
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE && yyruleno < (int)(sizeof(yyRuleName) / sizeof(yyRuleName[0])) ) {
                yysize = yyRuleInfo[yyruleno].nrhs;
@@ -815,28 +815,28 @@ static void yy_reduce(
                                yyRuleName[yyruleno], yymsp[-yysize].stateno);
        }
 
-       #endif /* NDEBUG */
+#endif /* NDEBUG */
 
        /* Check that the stack is large enough to grow by a single entry
        ** if the RHS of the rule is empty.  This ensures that there is room
        ** enough on the stack to push the LHS value */
        if ( yyRuleInfo[yyruleno].nrhs == 0 ) {
-               #ifdef YYTRACKMAXSTACKDEPTH
+#ifdef YYTRACKMAXSTACKDEPTH
 
                if ( (int)(yypParser->yytos - yypParser->yystack) > yypParser->yyhwm ) {
                        yypParser->yyhwm++;
                        assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
                }
 
-               #endif
-               #if YYSTACKDEPTH>0
+#endif
+#if YYSTACKDEPTH>0
 
                if ( yypParser->yytos >= &yypParser->yystack[YYSTACKDEPTH - 1] ) {
                        yyStackOverflow(yypParser);
                        return;
                }
 
-               #else
+#else
 
                if ( yypParser->yytos >= &yypParser->yystack[yypParser->yystksz - 1] ) {
                        if ( yyGrowStack(yypParser) ) {
@@ -847,7 +847,7 @@ static void yy_reduce(
                        yymsp = yypParser->yytos;
                }
 
-               #endif
+#endif
        }
 
        switch ( yyruleno ) {
@@ -922,13 +922,13 @@ static void yy_parse_failed(
        yyParser *yypParser           /* The parser */
 ) {
        OPMLARG_FETCH;
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE ) {
                fprintf(yyTraceFILE, "%sFail!\n", yyTracePrompt);
        }
 
-       #endif
+#endif
 
        while ( yypParser->yytos > yypParser->yystack ) {
                yy_pop_parser_stack(yypParser);
@@ -957,7 +957,7 @@ static void yy_syntax_error(
        /************ Begin %syntax_error code ****************************************/
 
        fprintf(stderr, "Parser syntax error.\n");
-       #ifndef NDEBUG
+#ifndef NDEBUG
        fprintf(stderr, "Parser syntax error.\n");
        int n = sizeof(yyTokenName) / sizeof(yyTokenName[0]);
 
@@ -969,7 +969,7 @@ static void yy_syntax_error(
                }
        }
 
-       #endif
+#endif
        /************ End %syntax_error code ******************************************/
        OPMLARG_STORE; /* Suppress warning about unused %extra_argument variable */
 }
@@ -981,16 +981,16 @@ static void yy_accept(
        yyParser *yypParser           /* The parser */
 ) {
        OPMLARG_FETCH;
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE ) {
                fprintf(yyTraceFILE, "%sAccept!\n", yyTracePrompt);
        }
 
-       #endif
-       #ifndef YYNOERRORRECOVERY
+#endif
+#ifndef YYNOERRORRECOVERY
        yypParser->yyerrcnt = -1;
-       #endif
+#endif
        assert( yypParser->yytos == yypParser->yystack );
        /* Here code is inserted which will be executed whenever the
        ** parser accepts */
@@ -1028,54 +1028,54 @@ void OPML(
 ) {
        YYMINORTYPE yyminorunion;
        unsigned int yyact;   /* The parser action. */
-       #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
+#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
        int yyendofinput;     /* True if we are at the end of input */
-       #endif
-       #ifdef YYERRORSYMBOL
+#endif
+#ifdef YYERRORSYMBOL
        int yyerrorhit = 0;   /* True if yymajor has invoked an error */
-       #endif
+#endif
        yyParser *yypParser;  /* The parser */
 
        yypParser = (yyParser*)yyp;
        assert( yypParser->yytos != 0 );
-       #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
+#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
        yyendofinput = (yymajor == 0);
-       #endif
+#endif
        OPMLARG_STORE;
 
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE ) {
                fprintf(yyTraceFILE, "%sInput '%s'\n", yyTracePrompt, yyTokenName[yymajor]);
        }
 
-       #endif
+#endif
 
        do {
                yyact = yy_find_shift_action(yypParser, (YYCODETYPE)yymajor);
 
                if ( yyact <= YY_MAX_SHIFTREDUCE ) {
                        yy_shift(yypParser, yyact, yymajor, yyminor);
-                       #ifndef YYNOERRORRECOVERY
+#ifndef YYNOERRORRECOVERY
                        yypParser->yyerrcnt--;
-                       #endif
+#endif
                        yymajor = YYNOCODE;
                } else if ( yyact <= YY_MAX_REDUCE ) {
                        yy_reduce(yypParser, yyact - YY_MIN_REDUCE);
                } else {
                        assert( yyact == YY_ERROR_ACTION );
                        yyminorunion.yy0 = yyminor;
-                       #ifdef YYERRORSYMBOL
+#ifdef YYERRORSYMBOL
                        int yymx;
-                       #endif
-                       #ifndef NDEBUG
+#endif
+#ifndef NDEBUG
 
                        if ( yyTraceFILE ) {
                                fprintf(yyTraceFILE, "%sSyntax Error!\n", yyTracePrompt);
                        }
 
-                       #endif
-                       #ifdef YYERRORSYMBOL
+#endif
+#ifdef YYERRORSYMBOL
 
                        /* A syntax error has occurred.
                        ** The response to an error depends upon whether or not the
@@ -1103,14 +1103,14 @@ void OPML(
                        yymx = yypParser->yytos->major;
 
                        if ( yymx == YYERRORSYMBOL || yyerrorhit ) {
-                               #ifndef NDEBUG
+#ifndef NDEBUG
 
                                if ( yyTraceFILE ) {
                                        fprintf(yyTraceFILE, "%sDiscard input token %s\n",
                                                        yyTracePrompt, yyTokenName[yymajor]);
                                }
 
-                               #endif
+#endif
                                yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
                                yymajor = YYNOCODE;
                        } else {
@@ -1126,9 +1126,9 @@ void OPML(
                                if ( yypParser->yytos < yypParser->yystack || yymajor == 0 ) {
                                        yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
                                        yy_parse_failed(yypParser);
-                                       #ifndef YYNOERRORRECOVERY
+#ifndef YYNOERRORRECOVERY
                                        yypParser->yyerrcnt = -1;
-                                       #endif
+#endif
                                        yymajor = YYNOCODE;
                                } else if ( yymx != YYERRORSYMBOL ) {
                                        yy_shift(yypParser, yyact, YYERRORSYMBOL, yyminor);
@@ -1137,7 +1137,7 @@ void OPML(
 
                        yypParser->yyerrcnt = 3;
                        yyerrorhit = 1;
-                       #elif defined(YYNOERRORRECOVERY)
+#elif defined(YYNOERRORRECOVERY)
                        /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
                        ** do any kind of error recovery.  Instead, simply invoke the syntax
                        ** error routine and continue going as if nothing had happened.
@@ -1149,7 +1149,7 @@ void OPML(
                        yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
                        yymajor = YYNOCODE;
 
-                       #else  /* YYERRORSYMBOL is not defined */
+#else  /* YYERRORSYMBOL is not defined */
 
                        /* This is what we do if the grammar does not define ERROR:
                        **
@@ -1169,17 +1169,17 @@ void OPML(
 
                        if ( yyendofinput ) {
                                yy_parse_failed(yypParser);
-                               #ifndef YYNOERRORRECOVERY
+#ifndef YYNOERRORRECOVERY
                                yypParser->yyerrcnt = -1;
-                               #endif
+#endif
                        }
 
                        yymajor = YYNOCODE;
-                       #endif
+#endif
                }
        } while ( yymajor != YYNOCODE && yypParser->yytos > yypParser->yystack );
 
-       #ifndef NDEBUG
+#ifndef NDEBUG
 
        if ( yyTraceFILE ) {
                yyStackEntry *i;
@@ -1194,6 +1194,6 @@ void OPML(
                fprintf(yyTraceFILE, "]\n");
        }
 
-       #endif
+#endif
        return;
 }
index 602892af4c7051ef9352069bf4a63fb2f891aeef..ccc75acecdb96d74f06507adf8a085d88ee8e8e0 100644 (file)
@@ -194,9 +194,9 @@ void parse_opml_token_chain(mmd_engine * e, token * chain) {
        token * walker = chain->next;                           // Walk the existing tree
        token * remainder;                                                      // Hold unparsed tail of chain
 
-       #ifndef NDEBUG
+#ifndef NDEBUG
        OPMLTrace(stderr, "parser >>");
-       #endif
+#endif
 
        // Remove existing token tree
        e->root = NULL;
@@ -210,9 +210,9 @@ void parse_opml_token_chain(mmd_engine * e, token * chain) {
        }
 
        // Signal finish to parser
-       #ifndef NDEBUG
+#ifndef NDEBUG
        fprintf(stderr, "\nFinish parse\n");
-       #endif
+#endif
        OPML(pParser, 0, NULL, e);
 
        if (e->root) {
index 9b79ccd3d32dd99f86327b237f7cdab12b972806..8337c1675e4af7e60cd029c4526b5c2232168bdd 100644 (file)
@@ -115,11 +115,11 @@ void token_pool_free(void) {
 token * token_new(unsigned short type, size_t start, size_t len) {
 
 
-       #ifdef kUseObjectPool
+#ifdef kUseObjectPool
        token * t = pool_allocate_object(token_pool);
-       #else
+#else
        token * t = malloc(sizeof(token));
-       #endif
+#endif
 
        if (t) {
                t->type = type;
@@ -145,11 +145,11 @@ token * token_new(unsigned short type, size_t start, size_t len) {
 
 /// Duplicate an existing token
 token * token_copy(token * original) {
-       #ifdef kUseObjectPool
+#ifdef kUseObjectPool
        token * t = pool_allocate_object(token_pool);
-       #else
+#else
        token * t = malloc(sizeof(token));
-       #endif
+#endif
 
        if (t) {
                * t = * original;
@@ -387,9 +387,9 @@ token * token_prune_graft(token * first, token * last, unsigned short container_
 
 /// Free token
 void token_free(token * t) {
-       #ifdef kUseObjectPool
+#ifdef kUseObjectPool
        return;
-       #else
+#else
 
        if (t == NULL) {
                return;
@@ -398,15 +398,15 @@ void token_free(token * t) {
        token_tree_free(t->child);
 
        free(t);
-       #endif
+#endif
 }
 
 
 /// Free token chain
 void token_tree_free(token * t) {
-       #ifdef kUseObjectPool
+#ifdef kUseObjectPool
        return;
-       #else
+#else
        token * n;
 
        while (t != NULL) {
@@ -416,7 +416,7 @@ void token_tree_free(token * t) {
                t = n;
        }
 
-       #endif
+#endif
 }
 
 
index 9100e938c9f81677785f6de03cc1090dc47f6618..5de98398939f56a790061b5fa3632686693f2ce3 100644 (file)
@@ -213,9 +213,9 @@ close:
                                                opener_count[peek->type]--;
                                        }
 
-                                       #ifndef NDEBUG
+#ifndef NDEBUG
                                        fprintf(stderr, "stack now sized %lu\n", s->size);
-                                       #endif
+#endif
                                        // Prune matched section
 
                                        if (e->should_prune[pair_type]) {
@@ -230,12 +230,12 @@ close:
                                        break;
                                }
 
-                               #ifndef NDEBUG
+#ifndef NDEBUG
                                else {
                                        fprintf(stderr, "token type %d failed to match stack element\n", walker->type);
                                }
 
-                               #endif
+#endif
                                i--;
                        }
                }
@@ -246,17 +246,17 @@ open:
                if (walker->can_open && e->can_open_pair[walker->type] && walker->unmatched) {
                        stack_push(s, walker);
                        opener_count[walker->type]++;
-                       #ifndef NDEBUG
+#ifndef NDEBUG
                        fprintf(stderr, "push token type %d to stack (%lu elements)\n", walker->type, s->size);
-                       #endif
+#endif
                }
 
                walker = walker->next;
        }
 
-       #ifndef NDEBUG
+#ifndef NDEBUG
        fprintf(stderr, "token stack has %lu elements (of %lu)\n", s->size, s->capacity);
-       #endif
+#endif
 
        // Remove unused tokens from stack and return to parent
        s->size = start_counter;
index 8763557faf2564e27358235c1827d16d5acbe083..06962308dfb84f95cc18f513ca4144ee291dc7ca 100644 (file)
@@ -636,10 +636,10 @@ attr * parse_attributes(char * source) {
                        a->next = attr_new(key, value);
                        a = a->next;
                } else {
-                       #ifndef __clang_analyzer__
+#ifndef __clang_analyzer__
                        a = attr_new(key, value);
                        attributes = a;
-                       #endif
+#endif
                }
 
                free(value);    // We stored a modified copy
@@ -1150,11 +1150,11 @@ footnote * footnote_new(const char * source, token * label, token * content, boo
 void footnote_free(footnote * f) {
        if (f) {
                if (f->free_para) {
-                       #ifdef kUseObjectPool
+#ifdef kUseObjectPool
                        // Nothing to do here
-                       #else
+#else
                        free(f->content);
-                       #endif
+#endif
                }
 
                free(f->clean_text);
index 5cdb764304ddc21f8155408f3869052754aede18..d9c6d7647671f7c6b28c0192da0d0e600a327add 100644 (file)
@@ -332,9 +332,9 @@ int main(int argc, char** argv) {
        char * output_filename;
 
        // Increment counter and prepare token pool
-       #ifdef kUseObjectPool
+#ifdef kUseObjectPool
        token_pool_init();
-       #endif
+#endif
 
        // Seed random numbers
        custom_seed_rand();
@@ -422,9 +422,9 @@ int main(int argc, char** argv) {
                        }
 
                        // Increment counter and prepare token pool
-                       #ifdef kUseObjectPool
+#ifdef kUseObjectPool
                        token_pool_init();
-                       #endif
+#endif
 
                        if (a_meta->count > 0) {
                                // List metadata keys
@@ -508,20 +508,20 @@ int main(int argc, char** argv) {
                        // Perform transclusion(s)
 
                        // Convert to absolute path for first file to enable proper path resolution
-                       #ifdef PATH_MAX
+#ifdef PATH_MAX
                        // If PATH_MAX defined, use it
                        char absolute[PATH_MAX + 1];
                        realpath(a_file->filename[0], absolute);
                        folder = dirname((char *) a_file->filename[0]);
 
                        mmd_transclude_source(buffer, folder, absolute, format, NULL, NULL);
-                       #else
+#else
                        // If undefined, then we *should* be able to use a NULL pointer to allocate
                        char * absolute = realpath(a_file->filename[0], NULL);
                        folder = dirname((char *) a_file->filename[0]);
                        mmd_transclude_source(buffer, folder, absolute, format, NULL, NULL);
                        free(absolute);
-                       #endif
+#endif
                        // Don't free folder -- owned by dirname
                }
 
@@ -597,9 +597,9 @@ exit:
        // Decrement counter and clean up token pool
        token_pool_drain();
 
-       #ifdef kUseObjectPool
+#ifdef kUseObjectPool
        token_pool_free();
-       #endif
+#endif
 
 exit2: