From 74714b17abc1c367db80b8c9fecefd269587fdab Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Sun, 29 Jan 2017 07:58:57 -0500 Subject: [PATCH] ADDED: Table of Contents support --- README.md | 6 +- src/html.c | 66 +++ src/lexer.c | 40 +- src/lexer.re | 2 + src/libMultiMarkdown.h | 3 + src/mmd.c | 3 + src/parser.c | 540 ++++++++++++------------ src/parser.h | 5 +- src/parser.out | 443 +++++++++---------- src/parser.y | 1 + src/writer.c | 2 + src/writer.h | 2 + templates/README.md.in | 6 +- tests/MMD6Tests/Table of Contents.html | 51 +++ tests/MMD6Tests/Table of Contents.htmlc | 23 + tests/MMD6Tests/Table of Contents.text | 23 + 16 files changed, 721 insertions(+), 495 deletions(-) create mode 100644 tests/MMD6Tests/Table of Contents.html create mode 100644 tests/MMD6Tests/Table of Contents.htmlc create mode 100644 tests/MMD6Tests/Table of Contents.text diff --git a/README.md b/README.md index dc4523d..570910c 100644 --- a/README.md +++ b/README.md @@ -419,6 +419,7 @@ features have been implemented: * Smart quotes (support for languages other than english is not fully implemented yet) * Superscripts/subscripts +* Table of Contents Things that are partially completed: @@ -431,6 +432,8 @@ Things that are partially completed: * CriticMarkup -- need to decide: * How to handle CM stretches that include blank lines * Fenced code blocks +* Metadata +* Full/Snippet modes Things yet to be completed: @@ -439,13 +442,12 @@ Things yet to be completed: * Manually specified labels for headers * Definition lists * Abbreviations -* Metadata * Glossaries * Tables -* Table of Contents * File Transclusion + ### Accuracy ### MultiMarkdown v6 successfully parses the Markdown [syntax page], except for diff --git a/src/html.c b/src/html.c index b56eac8..a89f007 100644 --- a/src/html.c +++ b/src/html.c @@ -272,6 +272,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, size_t return; short temp_short; + short temp_short2; link * temp_link = NULL; char * temp_char = NULL; char * temp_char2 = NULL; @@ -455,6 +456,70 @@ void mmd_export_token_html(DString * out, const char * source, token * t, size_t print("

"); scratch->padded = 0; break; + case BLOCK_TOC: + temp_short = 0; + temp_short2 = 0; + pad(out, 2, scratch); + print("
"); + + for (int i = 0; i < scratch->header_stack->size; ++i) + { + temp_token = stack_peek_index(scratch->header_stack, i); + + if (temp_token->type == temp_short2) { + // Same level -- close list item + print("\n"); + } + + if (temp_short == 0) { + // First item + print("\n\n"); + temp_short2--; + } + + if (temp_short) + print("\n\n"); + + print("
"); + scratch->padded = 0; + break; case BRACE_DOUBLE_LEFT: print("{{"); break; @@ -947,6 +1012,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, size_t case TEXT_NUMBER_POSS_LIST: case TEXT_PERIOD: case TEXT_PLAIN: + case TOC: print_token(t); break; case UL: diff --git a/src/lexer.c b/src/lexer.c index 2ab5080..f67cd24 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.14.3 on Wed Jan 18 22:23:18 2017 */ +/* Generated by re2c 0.14.3 on Sat Jan 28 22:49:30 2017 */ /** MultiMarkdown 6 -- Lightweight markup processor to produce HTML, LaTeX, and more. @@ -404,7 +404,8 @@ yy61: case 2: goto yy9; case 3: goto yy11; case 4: goto yy33; - default: goto yy198; + case 5: goto yy198; + default: goto yy243; } yy62: YYCTXMARKER = YYCURSOR + 1; @@ -936,7 +937,13 @@ yy240: ++YYCURSOR; { return CRITIC_ADD_CLOSE; } yy242: - ++YYCURSOR; + yyaccept = 6; + yych = *(YYMARKER = ++YYCURSOR); + switch (yych) { + case 'T': goto yy259; + default: goto yy243; + } +yy243: { return BRACE_DOUBLE_LEFT; } yy244: yych = *++YYCURSOR; @@ -983,6 +990,33 @@ yy255: yy257: ++YYCURSOR; { return CRITIC_HI_OPEN; } +yy259: + yych = *++YYCURSOR; + switch (yych) { + case 'O': goto yy260; + default: goto yy61; + } +yy260: + yych = *++YYCURSOR; + switch (yych) { + case 'C': goto yy261; + default: goto yy61; + } +yy261: + yych = *++YYCURSOR; + switch (yych) { + case '}': goto yy262; + default: goto yy61; + } +yy262: + yych = *++YYCURSOR; + switch (yych) { + case '}': goto yy263; + default: goto yy61; + } +yy263: + ++YYCURSOR; + { return TOC; } } } diff --git a/src/lexer.re b/src/lexer.re index 2d7b6d8..16da856 100644 --- a/src/lexer.re +++ b/src/lexer.re @@ -92,6 +92,8 @@ int scan(Scanner * s, const char * stop) { // The order of these seems to matter + "{{TOC}}" { return TOC; } + "{++" { return CRITIC_ADD_OPEN; } "++}" { return CRITIC_ADD_CLOSE; } diff --git a/src/libMultiMarkdown.h b/src/libMultiMarkdown.h index b8ac561..53894df 100644 --- a/src/libMultiMarkdown.h +++ b/src/libMultiMarkdown.h @@ -134,6 +134,7 @@ enum token_types { BLOCK_META, BLOCK_PARA, BLOCK_TABLE, + BLOCK_TOC, ROW_TABLE, CRITIC_ADD_OPEN, @@ -250,6 +251,8 @@ enum token_types { MARKER_LIST_BULLET, MARKER_LIST_ENUMERATOR, + TOC, + TEXT_EMPTY, TEXT_LINEBREAK, TEXT_NL, diff --git a/src/mmd.c b/src/mmd.c index 8f15053..4831872 100644 --- a/src/mmd.c +++ b/src/mmd.c @@ -504,6 +504,9 @@ void mmd_assign_line_type(mmd_engine * e, token * line) { e->allow_meta = false; line->type = LINE_EMPTY; break; + case TOC: + line->type = (e->extensions & EXT_COMPATIBILITY) ? LINE_PLAIN : LINE_TOC; + break; case BRACKET_LEFT: if (e->extensions & EXT_COMPATIBILITY) { scan_len = scan_ref_link_no_attributes(&source[line->start]); diff --git a/src/parser.c b/src/parser.c index 5f25b72..c6ec537 100644 --- a/src/parser.c +++ b/src/parser.c @@ -92,7 +92,7 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned char -#define YYNOCODE 58 +#define YYNOCODE 59 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE token * typedef union { @@ -108,15 +108,15 @@ typedef union { #define ParseARG_STORE yypParser->engine = engine #define YYFALLBACK 1 #define YYNSTATE 40 -#define YYNRULE 92 +#define YYNRULE 93 #define YY_MAX_SHIFT 39 -#define YY_MIN_SHIFTREDUCE 95 -#define YY_MAX_SHIFTREDUCE 186 -#define YY_MIN_REDUCE 187 -#define YY_MAX_REDUCE 278 -#define YY_ERROR_ACTION 279 -#define YY_ACCEPT_ACTION 280 -#define YY_NO_ACTION 281 +#define YY_MIN_SHIFTREDUCE 96 +#define YY_MAX_SHIFTREDUCE 188 +#define YY_MIN_REDUCE 189 +#define YY_MAX_REDUCE 281 +#define YY_ERROR_ACTION 282 +#define YY_ACCEPT_ACTION 283 +#define YY_NO_ACTION 284 /************* End control #defines *******************************************/ /* Define the yytestcase() macro to be a no-op if is not already defined @@ -188,72 +188,72 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (171) +#define YY_ACTTAB_COUNT (174) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 187, 163, 21, 157, 158, 14, 100, 101, 102, 103, - /* 10 */ 104, 105, 111, 15, 5, 4, 172, 3, 2, 16, - /* 20 */ 13, 12, 163, 11, 21, 157, 158, 14, 100, 101, - /* 30 */ 102, 103, 104, 105, 111, 15, 5, 4, 172, 3, - /* 40 */ 2, 16, 13, 12, 163, 11, 280, 1, 97, 98, - /* 50 */ 10, 39, 37, 35, 109, 38, 112, 113, 114, 115, - /* 60 */ 116, 117, 120, 120, 156, 186, 30, 30, 37, 181, - /* 70 */ 35, 96, 98, 10, 39, 37, 35, 109, 38, 112, - /* 80 */ 113, 114, 115, 116, 117, 29, 156, 185, 29, 151, - /* 90 */ 182, 37, 26, 35, 27, 27, 6, 6, 153, 7, - /* 100 */ 7, 29, 146, 17, 29, 17, 19, 163, 19, 28, - /* 110 */ 28, 29, 8, 8, 29, 9, 9, 161, 162, 22, - /* 120 */ 119, 22, 24, 119, 24, 123, 119, 29, 29, 18, - /* 130 */ 181, 18, 20, 181, 20, 29, 160, 161, 162, 119, - /* 140 */ 119, 4, 31, 31, 129, 23, 25, 23, 25, 149, - /* 150 */ 167, 182, 147, 178, 182, 134, 121, 179, 32, 32, - /* 160 */ 33, 33, 166, 34, 34, 36, 36, 5, 124, 121, - /* 170 */ 137, + /* 0 */ 189, 165, 21, 159, 160, 14, 101, 102, 103, 104, + /* 10 */ 105, 106, 112, 15, 5, 4, 174, 3, 2, 16, + /* 20 */ 13, 12, 119, 165, 11, 21, 159, 160, 14, 101, + /* 30 */ 102, 103, 104, 105, 106, 112, 15, 5, 4, 174, + /* 40 */ 3, 2, 16, 13, 12, 119, 165, 11, 283, 1, + /* 50 */ 98, 99, 10, 39, 37, 35, 110, 38, 113, 114, + /* 60 */ 115, 116, 117, 118, 122, 122, 188, 30, 30, 158, + /* 70 */ 37, 153, 35, 97, 99, 10, 39, 37, 35, 110, + /* 80 */ 38, 113, 114, 115, 116, 117, 118, 29, 26, 187, + /* 90 */ 29, 163, 164, 37, 29, 35, 180, 158, 6, 6, + /* 100 */ 181, 7, 7, 155, 29, 17, 121, 17, 19, 29, + /* 110 */ 19, 162, 18, 29, 18, 8, 8, 183, 29, 165, + /* 120 */ 9, 9, 22, 183, 22, 121, 125, 24, 148, 24, + /* 130 */ 121, 20, 121, 20, 29, 131, 23, 191, 23, 184, + /* 140 */ 183, 169, 151, 31, 31, 184, 121, 27, 27, 163, + /* 150 */ 164, 29, 25, 168, 25, 5, 28, 28, 4, 149, + /* 160 */ 32, 32, 184, 33, 33, 34, 34, 36, 36, 123, + /* 170 */ 139, 136, 126, 123, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 0, 22, 2, 3, 4, 5, 6, 7, 8, 9, + /* 0 */ 0, 23, 2, 3, 4, 5, 6, 7, 8, 9, /* 10 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - /* 20 */ 20, 21, 22, 23, 2, 3, 4, 5, 6, 7, - /* 30 */ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - /* 40 */ 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, - /* 50 */ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - /* 60 */ 39, 40, 43, 44, 1, 1, 55, 56, 47, 1, - /* 70 */ 49, 27, 28, 29, 30, 31, 32, 33, 34, 35, - /* 80 */ 36, 37, 38, 39, 40, 30, 1, 23, 30, 54, - /* 90 */ 22, 47, 44, 49, 53, 54, 41, 42, 56, 41, - /* 100 */ 42, 30, 52, 48, 30, 50, 48, 22, 50, 53, - /* 110 */ 54, 30, 41, 42, 30, 41, 42, 3, 4, 48, - /* 120 */ 42, 50, 48, 42, 50, 46, 42, 30, 30, 48, - /* 130 */ 1, 50, 48, 1, 50, 30, 22, 3, 4, 42, - /* 140 */ 42, 15, 51, 52, 49, 48, 48, 50, 50, 20, - /* 150 */ 1, 22, 20, 1, 22, 50, 22, 5, 45, 46, - /* 160 */ 41, 42, 13, 41, 42, 41, 42, 14, 47, 22, - /* 170 */ 16, + /* 20 */ 20, 21, 22, 23, 24, 2, 3, 4, 5, 6, + /* 30 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + /* 40 */ 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, + /* 50 */ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + /* 60 */ 38, 39, 40, 41, 44, 45, 1, 56, 57, 1, + /* 70 */ 48, 55, 50, 28, 29, 30, 31, 32, 33, 34, + /* 80 */ 35, 36, 37, 38, 39, 40, 41, 31, 45, 24, + /* 90 */ 31, 3, 4, 48, 31, 50, 1, 1, 42, 43, + /* 100 */ 5, 42, 43, 57, 31, 49, 43, 51, 49, 31, + /* 110 */ 51, 23, 49, 31, 51, 42, 43, 1, 31, 23, + /* 120 */ 42, 43, 49, 1, 51, 43, 47, 49, 53, 51, + /* 130 */ 43, 49, 43, 51, 31, 50, 49, 58, 51, 23, + /* 140 */ 1, 1, 20, 52, 53, 23, 43, 54, 55, 3, + /* 150 */ 4, 31, 49, 13, 51, 14, 54, 55, 15, 20, + /* 160 */ 46, 47, 23, 42, 43, 42, 43, 42, 43, 23, + /* 170 */ 16, 51, 48, 23, }; -#define YY_SHIFT_USE_DFLT (171) +#define YY_SHIFT_USE_DFLT (174) #define YY_SHIFT_COUNT (39) -#define YY_SHIFT_MIN (-21) +#define YY_SHIFT_MIN (-22) #define YY_SHIFT_MAX (154) static const short yy_shift_ofst[] = { - /* 0 */ 22, 0, 85, 85, 85, 85, 85, 85, 85, 85, - /* 10 */ 114, 64, 68, 68, 152, 149, 63, -21, -21, -21, - /* 20 */ -21, 63, -21, -21, -21, -21, 63, 129, 132, 134, - /* 30 */ 64, 152, 149, 63, 63, 126, 63, 153, 154, 147, + /* 0 */ 23, 0, 96, 96, 96, 96, 96, 96, 96, 96, + /* 10 */ 88, 65, 116, 116, 95, 140, 68, -22, -22, -22, + /* 20 */ -22, 68, -22, -22, -22, -22, 68, 122, 139, 146, + /* 30 */ 65, 95, 140, 68, 68, 143, 68, 141, 154, 150, }; #define YY_REDUCE_USE_DFLT (-1) #define YY_REDUCE_COUNT (37) #define YY_REDUCE_MIN (0) -#define YY_REDUCE_MAX (124) +#define YY_REDUCE_MAX (125) static const signed char yy_reduce_ofst[] = { - /* 0 */ 21, 44, 55, 58, 71, 74, 81, 84, 97, 98, - /* 10 */ 19, 11, 41, 56, 91, 113, 119, 105, 105, 105, - /* 20 */ 105, 122, 105, 105, 105, 105, 124, 35, 35, 48, - /* 30 */ 42, 50, 79, 78, 78, 95, 78, 121, + /* 0 */ 22, 45, 56, 59, 73, 78, 63, 82, 87, 103, + /* 10 */ 20, 11, 93, 102, 91, 114, 121, 120, 120, 120, + /* 20 */ 120, 123, 120, 120, 120, 120, 125, 16, 16, 43, + /* 30 */ 46, 75, 79, 89, 89, 85, 89, 124, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 279, 279, 266, 265, 225, 220, 234, 231, 223, 218, - /* 10 */ 191, 275, 279, 279, 268, 256, 267, 235, 233, 232, - /* 20 */ 230, 246, 224, 222, 219, 217, 228, 242, 240, 263, - /* 30 */ 244, 237, 214, 236, 210, 200, 227, 199, 202, 198, + /* 0 */ 282, 282, 269, 268, 228, 223, 237, 234, 226, 221, + /* 10 */ 193, 278, 282, 282, 271, 259, 270, 238, 236, 235, + /* 20 */ 233, 249, 227, 225, 222, 220, 231, 245, 243, 266, + /* 30 */ 247, 240, 217, 239, 213, 202, 230, 201, 204, 200, }; /********** End of lemon-generated parsing tables *****************************/ @@ -385,16 +385,16 @@ static const char *const yyTokenName[] = { "LINE_ATX_3", "LINE_ATX_4", "LINE_ATX_5", "LINE_ATX_6", "LINE_HR", "LINE_BLOCKQUOTE", "LINE_LIST_BULLETED", "LINE_LIST_ENUMERATED", "LINE_TABLE", "LINE_DEF_CITATION", "LINE_DEF_FOOTNOTE", "LINE_DEF_LINK", - "LINE_FENCE_BACKTICK", "LINE_FENCE_BACKTICK_START", "LINE_EMPTY", "LINE_META", - "error", "doc", "blocks", "block", - "para", "indented_code", "empty", "list_bulleted", - "list_enumerated", "blockquote", "table", "def_citation", - "def_footnote", "def_link", "html_block", "fenced_block", - "meta_block", "para_lines", "para_line", "code_line", - "indented_line", "quote_lines", "quote_line", "item_bulleted", - "cont_blocks", "item_enumerated", "cont_block", "html_block_lines", - "html_block_line", "fenced_lines", "fenced_line", "meta_lines", - "meta_line", + "LINE_FENCE_BACKTICK", "LINE_FENCE_BACKTICK_START", "LINE_TOC", "LINE_EMPTY", + "LINE_META", "error", "doc", "blocks", + "block", "para", "indented_code", "empty", + "list_bulleted", "list_enumerated", "blockquote", "table", + "def_citation", "def_footnote", "def_link", "html_block", + "fenced_block", "meta_block", "para_lines", "para_line", + "code_line", "indented_line", "quote_lines", "quote_line", + "item_bulleted", "cont_blocks", "item_enumerated", "cont_block", + "html_block_lines", "html_block_line", "fenced_lines", "fenced_line", + "meta_lines", "meta_line", }; #endif /* NDEBUG */ @@ -425,75 +425,76 @@ static const char *const yyRuleName[] = { /* 20 */ "block ::= html_block", /* 21 */ "block ::= fenced_block", /* 22 */ "block ::= meta_block", - /* 23 */ "para ::= LINE_PLAIN para_lines", - /* 24 */ "para_lines ::= para_lines para_line", - /* 25 */ "indented_code ::= indented_code code_line", - /* 26 */ "empty ::= empty LINE_EMPTY", - /* 27 */ "blockquote ::= LINE_BLOCKQUOTE quote_lines", - /* 28 */ "quote_lines ::= quote_lines quote_line", - /* 29 */ "list_bulleted ::= list_bulleted item_bulleted", - /* 30 */ "item_bulleted ::= LINE_LIST_BULLETED para_lines cont_blocks", - /* 31 */ "item_bulleted ::= LINE_LIST_BULLETED para_lines", - /* 32 */ "item_bulleted ::= LINE_LIST_BULLETED cont_blocks", - /* 33 */ "item_bulleted ::= LINE_LIST_BULLETED", - /* 34 */ "list_enumerated ::= list_enumerated item_enumerated", - /* 35 */ "item_enumerated ::= LINE_LIST_ENUMERATED para_lines cont_blocks", - /* 36 */ "item_enumerated ::= LINE_LIST_ENUMERATED para_lines", - /* 37 */ "item_enumerated ::= LINE_LIST_ENUMERATED cont_blocks", - /* 38 */ "item_enumerated ::= LINE_LIST_ENUMERATED", - /* 39 */ "cont_blocks ::= cont_blocks cont_block", - /* 40 */ "cont_block ::= empty indented_line para_lines", - /* 41 */ "cont_block ::= empty indented_line", - /* 42 */ "table ::= table LINE_TABLE", - /* 43 */ "def_citation ::= LINE_DEF_CITATION para_lines cont_blocks", - /* 44 */ "def_citation ::= LINE_DEF_CITATION para_lines", - /* 45 */ "def_citation ::= LINE_DEF_CITATION cont_blocks", - /* 46 */ "def_footnote ::= LINE_DEF_FOOTNOTE para_lines cont_blocks", - /* 47 */ "def_footnote ::= LINE_DEF_FOOTNOTE para_lines", - /* 48 */ "def_footnote ::= LINE_DEF_FOOTNOTE cont_blocks", - /* 49 */ "def_link ::= LINE_DEF_LINK para_lines", - /* 50 */ "html_block ::= LINE_HTML html_block_lines", - /* 51 */ "html_block_lines ::= html_block_lines html_block_line", - /* 52 */ "fenced_block ::= LINE_FENCE_BACKTICK fenced_lines LINE_FENCE_BACKTICK", - /* 53 */ "fenced_block ::= LINE_FENCE_BACKTICK fenced_lines", - /* 54 */ "fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines LINE_FENCE_BACKTICK", - /* 55 */ "fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines", - /* 56 */ "fenced_lines ::= fenced_lines fenced_line", - /* 57 */ "meta_block ::= LINE_META meta_lines", - /* 58 */ "meta_lines ::= meta_lines meta_line", - /* 59 */ "para ::= LINE_PLAIN", - /* 60 */ "para_lines ::= para_line", - /* 61 */ "para_line ::= LINE_CONTINUATION", - /* 62 */ "indented_code ::= LINE_INDENTED_TAB", - /* 63 */ "indented_code ::= LINE_INDENTED_SPACE", - /* 64 */ "code_line ::= indented_line", - /* 65 */ "code_line ::= LINE_EMPTY", - /* 66 */ "indented_line ::= LINE_INDENTED_TAB", - /* 67 */ "indented_line ::= LINE_INDENTED_SPACE", - /* 68 */ "empty ::= LINE_EMPTY", - /* 69 */ "blockquote ::= LINE_BLOCKQUOTE", - /* 70 */ "quote_lines ::= quote_line", - /* 71 */ "quote_line ::= LINE_BLOCKQUOTE", - /* 72 */ "quote_line ::= LINE_CONTINUATION", - /* 73 */ "list_bulleted ::= item_bulleted", - /* 74 */ "list_enumerated ::= item_enumerated", - /* 75 */ "cont_blocks ::= cont_block", - /* 76 */ "cont_block ::= empty", - /* 77 */ "table ::= LINE_TABLE", - /* 78 */ "def_citation ::= LINE_DEF_CITATION", - /* 79 */ "def_footnote ::= LINE_DEF_FOOTNOTE", - /* 80 */ "def_link ::= LINE_DEF_LINK", - /* 81 */ "html_block ::= LINE_HTML", - /* 82 */ "html_block_lines ::= html_block_line", - /* 83 */ "html_block_line ::= LINE_CONTINUATION", - /* 84 */ "html_block_line ::= LINE_HTML", - /* 85 */ "fenced_lines ::= fenced_line", - /* 86 */ "fenced_line ::= LINE_CONTINUATION", - /* 87 */ "fenced_line ::= LINE_EMPTY", - /* 88 */ "meta_block ::= LINE_META", - /* 89 */ "meta_lines ::= meta_line", - /* 90 */ "meta_line ::= LINE_META", - /* 91 */ "meta_line ::= LINE_CONTINUATION", + /* 23 */ "block ::= LINE_TOC", + /* 24 */ "para ::= LINE_PLAIN para_lines", + /* 25 */ "para_lines ::= para_lines para_line", + /* 26 */ "indented_code ::= indented_code code_line", + /* 27 */ "empty ::= empty LINE_EMPTY", + /* 28 */ "blockquote ::= LINE_BLOCKQUOTE quote_lines", + /* 29 */ "quote_lines ::= quote_lines quote_line", + /* 30 */ "list_bulleted ::= list_bulleted item_bulleted", + /* 31 */ "item_bulleted ::= LINE_LIST_BULLETED para_lines cont_blocks", + /* 32 */ "item_bulleted ::= LINE_LIST_BULLETED para_lines", + /* 33 */ "item_bulleted ::= LINE_LIST_BULLETED cont_blocks", + /* 34 */ "item_bulleted ::= LINE_LIST_BULLETED", + /* 35 */ "list_enumerated ::= list_enumerated item_enumerated", + /* 36 */ "item_enumerated ::= LINE_LIST_ENUMERATED para_lines cont_blocks", + /* 37 */ "item_enumerated ::= LINE_LIST_ENUMERATED para_lines", + /* 38 */ "item_enumerated ::= LINE_LIST_ENUMERATED cont_blocks", + /* 39 */ "item_enumerated ::= LINE_LIST_ENUMERATED", + /* 40 */ "cont_blocks ::= cont_blocks cont_block", + /* 41 */ "cont_block ::= empty indented_line para_lines", + /* 42 */ "cont_block ::= empty indented_line", + /* 43 */ "table ::= table LINE_TABLE", + /* 44 */ "def_citation ::= LINE_DEF_CITATION para_lines cont_blocks", + /* 45 */ "def_citation ::= LINE_DEF_CITATION para_lines", + /* 46 */ "def_citation ::= LINE_DEF_CITATION cont_blocks", + /* 47 */ "def_footnote ::= LINE_DEF_FOOTNOTE para_lines cont_blocks", + /* 48 */ "def_footnote ::= LINE_DEF_FOOTNOTE para_lines", + /* 49 */ "def_footnote ::= LINE_DEF_FOOTNOTE cont_blocks", + /* 50 */ "def_link ::= LINE_DEF_LINK para_lines", + /* 51 */ "html_block ::= LINE_HTML html_block_lines", + /* 52 */ "html_block_lines ::= html_block_lines html_block_line", + /* 53 */ "fenced_block ::= LINE_FENCE_BACKTICK fenced_lines LINE_FENCE_BACKTICK", + /* 54 */ "fenced_block ::= LINE_FENCE_BACKTICK fenced_lines", + /* 55 */ "fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines LINE_FENCE_BACKTICK", + /* 56 */ "fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines", + /* 57 */ "fenced_lines ::= fenced_lines fenced_line", + /* 58 */ "meta_block ::= LINE_META meta_lines", + /* 59 */ "meta_lines ::= meta_lines meta_line", + /* 60 */ "para ::= LINE_PLAIN", + /* 61 */ "para_lines ::= para_line", + /* 62 */ "para_line ::= LINE_CONTINUATION", + /* 63 */ "indented_code ::= LINE_INDENTED_TAB", + /* 64 */ "indented_code ::= LINE_INDENTED_SPACE", + /* 65 */ "code_line ::= indented_line", + /* 66 */ "code_line ::= LINE_EMPTY", + /* 67 */ "indented_line ::= LINE_INDENTED_TAB", + /* 68 */ "indented_line ::= LINE_INDENTED_SPACE", + /* 69 */ "empty ::= LINE_EMPTY", + /* 70 */ "blockquote ::= LINE_BLOCKQUOTE", + /* 71 */ "quote_lines ::= quote_line", + /* 72 */ "quote_line ::= LINE_BLOCKQUOTE", + /* 73 */ "quote_line ::= LINE_CONTINUATION", + /* 74 */ "list_bulleted ::= item_bulleted", + /* 75 */ "list_enumerated ::= item_enumerated", + /* 76 */ "cont_blocks ::= cont_block", + /* 77 */ "cont_block ::= empty", + /* 78 */ "table ::= LINE_TABLE", + /* 79 */ "def_citation ::= LINE_DEF_CITATION", + /* 80 */ "def_footnote ::= LINE_DEF_FOOTNOTE", + /* 81 */ "def_link ::= LINE_DEF_LINK", + /* 82 */ "html_block ::= LINE_HTML", + /* 83 */ "html_block_lines ::= html_block_line", + /* 84 */ "html_block_line ::= LINE_CONTINUATION", + /* 85 */ "html_block_line ::= LINE_HTML", + /* 86 */ "fenced_lines ::= fenced_line", + /* 87 */ "fenced_line ::= LINE_CONTINUATION", + /* 88 */ "fenced_line ::= LINE_EMPTY", + /* 89 */ "meta_block ::= LINE_META", + /* 90 */ "meta_lines ::= meta_line", + /* 91 */ "meta_line ::= LINE_META", + /* 92 */ "meta_line ::= LINE_CONTINUATION", }; #endif /* NDEBUG */ @@ -842,98 +843,99 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ unsigned char nrhs; /* Number of right-hand side symbols in the rule */ } yyRuleInfo[] = { - { 25, 1 }, - { 26, 2 }, { 26, 1 }, + { 27, 2 }, { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 27, 1 }, - { 28, 2 }, - { 41, 2 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, + { 28, 1 }, { 29, 2 }, + { 42, 2 }, { 30, 2 }, - { 33, 2 }, - { 45, 2 }, { 31, 2 }, - { 47, 3 }, - { 47, 2 }, - { 47, 2 }, - { 47, 1 }, + { 34, 2 }, + { 46, 2 }, { 32, 2 }, - { 49, 3 }, - { 49, 2 }, - { 49, 2 }, - { 49, 1 }, + { 48, 3 }, { 48, 2 }, + { 48, 2 }, + { 48, 1 }, + { 33, 2 }, { 50, 3 }, { 50, 2 }, - { 34, 2 }, - { 35, 3 }, - { 35, 2 }, + { 50, 2 }, + { 50, 1 }, + { 49, 2 }, + { 51, 3 }, + { 51, 2 }, { 35, 2 }, { 36, 3 }, { 36, 2 }, { 36, 2 }, + { 37, 3 }, + { 37, 2 }, { 37, 2 }, { 38, 2 }, - { 51, 2 }, - { 39, 3 }, - { 39, 2 }, - { 39, 3 }, { 39, 2 }, - { 53, 2 }, + { 52, 2 }, + { 40, 3 }, { 40, 2 }, - { 55, 2 }, - { 28, 1 }, - { 41, 1 }, - { 42, 1 }, - { 29, 1 }, + { 40, 3 }, + { 40, 2 }, + { 54, 2 }, + { 41, 2 }, + { 56, 2 }, { 29, 1 }, + { 42, 1 }, { 43, 1 }, - { 43, 1 }, + { 30, 1 }, + { 30, 1 }, { 44, 1 }, { 44, 1 }, - { 30, 1 }, - { 33, 1 }, { 45, 1 }, - { 46, 1 }, - { 46, 1 }, + { 45, 1 }, { 31, 1 }, - { 32, 1 }, - { 48, 1 }, - { 50, 1 }, { 34, 1 }, + { 46, 1 }, + { 47, 1 }, + { 47, 1 }, + { 32, 1 }, + { 33, 1 }, + { 49, 1 }, + { 51, 1 }, { 35, 1 }, { 36, 1 }, { 37, 1 }, { 38, 1 }, - { 51, 1 }, - { 52, 1 }, + { 39, 1 }, { 52, 1 }, { 53, 1 }, + { 53, 1 }, { 54, 1 }, - { 54, 1 }, - { 40, 1 }, { 55, 1 }, + { 55, 1 }, + { 41, 1 }, { 56, 1 }, - { 56, 1 }, + { 57, 1 }, + { 57, 1 }, }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -1102,106 +1104,110 @@ static void yy_reduce( { yylhsminor.yy0 = token_new_parent(yymsp[0].minor.yy0, BLOCK_META); } yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 23: /* para ::= LINE_PLAIN para_lines */ - case 24: /* para_lines ::= para_lines para_line */ yytestcase(yyruleno==24); - case 25: /* indented_code ::= indented_code code_line */ yytestcase(yyruleno==25); - case 26: /* empty ::= empty LINE_EMPTY */ yytestcase(yyruleno==26); - case 27: /* blockquote ::= LINE_BLOCKQUOTE quote_lines */ yytestcase(yyruleno==27); - case 28: /* quote_lines ::= quote_lines quote_line */ yytestcase(yyruleno==28); - case 29: /* list_bulleted ::= list_bulleted item_bulleted */ yytestcase(yyruleno==29); - case 34: /* list_enumerated ::= list_enumerated item_enumerated */ yytestcase(yyruleno==34); - case 39: /* cont_blocks ::= cont_blocks cont_block */ yytestcase(yyruleno==39); - case 42: /* table ::= table LINE_TABLE */ yytestcase(yyruleno==42); - case 44: /* def_citation ::= LINE_DEF_CITATION para_lines */ yytestcase(yyruleno==44); - case 45: /* def_citation ::= LINE_DEF_CITATION cont_blocks */ yytestcase(yyruleno==45); - case 47: /* def_footnote ::= LINE_DEF_FOOTNOTE para_lines */ yytestcase(yyruleno==47); - case 48: /* def_footnote ::= LINE_DEF_FOOTNOTE cont_blocks */ yytestcase(yyruleno==48); - case 49: /* def_link ::= LINE_DEF_LINK para_lines */ yytestcase(yyruleno==49); - case 50: /* html_block ::= LINE_HTML html_block_lines */ yytestcase(yyruleno==50); - case 51: /* html_block_lines ::= html_block_lines html_block_line */ yytestcase(yyruleno==51); - case 53: /* fenced_block ::= LINE_FENCE_BACKTICK fenced_lines */ yytestcase(yyruleno==53); - case 55: /* fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines */ yytestcase(yyruleno==55); - case 56: /* fenced_lines ::= fenced_lines fenced_line */ yytestcase(yyruleno==56); - case 57: /* meta_block ::= LINE_META meta_lines */ yytestcase(yyruleno==57); - case 58: /* meta_lines ::= meta_lines meta_line */ yytestcase(yyruleno==58); + case 23: /* block ::= LINE_TOC */ +{ yylhsminor.yy0 = token_new_parent(yymsp[0].minor.yy0, BLOCK_TOC); } + yymsp[0].minor.yy0 = yylhsminor.yy0; + break; + case 24: /* para ::= LINE_PLAIN para_lines */ + case 25: /* para_lines ::= para_lines para_line */ yytestcase(yyruleno==25); + case 26: /* indented_code ::= indented_code code_line */ yytestcase(yyruleno==26); + case 27: /* empty ::= empty LINE_EMPTY */ yytestcase(yyruleno==27); + case 28: /* blockquote ::= LINE_BLOCKQUOTE quote_lines */ yytestcase(yyruleno==28); + case 29: /* quote_lines ::= quote_lines quote_line */ yytestcase(yyruleno==29); + case 30: /* list_bulleted ::= list_bulleted item_bulleted */ yytestcase(yyruleno==30); + case 35: /* list_enumerated ::= list_enumerated item_enumerated */ yytestcase(yyruleno==35); + case 40: /* cont_blocks ::= cont_blocks cont_block */ yytestcase(yyruleno==40); + case 43: /* table ::= table LINE_TABLE */ yytestcase(yyruleno==43); + case 45: /* def_citation ::= LINE_DEF_CITATION para_lines */ yytestcase(yyruleno==45); + case 46: /* def_citation ::= LINE_DEF_CITATION cont_blocks */ yytestcase(yyruleno==46); + case 48: /* def_footnote ::= LINE_DEF_FOOTNOTE para_lines */ yytestcase(yyruleno==48); + case 49: /* def_footnote ::= LINE_DEF_FOOTNOTE cont_blocks */ yytestcase(yyruleno==49); + case 50: /* def_link ::= LINE_DEF_LINK para_lines */ yytestcase(yyruleno==50); + case 51: /* html_block ::= LINE_HTML html_block_lines */ yytestcase(yyruleno==51); + case 52: /* html_block_lines ::= html_block_lines html_block_line */ yytestcase(yyruleno==52); + case 54: /* fenced_block ::= LINE_FENCE_BACKTICK fenced_lines */ yytestcase(yyruleno==54); + case 56: /* fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines */ yytestcase(yyruleno==56); + case 57: /* fenced_lines ::= fenced_lines fenced_line */ yytestcase(yyruleno==57); + case 58: /* meta_block ::= LINE_META meta_lines */ yytestcase(yyruleno==58); + case 59: /* meta_lines ::= meta_lines meta_line */ yytestcase(yyruleno==59); { yylhsminor.yy0 = yymsp[-1].minor.yy0; token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); } yymsp[-1].minor.yy0 = yylhsminor.yy0; break; - case 30: /* item_bulleted ::= LINE_LIST_BULLETED para_lines cont_blocks */ - case 35: /* item_enumerated ::= LINE_LIST_ENUMERATED para_lines cont_blocks */ yytestcase(yyruleno==35); + case 31: /* item_bulleted ::= LINE_LIST_BULLETED para_lines cont_blocks */ + case 36: /* item_enumerated ::= LINE_LIST_ENUMERATED para_lines cont_blocks */ yytestcase(yyruleno==36); { token_chain_append(yymsp[-2].minor.yy0, yymsp[-1].minor.yy0); token_chain_append(yymsp[-2].minor.yy0, yymsp[0].minor.yy0); yylhsminor.yy0 = token_new_parent(yymsp[-2].minor.yy0, BLOCK_LIST_ITEM); recursive_parse_list_item(engine, yylhsminor.yy0); } yymsp[-2].minor.yy0 = yylhsminor.yy0; break; - case 31: /* item_bulleted ::= LINE_LIST_BULLETED para_lines */ - case 36: /* item_enumerated ::= LINE_LIST_ENUMERATED para_lines */ yytestcase(yyruleno==36); + case 32: /* item_bulleted ::= LINE_LIST_BULLETED para_lines */ + case 37: /* item_enumerated ::= LINE_LIST_ENUMERATED para_lines */ yytestcase(yyruleno==37); { token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); yylhsminor.yy0 = token_new_parent(yymsp[-1].minor.yy0, BLOCK_LIST_ITEM_TIGHT); recursive_parse_list_item(engine, yylhsminor.yy0); } yymsp[-1].minor.yy0 = yylhsminor.yy0; break; - case 32: /* item_bulleted ::= LINE_LIST_BULLETED cont_blocks */ + case 33: /* item_bulleted ::= LINE_LIST_BULLETED cont_blocks */ { token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); yylhsminor.yy0 = token_new_parent(yymsp[-1].minor.yy0, BLOCK_LIST_ITEM); if (yymsp[0].minor.yy0) {recursive_parse_list_item(engine, yylhsminor.yy0);} } yymsp[-1].minor.yy0 = yylhsminor.yy0; break; - case 33: /* item_bulleted ::= LINE_LIST_BULLETED */ - case 38: /* item_enumerated ::= LINE_LIST_ENUMERATED */ yytestcase(yyruleno==38); + case 34: /* item_bulleted ::= LINE_LIST_BULLETED */ + case 39: /* item_enumerated ::= LINE_LIST_ENUMERATED */ yytestcase(yyruleno==39); { yylhsminor.yy0 = token_new_parent(yymsp[0].minor.yy0, BLOCK_LIST_ITEM_TIGHT); } yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 37: /* item_enumerated ::= LINE_LIST_ENUMERATED cont_blocks */ + case 38: /* item_enumerated ::= LINE_LIST_ENUMERATED cont_blocks */ { token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); yylhsminor.yy0 = token_new_parent(yymsp[-1].minor.yy0, BLOCK_LIST_ITEM); recursive_parse_list_item(engine, yylhsminor.yy0); } yymsp[-1].minor.yy0 = yylhsminor.yy0; break; - case 40: /* cont_block ::= empty indented_line para_lines */ + case 41: /* cont_block ::= empty indented_line para_lines */ { yylhsminor.yy0 = yymsp[-2].minor.yy0; token_chain_append(yymsp[-2].minor.yy0, yymsp[-1].minor.yy0); token_chain_append(yymsp[-2].minor.yy0, yymsp[0].minor.yy0); yymsp[-1].minor.yy0->type = LINE_CONTINUATION; } yymsp[-2].minor.yy0 = yylhsminor.yy0; break; - case 41: /* cont_block ::= empty indented_line */ + case 42: /* cont_block ::= empty indented_line */ { yylhsminor.yy0 = yymsp[-1].minor.yy0; token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); yymsp[0].minor.yy0->type = LINE_CONTINUATION; } yymsp[-1].minor.yy0 = yylhsminor.yy0; break; - case 43: /* def_citation ::= LINE_DEF_CITATION para_lines cont_blocks */ - case 46: /* def_footnote ::= LINE_DEF_FOOTNOTE para_lines cont_blocks */ yytestcase(yyruleno==46); + case 44: /* def_citation ::= LINE_DEF_CITATION para_lines cont_blocks */ + case 47: /* def_footnote ::= LINE_DEF_FOOTNOTE para_lines cont_blocks */ yytestcase(yyruleno==47); { yylhsminor.yy0 = yymsp[-2].minor.yy0; token_chain_append(yymsp[-2].minor.yy0, yymsp[-1].minor.yy0); token_chain_append(yymsp[-2].minor.yy0, yymsp[0].minor.yy0); } yymsp[-2].minor.yy0 = yylhsminor.yy0; break; - case 52: /* fenced_block ::= LINE_FENCE_BACKTICK fenced_lines LINE_FENCE_BACKTICK */ - case 54: /* fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines LINE_FENCE_BACKTICK */ yytestcase(yyruleno==54); + case 53: /* fenced_block ::= LINE_FENCE_BACKTICK fenced_lines LINE_FENCE_BACKTICK */ + case 55: /* fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines LINE_FENCE_BACKTICK */ yytestcase(yyruleno==55); { yylhsminor.yy0 = yymsp[-2].minor.yy0; token_chain_append(yymsp[-2].minor.yy0, yymsp[-1].minor.yy0); token_chain_append(yymsp[-2].minor.yy0, yymsp[0].minor.yy0); yymsp[0].minor.yy0->child->type = CODE_FENCE; } yymsp[-2].minor.yy0 = yylhsminor.yy0; break; default: - /* (59) para ::= LINE_PLAIN */ yytestcase(yyruleno==59); - /* (60) para_lines ::= para_line (OPTIMIZED OUT) */ assert(yyruleno!=60); - /* (61) para_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==61); - /* (62) indented_code ::= LINE_INDENTED_TAB */ yytestcase(yyruleno==62); - /* (63) indented_code ::= LINE_INDENTED_SPACE */ yytestcase(yyruleno==63); - /* (64) code_line ::= indented_line (OPTIMIZED OUT) */ assert(yyruleno!=64); - /* (65) code_line ::= LINE_EMPTY */ yytestcase(yyruleno==65); - /* (66) indented_line ::= LINE_INDENTED_TAB */ yytestcase(yyruleno==66); - /* (67) indented_line ::= LINE_INDENTED_SPACE */ yytestcase(yyruleno==67); - /* (68) empty ::= LINE_EMPTY */ yytestcase(yyruleno==68); - /* (69) blockquote ::= LINE_BLOCKQUOTE */ yytestcase(yyruleno==69); - /* (70) quote_lines ::= quote_line (OPTIMIZED OUT) */ assert(yyruleno!=70); - /* (71) quote_line ::= LINE_BLOCKQUOTE */ yytestcase(yyruleno==71); - /* (72) quote_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==72); - /* (73) list_bulleted ::= item_bulleted (OPTIMIZED OUT) */ assert(yyruleno!=73); - /* (74) list_enumerated ::= item_enumerated (OPTIMIZED OUT) */ assert(yyruleno!=74); - /* (75) cont_blocks ::= cont_block (OPTIMIZED OUT) */ assert(yyruleno!=75); - /* (76) cont_block ::= empty */ yytestcase(yyruleno==76); - /* (77) table ::= LINE_TABLE */ yytestcase(yyruleno==77); - /* (78) def_citation ::= LINE_DEF_CITATION */ yytestcase(yyruleno==78); - /* (79) def_footnote ::= LINE_DEF_FOOTNOTE */ yytestcase(yyruleno==79); - /* (80) def_link ::= LINE_DEF_LINK */ yytestcase(yyruleno==80); - /* (81) html_block ::= LINE_HTML */ yytestcase(yyruleno==81); - /* (82) html_block_lines ::= html_block_line (OPTIMIZED OUT) */ assert(yyruleno!=82); - /* (83) html_block_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==83); - /* (84) html_block_line ::= LINE_HTML */ yytestcase(yyruleno==84); - /* (85) fenced_lines ::= fenced_line (OPTIMIZED OUT) */ assert(yyruleno!=85); - /* (86) fenced_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==86); - /* (87) fenced_line ::= LINE_EMPTY */ yytestcase(yyruleno==87); - /* (88) meta_block ::= LINE_META */ yytestcase(yyruleno==88); - /* (89) meta_lines ::= meta_line (OPTIMIZED OUT) */ assert(yyruleno!=89); - /* (90) meta_line ::= LINE_META */ yytestcase(yyruleno==90); - /* (91) meta_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==91); + /* (60) para ::= LINE_PLAIN */ yytestcase(yyruleno==60); + /* (61) para_lines ::= para_line (OPTIMIZED OUT) */ assert(yyruleno!=61); + /* (62) para_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==62); + /* (63) indented_code ::= LINE_INDENTED_TAB */ yytestcase(yyruleno==63); + /* (64) indented_code ::= LINE_INDENTED_SPACE */ yytestcase(yyruleno==64); + /* (65) code_line ::= indented_line (OPTIMIZED OUT) */ assert(yyruleno!=65); + /* (66) code_line ::= LINE_EMPTY */ yytestcase(yyruleno==66); + /* (67) indented_line ::= LINE_INDENTED_TAB */ yytestcase(yyruleno==67); + /* (68) indented_line ::= LINE_INDENTED_SPACE */ yytestcase(yyruleno==68); + /* (69) empty ::= LINE_EMPTY */ yytestcase(yyruleno==69); + /* (70) blockquote ::= LINE_BLOCKQUOTE */ yytestcase(yyruleno==70); + /* (71) quote_lines ::= quote_line (OPTIMIZED OUT) */ assert(yyruleno!=71); + /* (72) quote_line ::= LINE_BLOCKQUOTE */ yytestcase(yyruleno==72); + /* (73) quote_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==73); + /* (74) list_bulleted ::= item_bulleted (OPTIMIZED OUT) */ assert(yyruleno!=74); + /* (75) list_enumerated ::= item_enumerated (OPTIMIZED OUT) */ assert(yyruleno!=75); + /* (76) cont_blocks ::= cont_block (OPTIMIZED OUT) */ assert(yyruleno!=76); + /* (77) cont_block ::= empty */ yytestcase(yyruleno==77); + /* (78) table ::= LINE_TABLE */ yytestcase(yyruleno==78); + /* (79) def_citation ::= LINE_DEF_CITATION */ yytestcase(yyruleno==79); + /* (80) def_footnote ::= LINE_DEF_FOOTNOTE */ yytestcase(yyruleno==80); + /* (81) def_link ::= LINE_DEF_LINK */ yytestcase(yyruleno==81); + /* (82) html_block ::= LINE_HTML */ yytestcase(yyruleno==82); + /* (83) html_block_lines ::= html_block_line (OPTIMIZED OUT) */ assert(yyruleno!=83); + /* (84) html_block_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==84); + /* (85) html_block_line ::= LINE_HTML */ yytestcase(yyruleno==85); + /* (86) fenced_lines ::= fenced_line (OPTIMIZED OUT) */ assert(yyruleno!=86); + /* (87) fenced_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==87); + /* (88) fenced_line ::= LINE_EMPTY */ yytestcase(yyruleno==88); + /* (89) meta_block ::= LINE_META */ yytestcase(yyruleno==89); + /* (90) meta_lines ::= meta_line (OPTIMIZED OUT) */ assert(yyruleno!=90); + /* (91) meta_line ::= LINE_META */ yytestcase(yyruleno==91); + /* (92) meta_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==92); break; /********** End reduce actions ************************************************/ }; diff --git a/src/parser.h b/src/parser.h index 292b4a9..e4493c1 100644 --- a/src/parser.h +++ b/src/parser.h @@ -19,5 +19,6 @@ #define LINE_DEF_LINK 19 #define LINE_FENCE_BACKTICK 20 #define LINE_FENCE_BACKTICK_START 21 -#define LINE_EMPTY 22 -#define LINE_META 23 +#define LINE_TOC 22 +#define LINE_EMPTY 23 +#define LINE_META 24 diff --git a/src/parser.out b/src/parser.out index e5ffaae..41bccb8 100644 --- a/src/parser.out +++ b/src/parser.out @@ -22,6 +22,7 @@ State 0: block ::= * html_block block ::= * fenced_block block ::= * meta_block + block ::= * LINE_TOC para ::= * LINE_PLAIN para_lines para ::= * LINE_PLAIN indented_code ::= * indented_code code_line @@ -65,8 +66,8 @@ State 0: meta_block ::= * LINE_META LINE_PLAIN shift 21 - LINE_INDENTED_TAB shift-reduce 62 indented_code ::= LINE_INDENTED_TAB - LINE_INDENTED_SPACE shift-reduce 63 indented_code ::= LINE_INDENTED_SPACE + LINE_INDENTED_TAB shift-reduce 63 indented_code ::= LINE_INDENTED_TAB + LINE_INDENTED_SPACE shift-reduce 64 indented_code ::= LINE_INDENTED_SPACE LINE_HTML shift 14 LINE_ATX_1 shift-reduce 5 block ::= LINE_ATX_1 LINE_ATX_2 shift-reduce 6 block ::= LINE_ATX_2 @@ -78,13 +79,14 @@ State 0: LINE_BLOCKQUOTE shift 15 LINE_LIST_BULLETED shift 5 LINE_LIST_ENUMERATED shift 4 - LINE_TABLE shift-reduce 77 table ::= LINE_TABLE + LINE_TABLE shift-reduce 78 table ::= LINE_TABLE LINE_DEF_CITATION shift 3 LINE_DEF_FOOTNOTE shift 2 LINE_DEF_LINK shift 16 LINE_FENCE_BACKTICK shift 13 LINE_FENCE_BACKTICK_START shift 12 - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY + LINE_TOC shift-reduce 23 block ::= LINE_TOC + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY LINE_META shift 11 doc accept blocks shift 1 @@ -128,6 +130,7 @@ State 1: block ::= * html_block block ::= * fenced_block block ::= * meta_block + block ::= * LINE_TOC para ::= * LINE_PLAIN para_lines para ::= * LINE_PLAIN indented_code ::= * indented_code code_line @@ -172,8 +175,8 @@ State 1: $ reduce 0 doc ::= blocks LINE_PLAIN shift 21 - LINE_INDENTED_TAB shift-reduce 62 indented_code ::= LINE_INDENTED_TAB - LINE_INDENTED_SPACE shift-reduce 63 indented_code ::= LINE_INDENTED_SPACE + LINE_INDENTED_TAB shift-reduce 63 indented_code ::= LINE_INDENTED_TAB + LINE_INDENTED_SPACE shift-reduce 64 indented_code ::= LINE_INDENTED_SPACE LINE_HTML shift 14 LINE_ATX_1 shift-reduce 5 block ::= LINE_ATX_1 LINE_ATX_2 shift-reduce 6 block ::= LINE_ATX_2 @@ -185,13 +188,14 @@ State 1: LINE_BLOCKQUOTE shift 15 LINE_LIST_BULLETED shift 5 LINE_LIST_ENUMERATED shift 4 - LINE_TABLE shift-reduce 77 table ::= LINE_TABLE + LINE_TABLE shift-reduce 78 table ::= LINE_TABLE LINE_DEF_CITATION shift 3 LINE_DEF_FOOTNOTE shift 2 LINE_DEF_LINK shift 16 LINE_FENCE_BACKTICK shift 13 LINE_FENCE_BACKTICK_START shift 12 - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY + LINE_TOC shift-reduce 23 block ::= LINE_TOC + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY LINE_META shift 11 block shift-reduce 1 blocks ::= blocks block para shift-reduce 3 block ::= para @@ -224,17 +228,17 @@ State 2: def_footnote ::= LINE_DEF_FOOTNOTE * para_lines cont_blocks def_footnote ::= LINE_DEF_FOOTNOTE * para_lines def_footnote ::= LINE_DEF_FOOTNOTE * cont_blocks - (79) def_footnote ::= LINE_DEF_FOOTNOTE * + (80) def_footnote ::= LINE_DEF_FOOTNOTE * - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 79 ** Parsing conflict ** + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 80 ** Parsing conflict ** empty shift 29 para_lines shift 6 para_line shift 6 /* because para_line==para_lines */ cont_blocks shift 17 cont_block shift 17 /* because cont_block==cont_blocks */ - {default} reduce 79 def_footnote ::= LINE_DEF_FOOTNOTE + {default} reduce 80 def_footnote ::= LINE_DEF_FOOTNOTE State 3: para_lines ::= * para_lines para_line @@ -250,17 +254,17 @@ State 3: def_citation ::= LINE_DEF_CITATION * para_lines cont_blocks def_citation ::= LINE_DEF_CITATION * para_lines def_citation ::= LINE_DEF_CITATION * cont_blocks - (78) def_citation ::= LINE_DEF_CITATION * + (79) def_citation ::= LINE_DEF_CITATION * - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 78 ** Parsing conflict ** + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 79 ** Parsing conflict ** empty shift 29 para_lines shift 7 para_line shift 7 /* because para_line==para_lines */ cont_blocks shift 19 cont_block shift 19 /* because cont_block==cont_blocks */ - {default} reduce 78 def_citation ::= LINE_DEF_CITATION + {default} reduce 79 def_citation ::= LINE_DEF_CITATION State 4: para_lines ::= * para_lines para_line @@ -271,22 +275,22 @@ State 4: item_enumerated ::= LINE_LIST_ENUMERATED * para_lines cont_blocks item_enumerated ::= LINE_LIST_ENUMERATED * para_lines item_enumerated ::= LINE_LIST_ENUMERATED * cont_blocks - (38) item_enumerated ::= LINE_LIST_ENUMERATED * + (39) item_enumerated ::= LINE_LIST_ENUMERATED * cont_blocks ::= * cont_blocks cont_block cont_blocks ::= * cont_block cont_block ::= * empty indented_line para_lines cont_block ::= * empty indented_line cont_block ::= * empty - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 38 ** Parsing conflict ** + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 39 ** Parsing conflict ** empty shift 29 para_lines shift 8 para_line shift 8 /* because para_line==para_lines */ cont_blocks shift 22 cont_block shift 22 /* because cont_block==cont_blocks */ - {default} reduce 38 item_enumerated ::= LINE_LIST_ENUMERATED + {default} reduce 39 item_enumerated ::= LINE_LIST_ENUMERATED State 5: para_lines ::= * para_lines para_line @@ -297,22 +301,22 @@ State 5: item_bulleted ::= LINE_LIST_BULLETED * para_lines cont_blocks item_bulleted ::= LINE_LIST_BULLETED * para_lines item_bulleted ::= LINE_LIST_BULLETED * cont_blocks - (33) item_bulleted ::= LINE_LIST_BULLETED * + (34) item_bulleted ::= LINE_LIST_BULLETED * cont_blocks ::= * cont_blocks cont_block cont_blocks ::= * cont_block cont_block ::= * empty indented_line para_lines cont_block ::= * empty indented_line cont_block ::= * empty - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 33 ** Parsing conflict ** + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 34 ** Parsing conflict ** empty shift 29 para_lines shift 9 para_line shift 9 /* because para_line==para_lines */ cont_blocks shift 24 cont_block shift 24 /* because cont_block==cont_blocks */ - {default} reduce 33 item_bulleted ::= LINE_LIST_BULLETED + {default} reduce 34 item_bulleted ::= LINE_LIST_BULLETED State 6: para_lines ::= para_lines * para_line @@ -325,16 +329,16 @@ State 6: cont_block ::= * empty indented_line cont_block ::= * empty def_footnote ::= LINE_DEF_FOOTNOTE para_lines * cont_blocks - (47) def_footnote ::= LINE_DEF_FOOTNOTE para_lines * + (48) def_footnote ::= LINE_DEF_FOOTNOTE para_lines * - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 47 ** Parsing conflict ** + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 48 ** Parsing conflict ** empty shift 29 - para_line shift-reduce 24 para_lines ::= para_lines para_line + para_line shift-reduce 25 para_lines ::= para_lines para_line cont_blocks shift 18 cont_block shift 18 /* because cont_block==cont_blocks */ - {default} reduce 47 def_footnote ::= LINE_DEF_FOOTNOTE para_lines + {default} reduce 48 def_footnote ::= LINE_DEF_FOOTNOTE para_lines State 7: para_lines ::= para_lines * para_line @@ -347,16 +351,16 @@ State 7: cont_block ::= * empty indented_line cont_block ::= * empty def_citation ::= LINE_DEF_CITATION para_lines * cont_blocks - (44) def_citation ::= LINE_DEF_CITATION para_lines * + (45) def_citation ::= LINE_DEF_CITATION para_lines * - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 44 ** Parsing conflict ** + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 45 ** Parsing conflict ** empty shift 29 - para_line shift-reduce 24 para_lines ::= para_lines para_line + para_line shift-reduce 25 para_lines ::= para_lines para_line cont_blocks shift 20 cont_block shift 20 /* because cont_block==cont_blocks */ - {default} reduce 44 def_citation ::= LINE_DEF_CITATION para_lines + {default} reduce 45 def_citation ::= LINE_DEF_CITATION para_lines State 8: para_lines ::= para_lines * para_line @@ -364,21 +368,21 @@ State 8: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY item_enumerated ::= LINE_LIST_ENUMERATED para_lines * cont_blocks - (36) item_enumerated ::= LINE_LIST_ENUMERATED para_lines * + (37) item_enumerated ::= LINE_LIST_ENUMERATED para_lines * cont_blocks ::= * cont_blocks cont_block cont_blocks ::= * cont_block cont_block ::= * empty indented_line para_lines cont_block ::= * empty indented_line cont_block ::= * empty - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 36 ** Parsing conflict ** + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 37 ** Parsing conflict ** empty shift 29 - para_line shift-reduce 24 para_lines ::= para_lines para_line + para_line shift-reduce 25 para_lines ::= para_lines para_line cont_blocks shift 23 cont_block shift 23 /* because cont_block==cont_blocks */ - {default} reduce 36 item_enumerated ::= LINE_LIST_ENUMERATED para_lines + {default} reduce 37 item_enumerated ::= LINE_LIST_ENUMERATED para_lines State 9: para_lines ::= para_lines * para_line @@ -386,21 +390,21 @@ State 9: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY item_bulleted ::= LINE_LIST_BULLETED para_lines * cont_blocks - (31) item_bulleted ::= LINE_LIST_BULLETED para_lines * + (32) item_bulleted ::= LINE_LIST_BULLETED para_lines * cont_blocks ::= * cont_blocks cont_block cont_blocks ::= * cont_block cont_block ::= * empty indented_line para_lines cont_block ::= * empty indented_line cont_block ::= * empty - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 31 ** Parsing conflict ** + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 32 ** Parsing conflict ** empty shift 29 - para_line shift-reduce 24 para_lines ::= para_lines para_line + para_line shift-reduce 25 para_lines ::= para_lines para_line cont_blocks shift 25 cont_block shift 25 /* because cont_block==cont_blocks */ - {default} reduce 31 item_bulleted ::= LINE_LIST_BULLETED para_lines + {default} reduce 32 item_bulleted ::= LINE_LIST_BULLETED para_lines State 10: (4) block ::= indented_code * @@ -410,30 +414,30 @@ State 10: indented_line ::= * LINE_INDENTED_TAB indented_line ::= * LINE_INDENTED_SPACE - LINE_INDENTED_TAB shift-reduce 66 indented_line ::= LINE_INDENTED_TAB + LINE_INDENTED_TAB shift-reduce 67 indented_line ::= LINE_INDENTED_TAB LINE_INDENTED_TAB reduce 4 ** Parsing conflict ** - LINE_INDENTED_SPACE shift-reduce 67 indented_line ::= LINE_INDENTED_SPACE + LINE_INDENTED_SPACE shift-reduce 68 indented_line ::= LINE_INDENTED_SPACE LINE_INDENTED_SPACE reduce 4 ** Parsing conflict ** - LINE_EMPTY shift-reduce 65 code_line ::= LINE_EMPTY + LINE_EMPTY shift-reduce 66 code_line ::= LINE_EMPTY LINE_EMPTY reduce 4 ** Parsing conflict ** - code_line shift-reduce 25 indented_code ::= indented_code code_line - indented_line shift-reduce 25 indented_code ::= indented_code code_line /* because indented_line==code_line */ + code_line shift-reduce 26 indented_code ::= indented_code code_line + indented_line shift-reduce 26 indented_code ::= indented_code code_line /* because indented_line==code_line */ {default} reduce 4 block ::= indented_code State 11: meta_block ::= LINE_META * meta_lines - (88) meta_block ::= LINE_META * + (89) meta_block ::= LINE_META * meta_lines ::= * meta_lines meta_line meta_lines ::= * meta_line meta_line ::= * LINE_META meta_line ::= * LINE_CONTINUATION - LINE_CONTINUATION shift-reduce 91 meta_line ::= LINE_CONTINUATION - LINE_META shift-reduce 90 meta_line ::= LINE_META - LINE_META reduce 88 ** Parsing conflict ** + LINE_CONTINUATION shift-reduce 92 meta_line ::= LINE_CONTINUATION + LINE_META shift-reduce 91 meta_line ::= LINE_META + LINE_META reduce 89 ** Parsing conflict ** meta_lines shift 30 meta_line shift 30 /* because meta_line==meta_lines */ - {default} reduce 88 meta_block ::= LINE_META + {default} reduce 89 meta_block ::= LINE_META State 12: fenced_block ::= LINE_FENCE_BACKTICK_START * fenced_lines LINE_FENCE_BACKTICK @@ -443,8 +447,8 @@ State 12: fenced_line ::= * LINE_CONTINUATION fenced_line ::= * LINE_EMPTY - LINE_CONTINUATION shift-reduce 86 fenced_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 87 fenced_line ::= LINE_EMPTY + LINE_CONTINUATION shift-reduce 87 fenced_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 88 fenced_line ::= LINE_EMPTY fenced_lines shift 27 fenced_line shift 27 /* because fenced_line==fenced_lines */ @@ -456,52 +460,52 @@ State 13: fenced_line ::= * LINE_CONTINUATION fenced_line ::= * LINE_EMPTY - LINE_CONTINUATION shift-reduce 86 fenced_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 87 fenced_line ::= LINE_EMPTY + LINE_CONTINUATION shift-reduce 87 fenced_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 88 fenced_line ::= LINE_EMPTY fenced_lines shift 28 fenced_line shift 28 /* because fenced_line==fenced_lines */ State 14: html_block ::= LINE_HTML * html_block_lines - (81) html_block ::= LINE_HTML * + (82) html_block ::= LINE_HTML * html_block_lines ::= * html_block_lines html_block_line html_block_lines ::= * html_block_line html_block_line ::= * LINE_CONTINUATION html_block_line ::= * LINE_HTML - LINE_CONTINUATION shift-reduce 83 html_block_line ::= LINE_CONTINUATION - LINE_HTML shift-reduce 84 html_block_line ::= LINE_HTML - LINE_HTML reduce 81 ** Parsing conflict ** + LINE_CONTINUATION shift-reduce 84 html_block_line ::= LINE_CONTINUATION + LINE_HTML shift-reduce 85 html_block_line ::= LINE_HTML + LINE_HTML reduce 82 ** Parsing conflict ** html_block_lines shift 31 html_block_line shift 31 /* because html_block_line==html_block_lines */ - {default} reduce 81 html_block ::= LINE_HTML + {default} reduce 82 html_block ::= LINE_HTML State 15: blockquote ::= LINE_BLOCKQUOTE * quote_lines - (69) blockquote ::= LINE_BLOCKQUOTE * + (70) blockquote ::= LINE_BLOCKQUOTE * quote_lines ::= * quote_lines quote_line quote_lines ::= * quote_line quote_line ::= * LINE_BLOCKQUOTE quote_line ::= * LINE_CONTINUATION - LINE_CONTINUATION shift-reduce 72 quote_line ::= LINE_CONTINUATION - LINE_BLOCKQUOTE shift-reduce 71 quote_line ::= LINE_BLOCKQUOTE - LINE_BLOCKQUOTE reduce 69 ** Parsing conflict ** + LINE_CONTINUATION shift-reduce 73 quote_line ::= LINE_CONTINUATION + LINE_BLOCKQUOTE shift-reduce 72 quote_line ::= LINE_BLOCKQUOTE + LINE_BLOCKQUOTE reduce 70 ** Parsing conflict ** quote_lines shift 32 quote_line shift 32 /* because quote_line==quote_lines */ - {default} reduce 69 blockquote ::= LINE_BLOCKQUOTE + {default} reduce 70 blockquote ::= LINE_BLOCKQUOTE State 16: para_lines ::= * para_lines para_line para_lines ::= * para_line para_line ::= * LINE_CONTINUATION def_link ::= LINE_DEF_LINK * para_lines - (80) def_link ::= LINE_DEF_LINK * + (81) def_link ::= LINE_DEF_LINK * - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION para_lines shift 33 para_line shift 33 /* because para_line==para_lines */ - {default} reduce 80 def_link ::= LINE_DEF_LINK + {default} reduce 81 def_link ::= LINE_DEF_LINK State 17: empty ::= * empty LINE_EMPTY @@ -510,13 +514,13 @@ State 17: cont_block ::= * empty indented_line para_lines cont_block ::= * empty indented_line cont_block ::= * empty - (48) def_footnote ::= LINE_DEF_FOOTNOTE cont_blocks * + (49) def_footnote ::= LINE_DEF_FOOTNOTE cont_blocks * - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 48 ** Parsing conflict ** + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 49 ** Parsing conflict ** empty shift 29 - cont_block shift-reduce 39 cont_blocks ::= cont_blocks cont_block - {default} reduce 48 def_footnote ::= LINE_DEF_FOOTNOTE cont_blocks + cont_block shift-reduce 40 cont_blocks ::= cont_blocks cont_block + {default} reduce 49 def_footnote ::= LINE_DEF_FOOTNOTE cont_blocks State 18: empty ::= * empty LINE_EMPTY @@ -525,13 +529,13 @@ State 18: cont_block ::= * empty indented_line para_lines cont_block ::= * empty indented_line cont_block ::= * empty - (46) def_footnote ::= LINE_DEF_FOOTNOTE para_lines cont_blocks * + (47) def_footnote ::= LINE_DEF_FOOTNOTE para_lines cont_blocks * - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 46 ** Parsing conflict ** + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 47 ** Parsing conflict ** empty shift 29 - cont_block shift-reduce 39 cont_blocks ::= cont_blocks cont_block - {default} reduce 46 def_footnote ::= LINE_DEF_FOOTNOTE para_lines cont_blocks + cont_block shift-reduce 40 cont_blocks ::= cont_blocks cont_block + {default} reduce 47 def_footnote ::= LINE_DEF_FOOTNOTE para_lines cont_blocks State 19: empty ::= * empty LINE_EMPTY @@ -540,13 +544,13 @@ State 19: cont_block ::= * empty indented_line para_lines cont_block ::= * empty indented_line cont_block ::= * empty - (45) def_citation ::= LINE_DEF_CITATION cont_blocks * + (46) def_citation ::= LINE_DEF_CITATION cont_blocks * - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 45 ** Parsing conflict ** + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 46 ** Parsing conflict ** empty shift 29 - cont_block shift-reduce 39 cont_blocks ::= cont_blocks cont_block - {default} reduce 45 def_citation ::= LINE_DEF_CITATION cont_blocks + cont_block shift-reduce 40 cont_blocks ::= cont_blocks cont_block + {default} reduce 46 def_citation ::= LINE_DEF_CITATION cont_blocks State 20: empty ::= * empty LINE_EMPTY @@ -555,127 +559,127 @@ State 20: cont_block ::= * empty indented_line para_lines cont_block ::= * empty indented_line cont_block ::= * empty - (43) def_citation ::= LINE_DEF_CITATION para_lines cont_blocks * + (44) def_citation ::= LINE_DEF_CITATION para_lines cont_blocks * - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 43 ** Parsing conflict ** + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 44 ** Parsing conflict ** empty shift 29 - cont_block shift-reduce 39 cont_blocks ::= cont_blocks cont_block - {default} reduce 43 def_citation ::= LINE_DEF_CITATION para_lines cont_blocks + cont_block shift-reduce 40 cont_blocks ::= cont_blocks cont_block + {default} reduce 44 def_citation ::= LINE_DEF_CITATION para_lines cont_blocks State 21: para ::= LINE_PLAIN * para_lines - (59) para ::= LINE_PLAIN * + (60) para ::= LINE_PLAIN * para_lines ::= * para_lines para_line para_lines ::= * para_line para_line ::= * LINE_CONTINUATION - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION para_lines shift 34 para_line shift 34 /* because para_line==para_lines */ - {default} reduce 59 para ::= LINE_PLAIN + {default} reduce 60 para ::= LINE_PLAIN State 22: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY - (37) item_enumerated ::= LINE_LIST_ENUMERATED cont_blocks * + (38) item_enumerated ::= LINE_LIST_ENUMERATED cont_blocks * cont_blocks ::= cont_blocks * cont_block cont_block ::= * empty indented_line para_lines cont_block ::= * empty indented_line cont_block ::= * empty - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 37 ** Parsing conflict ** + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 38 ** Parsing conflict ** empty shift 29 - cont_block shift-reduce 39 cont_blocks ::= cont_blocks cont_block - {default} reduce 37 item_enumerated ::= LINE_LIST_ENUMERATED cont_blocks + cont_block shift-reduce 40 cont_blocks ::= cont_blocks cont_block + {default} reduce 38 item_enumerated ::= LINE_LIST_ENUMERATED cont_blocks State 23: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY - (35) item_enumerated ::= LINE_LIST_ENUMERATED para_lines cont_blocks * + (36) item_enumerated ::= LINE_LIST_ENUMERATED para_lines cont_blocks * cont_blocks ::= cont_blocks * cont_block cont_block ::= * empty indented_line para_lines cont_block ::= * empty indented_line cont_block ::= * empty - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 35 ** Parsing conflict ** + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 36 ** Parsing conflict ** empty shift 29 - cont_block shift-reduce 39 cont_blocks ::= cont_blocks cont_block - {default} reduce 35 item_enumerated ::= LINE_LIST_ENUMERATED para_lines cont_blocks + cont_block shift-reduce 40 cont_blocks ::= cont_blocks cont_block + {default} reduce 36 item_enumerated ::= LINE_LIST_ENUMERATED para_lines cont_blocks State 24: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY - (32) item_bulleted ::= LINE_LIST_BULLETED cont_blocks * + (33) item_bulleted ::= LINE_LIST_BULLETED cont_blocks * cont_blocks ::= cont_blocks * cont_block cont_block ::= * empty indented_line para_lines cont_block ::= * empty indented_line cont_block ::= * empty - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 32 ** Parsing conflict ** + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 33 ** Parsing conflict ** empty shift 29 - cont_block shift-reduce 39 cont_blocks ::= cont_blocks cont_block - {default} reduce 32 item_bulleted ::= LINE_LIST_BULLETED cont_blocks + cont_block shift-reduce 40 cont_blocks ::= cont_blocks cont_block + {default} reduce 33 item_bulleted ::= LINE_LIST_BULLETED cont_blocks State 25: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY - (30) item_bulleted ::= LINE_LIST_BULLETED para_lines cont_blocks * + (31) item_bulleted ::= LINE_LIST_BULLETED para_lines cont_blocks * cont_blocks ::= cont_blocks * cont_block cont_block ::= * empty indented_line para_lines cont_block ::= * empty indented_line cont_block ::= * empty - LINE_EMPTY shift-reduce 68 empty ::= LINE_EMPTY - LINE_EMPTY reduce 30 ** Parsing conflict ** + LINE_EMPTY shift-reduce 69 empty ::= LINE_EMPTY + LINE_EMPTY reduce 31 ** Parsing conflict ** empty shift 29 - cont_block shift-reduce 39 cont_blocks ::= cont_blocks cont_block - {default} reduce 30 item_bulleted ::= LINE_LIST_BULLETED para_lines cont_blocks + cont_block shift-reduce 40 cont_blocks ::= cont_blocks cont_block + {default} reduce 31 item_bulleted ::= LINE_LIST_BULLETED para_lines cont_blocks State 26: para_lines ::= * para_lines para_line para_lines ::= * para_line para_line ::= * LINE_CONTINUATION cont_block ::= empty indented_line * para_lines - (41) cont_block ::= empty indented_line * + (42) cont_block ::= empty indented_line * - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION para_lines shift 36 para_line shift 36 /* because para_line==para_lines */ - {default} reduce 41 cont_block ::= empty indented_line + {default} reduce 42 cont_block ::= empty indented_line State 27: fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines * LINE_FENCE_BACKTICK - (55) fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines * + (56) fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines * fenced_lines ::= fenced_lines * fenced_line fenced_line ::= * LINE_CONTINUATION fenced_line ::= * LINE_EMPTY - LINE_CONTINUATION shift-reduce 86 fenced_line ::= LINE_CONTINUATION - LINE_FENCE_BACKTICK shift-reduce 54 fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines LINE_FENCE_BACKTICK - LINE_FENCE_BACKTICK reduce 55 ** Parsing conflict ** - LINE_EMPTY shift-reduce 87 fenced_line ::= LINE_EMPTY - LINE_EMPTY reduce 55 ** Parsing conflict ** - fenced_line shift-reduce 56 fenced_lines ::= fenced_lines fenced_line - {default} reduce 55 fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines + LINE_CONTINUATION shift-reduce 87 fenced_line ::= LINE_CONTINUATION + LINE_FENCE_BACKTICK shift-reduce 55 fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines LINE_FENCE_BACKTICK + LINE_FENCE_BACKTICK reduce 56 ** Parsing conflict ** + LINE_EMPTY shift-reduce 88 fenced_line ::= LINE_EMPTY + LINE_EMPTY reduce 56 ** Parsing conflict ** + fenced_line shift-reduce 57 fenced_lines ::= fenced_lines fenced_line + {default} reduce 56 fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines State 28: fenced_block ::= LINE_FENCE_BACKTICK fenced_lines * LINE_FENCE_BACKTICK - (53) fenced_block ::= LINE_FENCE_BACKTICK fenced_lines * + (54) fenced_block ::= LINE_FENCE_BACKTICK fenced_lines * fenced_lines ::= fenced_lines * fenced_line fenced_line ::= * LINE_CONTINUATION fenced_line ::= * LINE_EMPTY - LINE_CONTINUATION shift-reduce 86 fenced_line ::= LINE_CONTINUATION - LINE_FENCE_BACKTICK shift-reduce 52 fenced_block ::= LINE_FENCE_BACKTICK fenced_lines LINE_FENCE_BACKTICK - LINE_FENCE_BACKTICK reduce 53 ** Parsing conflict ** - LINE_EMPTY shift-reduce 87 fenced_line ::= LINE_EMPTY - LINE_EMPTY reduce 53 ** Parsing conflict ** - fenced_line shift-reduce 56 fenced_lines ::= fenced_lines fenced_line - {default} reduce 53 fenced_block ::= LINE_FENCE_BACKTICK fenced_lines + LINE_CONTINUATION shift-reduce 87 fenced_line ::= LINE_CONTINUATION + LINE_FENCE_BACKTICK shift-reduce 53 fenced_block ::= LINE_FENCE_BACKTICK fenced_lines LINE_FENCE_BACKTICK + LINE_FENCE_BACKTICK reduce 54 ** Parsing conflict ** + LINE_EMPTY shift-reduce 88 fenced_line ::= LINE_EMPTY + LINE_EMPTY reduce 54 ** Parsing conflict ** + fenced_line shift-reduce 57 fenced_lines ::= fenced_lines fenced_line + {default} reduce 54 fenced_block ::= LINE_FENCE_BACKTICK fenced_lines State 29: indented_line ::= * LINE_INDENTED_TAB @@ -683,70 +687,70 @@ State 29: empty ::= empty * LINE_EMPTY cont_block ::= empty * indented_line para_lines cont_block ::= empty * indented_line - (76) cont_block ::= empty * - - LINE_INDENTED_TAB shift-reduce 66 indented_line ::= LINE_INDENTED_TAB - LINE_INDENTED_TAB reduce 76 ** Parsing conflict ** - LINE_INDENTED_SPACE shift-reduce 67 indented_line ::= LINE_INDENTED_SPACE - LINE_INDENTED_SPACE reduce 76 ** Parsing conflict ** - LINE_EMPTY shift-reduce 26 empty ::= empty LINE_EMPTY - LINE_EMPTY reduce 76 ** Parsing conflict ** + (77) cont_block ::= empty * + + LINE_INDENTED_TAB shift-reduce 67 indented_line ::= LINE_INDENTED_TAB + LINE_INDENTED_TAB reduce 77 ** Parsing conflict ** + LINE_INDENTED_SPACE shift-reduce 68 indented_line ::= LINE_INDENTED_SPACE + LINE_INDENTED_SPACE reduce 77 ** Parsing conflict ** + LINE_EMPTY shift-reduce 27 empty ::= empty LINE_EMPTY + LINE_EMPTY reduce 77 ** Parsing conflict ** indented_line shift 26 - {default} reduce 76 cont_block ::= empty + {default} reduce 77 cont_block ::= empty State 30: - (57) meta_block ::= LINE_META meta_lines * + (58) meta_block ::= LINE_META meta_lines * meta_lines ::= meta_lines * meta_line meta_line ::= * LINE_META meta_line ::= * LINE_CONTINUATION - LINE_CONTINUATION shift-reduce 91 meta_line ::= LINE_CONTINUATION - LINE_META shift-reduce 90 meta_line ::= LINE_META - LINE_META reduce 57 ** Parsing conflict ** - meta_line shift-reduce 58 meta_lines ::= meta_lines meta_line - {default} reduce 57 meta_block ::= LINE_META meta_lines + LINE_CONTINUATION shift-reduce 92 meta_line ::= LINE_CONTINUATION + LINE_META shift-reduce 91 meta_line ::= LINE_META + LINE_META reduce 58 ** Parsing conflict ** + meta_line shift-reduce 59 meta_lines ::= meta_lines meta_line + {default} reduce 58 meta_block ::= LINE_META meta_lines State 31: - (50) html_block ::= LINE_HTML html_block_lines * + (51) html_block ::= LINE_HTML html_block_lines * html_block_lines ::= html_block_lines * html_block_line html_block_line ::= * LINE_CONTINUATION html_block_line ::= * LINE_HTML - LINE_CONTINUATION shift-reduce 83 html_block_line ::= LINE_CONTINUATION - LINE_HTML shift-reduce 84 html_block_line ::= LINE_HTML - LINE_HTML reduce 50 ** Parsing conflict ** - html_block_line shift-reduce 51 html_block_lines ::= html_block_lines html_block_line - {default} reduce 50 html_block ::= LINE_HTML html_block_lines + LINE_CONTINUATION shift-reduce 84 html_block_line ::= LINE_CONTINUATION + LINE_HTML shift-reduce 85 html_block_line ::= LINE_HTML + LINE_HTML reduce 51 ** Parsing conflict ** + html_block_line shift-reduce 52 html_block_lines ::= html_block_lines html_block_line + {default} reduce 51 html_block ::= LINE_HTML html_block_lines State 32: - (27) blockquote ::= LINE_BLOCKQUOTE quote_lines * + (28) blockquote ::= LINE_BLOCKQUOTE quote_lines * quote_lines ::= quote_lines * quote_line quote_line ::= * LINE_BLOCKQUOTE quote_line ::= * LINE_CONTINUATION - LINE_CONTINUATION shift-reduce 72 quote_line ::= LINE_CONTINUATION - LINE_BLOCKQUOTE shift-reduce 71 quote_line ::= LINE_BLOCKQUOTE - LINE_BLOCKQUOTE reduce 27 ** Parsing conflict ** - quote_line shift-reduce 28 quote_lines ::= quote_lines quote_line - {default} reduce 27 blockquote ::= LINE_BLOCKQUOTE quote_lines + LINE_CONTINUATION shift-reduce 73 quote_line ::= LINE_CONTINUATION + LINE_BLOCKQUOTE shift-reduce 72 quote_line ::= LINE_BLOCKQUOTE + LINE_BLOCKQUOTE reduce 28 ** Parsing conflict ** + quote_line shift-reduce 29 quote_lines ::= quote_lines quote_line + {default} reduce 28 blockquote ::= LINE_BLOCKQUOTE quote_lines State 33: para_lines ::= para_lines * para_line para_line ::= * LINE_CONTINUATION - (49) def_link ::= LINE_DEF_LINK para_lines * + (50) def_link ::= LINE_DEF_LINK para_lines * - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION - para_line shift-reduce 24 para_lines ::= para_lines para_line - {default} reduce 49 def_link ::= LINE_DEF_LINK para_lines + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION + para_line shift-reduce 25 para_lines ::= para_lines para_line + {default} reduce 50 def_link ::= LINE_DEF_LINK para_lines State 34: - (23) para ::= LINE_PLAIN para_lines * + (24) para ::= LINE_PLAIN para_lines * para_lines ::= para_lines * para_line para_line ::= * LINE_CONTINUATION - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION - para_line shift-reduce 24 para_lines ::= para_lines para_line - {default} reduce 23 para ::= LINE_PLAIN para_lines + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION + para_line shift-reduce 25 para_lines ::= para_lines para_line + {default} reduce 24 para ::= LINE_PLAIN para_lines State 35: (13) block ::= list_enumerated * @@ -758,17 +762,17 @@ State 35: LINE_LIST_ENUMERATED shift 4 LINE_LIST_ENUMERATED reduce 13 ** Parsing conflict ** - item_enumerated shift-reduce 34 list_enumerated ::= list_enumerated item_enumerated + item_enumerated shift-reduce 35 list_enumerated ::= list_enumerated item_enumerated {default} reduce 13 block ::= list_enumerated State 36: para_lines ::= para_lines * para_line para_line ::= * LINE_CONTINUATION - (40) cont_block ::= empty indented_line para_lines * + (41) cont_block ::= empty indented_line para_lines * - LINE_CONTINUATION shift-reduce 61 para_line ::= LINE_CONTINUATION - para_line shift-reduce 24 para_lines ::= para_lines para_line - {default} reduce 40 cont_block ::= empty indented_line para_lines + LINE_CONTINUATION shift-reduce 62 para_line ::= LINE_CONTINUATION + para_line shift-reduce 25 para_lines ::= para_lines para_line + {default} reduce 41 cont_block ::= empty indented_line para_lines State 37: (12) block ::= list_bulleted * @@ -780,14 +784,14 @@ State 37: LINE_LIST_BULLETED shift 5 LINE_LIST_BULLETED reduce 12 ** Parsing conflict ** - item_bulleted shift-reduce 29 list_bulleted ::= list_bulleted item_bulleted + item_bulleted shift-reduce 30 list_bulleted ::= list_bulleted item_bulleted {default} reduce 12 block ::= list_bulleted State 38: (15) block ::= table * table ::= table * LINE_TABLE - LINE_TABLE shift-reduce 42 table ::= table LINE_TABLE + LINE_TABLE shift-reduce 43 table ::= table LINE_TABLE LINE_TABLE reduce 15 ** Parsing conflict ** {default} reduce 15 block ::= table @@ -795,7 +799,7 @@ State 39: (11) block ::= empty * empty ::= empty * LINE_EMPTY - LINE_EMPTY shift-reduce 26 empty ::= empty LINE_EMPTY + LINE_EMPTY shift-reduce 27 empty ::= empty LINE_EMPTY LINE_EMPTY reduce 11 ** Parsing conflict ** {default} reduce 11 block ::= empty @@ -823,38 +827,39 @@ Symbols: 19: LINE_DEF_LINK 20: LINE_FENCE_BACKTICK 21: LINE_FENCE_BACKTICK_START - 22: LINE_EMPTY - 23: LINE_META - 24: error: - 25: doc: LINE_PLAIN LINE_INDENTED_TAB LINE_INDENTED_SPACE LINE_HTML LINE_ATX_1 LINE_ATX_2 LINE_ATX_3 LINE_ATX_4 LINE_ATX_5 LINE_ATX_6 LINE_HR LINE_BLOCKQUOTE LINE_LIST_BULLETED LINE_LIST_ENUMERATED LINE_TABLE LINE_DEF_CITATION LINE_DEF_FOOTNOTE LINE_DEF_LINK LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK_START LINE_EMPTY LINE_META - 26: blocks: LINE_PLAIN LINE_INDENTED_TAB LINE_INDENTED_SPACE LINE_HTML LINE_ATX_1 LINE_ATX_2 LINE_ATX_3 LINE_ATX_4 LINE_ATX_5 LINE_ATX_6 LINE_HR LINE_BLOCKQUOTE LINE_LIST_BULLETED LINE_LIST_ENUMERATED LINE_TABLE LINE_DEF_CITATION LINE_DEF_FOOTNOTE LINE_DEF_LINK LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK_START LINE_EMPTY LINE_META - 27: block: LINE_PLAIN LINE_INDENTED_TAB LINE_INDENTED_SPACE LINE_HTML LINE_ATX_1 LINE_ATX_2 LINE_ATX_3 LINE_ATX_4 LINE_ATX_5 LINE_ATX_6 LINE_HR LINE_BLOCKQUOTE LINE_LIST_BULLETED LINE_LIST_ENUMERATED LINE_TABLE LINE_DEF_CITATION LINE_DEF_FOOTNOTE LINE_DEF_LINK LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK_START LINE_EMPTY LINE_META - 28: para: LINE_PLAIN - 29: indented_code: LINE_INDENTED_TAB LINE_INDENTED_SPACE - 30: empty: LINE_EMPTY - 31: list_bulleted: LINE_LIST_BULLETED - 32: list_enumerated: LINE_LIST_ENUMERATED - 33: blockquote: LINE_BLOCKQUOTE - 34: table: LINE_TABLE - 35: def_citation: LINE_DEF_CITATION - 36: def_footnote: LINE_DEF_FOOTNOTE - 37: def_link: LINE_DEF_LINK - 38: html_block: LINE_HTML - 39: fenced_block: LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK_START - 40: meta_block: LINE_META - 41: para_lines: LINE_CONTINUATION - 42: para_line: LINE_CONTINUATION - 43: code_line: LINE_INDENTED_TAB LINE_INDENTED_SPACE LINE_EMPTY - 44: indented_line: LINE_INDENTED_TAB LINE_INDENTED_SPACE - 45: quote_lines: LINE_CONTINUATION LINE_BLOCKQUOTE - 46: quote_line: LINE_CONTINUATION LINE_BLOCKQUOTE - 47: item_bulleted: LINE_LIST_BULLETED - 48: cont_blocks: LINE_EMPTY - 49: item_enumerated: LINE_LIST_ENUMERATED - 50: cont_block: LINE_EMPTY - 51: html_block_lines: LINE_CONTINUATION LINE_HTML - 52: html_block_line: LINE_CONTINUATION LINE_HTML - 53: fenced_lines: LINE_CONTINUATION LINE_EMPTY - 54: fenced_line: LINE_CONTINUATION LINE_EMPTY - 55: meta_lines: LINE_CONTINUATION LINE_META - 56: meta_line: LINE_CONTINUATION LINE_META + 22: LINE_TOC + 23: LINE_EMPTY + 24: LINE_META + 25: error: + 26: doc: LINE_PLAIN LINE_INDENTED_TAB LINE_INDENTED_SPACE LINE_HTML LINE_ATX_1 LINE_ATX_2 LINE_ATX_3 LINE_ATX_4 LINE_ATX_5 LINE_ATX_6 LINE_HR LINE_BLOCKQUOTE LINE_LIST_BULLETED LINE_LIST_ENUMERATED LINE_TABLE LINE_DEF_CITATION LINE_DEF_FOOTNOTE LINE_DEF_LINK LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK_START LINE_TOC LINE_EMPTY LINE_META + 27: blocks: LINE_PLAIN LINE_INDENTED_TAB LINE_INDENTED_SPACE LINE_HTML LINE_ATX_1 LINE_ATX_2 LINE_ATX_3 LINE_ATX_4 LINE_ATX_5 LINE_ATX_6 LINE_HR LINE_BLOCKQUOTE LINE_LIST_BULLETED LINE_LIST_ENUMERATED LINE_TABLE LINE_DEF_CITATION LINE_DEF_FOOTNOTE LINE_DEF_LINK LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK_START LINE_TOC LINE_EMPTY LINE_META + 28: block: LINE_PLAIN LINE_INDENTED_TAB LINE_INDENTED_SPACE LINE_HTML LINE_ATX_1 LINE_ATX_2 LINE_ATX_3 LINE_ATX_4 LINE_ATX_5 LINE_ATX_6 LINE_HR LINE_BLOCKQUOTE LINE_LIST_BULLETED LINE_LIST_ENUMERATED LINE_TABLE LINE_DEF_CITATION LINE_DEF_FOOTNOTE LINE_DEF_LINK LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK_START LINE_TOC LINE_EMPTY LINE_META + 29: para: LINE_PLAIN + 30: indented_code: LINE_INDENTED_TAB LINE_INDENTED_SPACE + 31: empty: LINE_EMPTY + 32: list_bulleted: LINE_LIST_BULLETED + 33: list_enumerated: LINE_LIST_ENUMERATED + 34: blockquote: LINE_BLOCKQUOTE + 35: table: LINE_TABLE + 36: def_citation: LINE_DEF_CITATION + 37: def_footnote: LINE_DEF_FOOTNOTE + 38: def_link: LINE_DEF_LINK + 39: html_block: LINE_HTML + 40: fenced_block: LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK_START + 41: meta_block: LINE_META + 42: para_lines: LINE_CONTINUATION + 43: para_line: LINE_CONTINUATION + 44: code_line: LINE_INDENTED_TAB LINE_INDENTED_SPACE LINE_EMPTY + 45: indented_line: LINE_INDENTED_TAB LINE_INDENTED_SPACE + 46: quote_lines: LINE_CONTINUATION LINE_BLOCKQUOTE + 47: quote_line: LINE_CONTINUATION LINE_BLOCKQUOTE + 48: item_bulleted: LINE_LIST_BULLETED + 49: cont_blocks: LINE_EMPTY + 50: item_enumerated: LINE_LIST_ENUMERATED + 51: cont_block: LINE_EMPTY + 52: html_block_lines: LINE_CONTINUATION LINE_HTML + 53: html_block_line: LINE_CONTINUATION LINE_HTML + 54: fenced_lines: LINE_CONTINUATION LINE_EMPTY + 55: fenced_line: LINE_CONTINUATION LINE_EMPTY + 56: meta_lines: LINE_CONTINUATION LINE_META + 57: meta_line: LINE_CONTINUATION LINE_META diff --git a/src/parser.y b/src/parser.y index bffe618..61e7c23 100644 --- a/src/parser.y +++ b/src/parser.y @@ -108,6 +108,7 @@ block(A) ::= def_link(B). { A = token_new_parent(B, BLOCK_DEF_LINK); sta block(A) ::= html_block(B). { A = token_new_parent(B, BLOCK_HTML); } block(A) ::= fenced_block(B). { A = token_new_parent(B, BLOCK_CODE_FENCED); B->child->type = CODE_FENCE; } block(A) ::= meta_block(B). { A = token_new_parent(B, BLOCK_META); } +block(A) ::= LINE_TOC(B). { A = token_new_parent(B, BLOCK_TOC); } para(A) ::= LINE_PLAIN(B) para_lines(C). { A = B; token_chain_append(B, C); } para ::= LINE_PLAIN. diff --git a/src/writer.c b/src/writer.c index 13d4758..f5b847b 100644 --- a/src/writer.c +++ b/src/writer.c @@ -90,6 +90,8 @@ scratch_pad * scratch_pad_new(mmd_engine * e) { p->quotes_lang = e->quotes_lang; p->language = e->language; + p->header_stack = e->header_stack; + // Store links in a hash for rapid retrieval when exporting p->link_hash = NULL; link * l; diff --git a/src/writer.h b/src/writer.h index a1037d2..512999c 100644 --- a/src/writer.h +++ b/src/writer.h @@ -89,6 +89,8 @@ typedef struct { short language; short quotes_lang; + + stack * header_stack; char _PADDING[4]; //!< pad struct for alignment diff --git a/templates/README.md.in b/templates/README.md.in index d842cac..52d687f 100644 --- a/templates/README.md.in +++ b/templates/README.md.in @@ -419,6 +419,7 @@ features have been implemented: * Smart quotes (support for languages other than english is not fully implemented yet) * Superscripts/subscripts +* Table of Contents Things that are partially completed: @@ -431,6 +432,8 @@ Things that are partially completed: * CriticMarkup -- need to decide: * How to handle CM stretches that include blank lines * Fenced code blocks +* Metadata +* Full/Snippet modes Things yet to be completed: @@ -439,13 +442,12 @@ Things yet to be completed: * Manually specified labels for headers * Definition lists * Abbreviations -* Metadata * Glossaries * Tables -* Table of Contents * File Transclusion + ### Accuracy ### MultiMarkdown v6 successfully parses the Markdown [syntax page], except for diff --git a/tests/MMD6Tests/Table of Contents.html b/tests/MMD6Tests/Table of Contents.html new file mode 100644 index 0000000..c2c3f06 --- /dev/null +++ b/tests/MMD6Tests/Table of Contents.html @@ -0,0 +1,51 @@ +
+ +
+ +

Second Level

+ +

First Level

+ +

Second Level b

+ +

Third Level

+ +

Second Level c

+ +

First Level b

+ +

Third Level b

+ +

Second level d

+ +

Third level d

+ +

Fourth level d

+ +

First level e

diff --git a/tests/MMD6Tests/Table of Contents.htmlc b/tests/MMD6Tests/Table of Contents.htmlc new file mode 100644 index 0000000..8ba2ddd --- /dev/null +++ b/tests/MMD6Tests/Table of Contents.htmlc @@ -0,0 +1,23 @@ +

{{TOC}}

+ +

Second Level

+ +

First Level

+ +

Second Level b

+ +

Third Level

+ +

Second Level c

+ +

First Level b

+ +

Third Level b

+ +

Second level d

+ +

Third level d

+ +

Fourth level d

+ +

First level e

diff --git a/tests/MMD6Tests/Table of Contents.text b/tests/MMD6Tests/Table of Contents.text new file mode 100644 index 0000000..05cbe87 --- /dev/null +++ b/tests/MMD6Tests/Table of Contents.text @@ -0,0 +1,23 @@ +{{TOC}} + +## Second Level ## + +# First Level # + +## Second Level b ## + +### Third Level ### + +## Second Level c ## + +# First Level b # + +### Third Level b ### + +## Second level d ## + +### Third level d ## + +#### Fourth level d #### + +# First level e # -- 2.40.0