From: Fletcher T. Penney Date: Sun, 5 Feb 2017 16:57:11 +0000 (-0500) Subject: ADDED: Further work on table parsing X-Git-Tag: 0.1.2a^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d8823bcf209254439590c434311a95a1b9dda7bd;p=multimarkdown ADDED: Further work on table parsing --- diff --git a/README.md b/README.md index 6ff4fac..7c7e7fa 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ * "pathologic" test suite -- fix handling of nested brackets, e.g. `[[[[foo]]]]` to avoid bogging down checking for reference links that don't exist. + * Table support + * Definition list support ## An Announcement! ## diff --git a/src/html.c b/src/html.c index 932fe88..3502da2 100644 --- a/src/html.c +++ b/src/html.c @@ -487,17 +487,23 @@ void mmd_export_token_html(DString * out, const char * source, token * t, size_t { switch (scratch->table_alignment[i]) { case 'l': - case 'L': print("\n"); break; + case 'L': + print("\n"); + break; case 'r': - case 'R': print("\n"); break; + case 'R': + print("\n"); + break; case 'c': - case 'C': print("\n"); break; + case 'C': + print("\n"); + break; default: print("\n"); break; @@ -1083,12 +1089,15 @@ void mmd_export_token_html(DString * out, const char * source, token * t, size_t } switch (scratch->table_alignment[scratch->table_cell_count]) { case 'l': + case 'L': print(" style=\"text-align:left;\""); break; case 'r': + case 'R': print(" style=\"text-align:right;\""); break; case 'c': + case 'C': print(" style=\"text-align:center;\""); break; } diff --git a/src/parser.c b/src/parser.c index 9f0bfa1..ef28337 100644 --- a/src/parser.c +++ b/src/parser.c @@ -92,7 +92,7 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned char -#define YYNOCODE 69 +#define YYNOCODE 70 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE token * typedef union { @@ -107,16 +107,16 @@ typedef union { #define ParseARG_FETCH mmd_engine * engine = yypParser->engine #define ParseARG_STORE yypParser->engine = engine #define YYFALLBACK 1 -#define YYNSTATE 54 -#define YYNRULE 111 -#define YY_MAX_SHIFT 53 -#define YY_MIN_SHIFTREDUCE 117 -#define YY_MAX_SHIFTREDUCE 227 -#define YY_MIN_REDUCE 228 -#define YY_MAX_REDUCE 338 -#define YY_ERROR_ACTION 339 -#define YY_ACCEPT_ACTION 340 -#define YY_NO_ACTION 341 +#define YYNSTATE 51 +#define YYNRULE 110 +#define YY_MAX_SHIFT 50 +#define YY_MIN_SHIFTREDUCE 116 +#define YY_MAX_SHIFTREDUCE 225 +#define YY_MIN_REDUCE 226 +#define YY_MAX_REDUCE 335 +#define YY_ERROR_ACTION 336 +#define YY_ACCEPT_ACTION 337 +#define YY_NO_ACTION 338 /************* End control #defines *******************************************/ /* Define the yytestcase() macro to be a no-op if is not already defined @@ -188,85 +188,83 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (211) +#define YY_ACTTAB_COUNT (207) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 228, 26, 41, 41, 199, 200, 17, 122, 123, 124, - /* 10 */ 125, 126, 127, 133, 18, 5, 4, 210, 3, 2, - /* 20 */ 19, 16, 15, 140, 201, 14, 26, 144, 144, 199, - /* 30 */ 200, 17, 122, 123, 124, 125, 126, 127, 133, 18, - /* 40 */ 5, 4, 210, 3, 2, 19, 16, 15, 140, 201, - /* 50 */ 14, 340, 1, 119, 32, 13, 52, 46, 44, 131, - /* 60 */ 132, 134, 135, 136, 137, 138, 139, 43, 36, 36, - /* 70 */ 195, 13, 33, 33, 46, 201, 44, 25, 24, 210, - /* 80 */ 11, 34, 34, 47, 37, 37, 31, 43, 118, 32, - /* 90 */ 13, 52, 46, 44, 131, 132, 134, 135, 136, 137, - /* 100 */ 138, 139, 43, 12, 216, 35, 13, 217, 35, 46, - /* 110 */ 183, 44, 35, 24, 26, 11, 180, 6, 6, 182, - /* 120 */ 7, 7, 43, 35, 20, 143, 20, 22, 35, 22, - /* 130 */ 210, 21, 35, 21, 147, 8, 8, 145, 143, 35, - /* 140 */ 9, 9, 27, 35, 27, 143, 175, 29, 224, 29, - /* 150 */ 50, 23, 143, 23, 163, 195, 143, 195, 28, 219, - /* 160 */ 28, 219, 30, 195, 30, 199, 200, 199, 200, 166, - /* 170 */ 223, 166, 219, 38, 38, 205, 190, 178, 190, 176, - /* 180 */ 220, 35, 220, 10, 201, 198, 204, 145, 39, 39, - /* 190 */ 51, 49, 4, 220, 48, 48, 5, 153, 42, 42, - /* 200 */ 45, 45, 158, 227, 53, 186, 166, 40, 148, 145, - /* 210 */ 189, + /* 0 */ 226, 25, 143, 143, 196, 197, 208, 16, 121, 122, + /* 10 */ 123, 124, 125, 126, 132, 17, 5, 4, 3, 2, + /* 20 */ 18, 15, 14, 139, 198, 13, 25, 35, 35, 196, + /* 30 */ 197, 208, 16, 121, 122, 123, 124, 125, 126, 132, + /* 40 */ 17, 5, 4, 3, 2, 18, 15, 14, 139, 198, + /* 50 */ 13, 337, 1, 118, 31, 12, 49, 43, 41, 130, + /* 60 */ 131, 133, 134, 135, 136, 137, 138, 40, 46, 23, + /* 70 */ 23, 12, 32, 32, 43, 202, 41, 208, 11, 47, + /* 80 */ 33, 33, 222, 44, 24, 36, 36, 201, 40, 117, + /* 90 */ 31, 12, 49, 43, 41, 130, 131, 133, 134, 135, + /* 100 */ 136, 137, 138, 40, 221, 37, 37, 12, 34, 48, + /* 110 */ 43, 192, 41, 34, 11, 47, 198, 192, 182, 181, + /* 120 */ 6, 6, 217, 34, 40, 7, 7, 19, 34, 19, + /* 130 */ 38, 38, 21, 34, 21, 8, 8, 34, 198, 179, + /* 140 */ 9, 9, 26, 218, 26, 217, 142, 28, 34, 28, + /* 150 */ 142, 30, 20, 174, 20, 34, 22, 25, 22, 196, + /* 160 */ 197, 142, 208, 177, 217, 34, 218, 27, 142, 27, + /* 170 */ 146, 196, 197, 214, 29, 142, 29, 215, 165, 195, + /* 180 */ 144, 10, 175, 46, 164, 218, 157, 45, 45, 39, + /* 190 */ 39, 144, 42, 42, 160, 4, 161, 5, 165, 152, + /* 200 */ 147, 225, 50, 185, 144, 165, 188, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 0, 1, 45, 46, 4, 5, 6, 7, 8, 9, + /* 0 */ 0, 1, 47, 48, 4, 5, 6, 7, 8, 9, /* 10 */ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - /* 20 */ 20, 21, 22, 23, 24, 25, 1, 47, 48, 4, + /* 20 */ 20, 21, 22, 23, 24, 25, 1, 63, 64, 4, /* 30 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, /* 40 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, /* 50 */ 25, 28, 29, 30, 31, 32, 33, 34, 35, 36, - /* 60 */ 37, 38, 39, 40, 41, 42, 43, 44, 62, 63, - /* 70 */ 3, 48, 60, 61, 51, 24, 53, 31, 55, 17, - /* 80 */ 57, 60, 61, 26, 58, 59, 48, 64, 30, 31, - /* 90 */ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - /* 100 */ 42, 43, 44, 57, 3, 33, 48, 6, 33, 51, - /* 110 */ 64, 53, 33, 55, 1, 57, 61, 45, 46, 63, - /* 120 */ 45, 46, 64, 33, 52, 46, 54, 52, 33, 54, - /* 130 */ 17, 52, 33, 54, 50, 45, 46, 24, 46, 33, - /* 140 */ 45, 46, 52, 33, 54, 46, 59, 52, 3, 54, - /* 150 */ 57, 52, 46, 54, 2, 3, 46, 3, 52, 3, - /* 160 */ 54, 3, 52, 3, 54, 4, 5, 4, 5, 17, - /* 170 */ 25, 17, 3, 49, 50, 3, 24, 21, 24, 21, - /* 180 */ 24, 33, 24, 33, 24, 24, 14, 24, 45, 46, - /* 190 */ 56, 57, 16, 24, 65, 66, 15, 53, 45, 46, - /* 200 */ 45, 46, 54, 3, 67, 66, 17, 24, 51, 24, - /* 210 */ 3, + /* 60 */ 37, 38, 39, 40, 41, 42, 43, 44, 56, 57, + /* 70 */ 58, 48, 61, 62, 51, 3, 53, 6, 55, 56, + /* 80 */ 61, 62, 3, 26, 31, 59, 60, 15, 65, 30, + /* 90 */ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + /* 100 */ 41, 42, 43, 44, 25, 49, 50, 48, 33, 56, + /* 110 */ 51, 3, 53, 33, 55, 56, 24, 3, 65, 64, + /* 120 */ 45, 46, 3, 33, 65, 45, 46, 52, 33, 54, + /* 130 */ 45, 46, 52, 33, 54, 45, 46, 33, 24, 62, + /* 140 */ 45, 46, 52, 24, 54, 3, 46, 52, 33, 54, + /* 150 */ 46, 48, 52, 60, 54, 33, 52, 1, 54, 4, + /* 160 */ 5, 46, 6, 21, 3, 33, 24, 52, 46, 54, + /* 170 */ 50, 4, 5, 3, 52, 46, 54, 7, 6, 24, + /* 180 */ 24, 33, 21, 56, 57, 24, 54, 66, 67, 45, + /* 190 */ 46, 24, 45, 46, 2, 17, 24, 16, 6, 53, + /* 200 */ 51, 3, 68, 67, 24, 6, 3, }; -#define YY_SHIFT_USE_DFLT (211) -#define YY_SHIFT_COUNT (53) +#define YY_SHIFT_USE_DFLT (207) +#define YY_SHIFT_COUNT (50) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (207) +#define YY_SHIFT_MAX (203) static const unsigned char yy_shift_ofst[] = { - /* 0 */ 25, 0, 160, 160, 160, 160, 160, 160, 160, 160, - /* 10 */ 113, 152, 154, 161, 145, 169, 169, 101, 172, 67, - /* 20 */ 51, 51, 51, 51, 62, 57, 67, 51, 51, 51, - /* 30 */ 51, 67, 57, 156, 158, 163, 145, 101, 172, 67, - /* 40 */ 62, 67, 67, 51, 176, 67, 181, 200, 57, 189, - /* 50 */ 189, 183, 185, 207, + /* 0 */ 25, 0, 114, 114, 114, 114, 114, 114, 114, 114, + /* 10 */ 156, 71, 155, 79, 119, 119, 170, 72, 108, 92, + /* 20 */ 92, 92, 92, 71, 57, 108, 92, 92, 92, 92, + /* 30 */ 108, 57, 142, 161, 167, 79, 170, 72, 108, 108, + /* 40 */ 92, 178, 108, 181, 198, 57, 172, 192, 199, 180, + /* 50 */ 203, }; -#define YY_REDUCE_USE_DFLT (-44) -#define YY_REDUCE_COUNT (48) -#define YY_REDUCE_MIN (-43) -#define YY_REDUCE_MAX (157) +#define YY_REDUCE_USE_DFLT (-46) +#define YY_REDUCE_COUNT (45) +#define YY_REDUCE_MIN (-45) +#define YY_REDUCE_MAX (149) static const short yy_reduce_ofst[] = { - /* 0 */ 23, 58, 72, 75, 90, 95, 79, 99, 106, 110, - /* 10 */ 46, -43, -43, -20, 6, 12, 21, 26, 124, 143, - /* 20 */ 148, 148, 148, 148, 134, 129, 153, 148, 148, 148, - /* 30 */ 148, 155, 129, 55, 55, 38, 56, 87, 84, 92, - /* 40 */ 93, 92, 92, 150, 144, 92, 157, 137, 139, + /* 0 */ 23, 59, 75, 80, 90, 95, 100, 104, 115, 122, + /* 10 */ 53, 12, -45, -36, 11, 19, 26, 56, 85, 132, + /* 20 */ 132, 132, 132, 127, 121, 144, 132, 132, 132, 132, + /* 30 */ 147, 121, 77, 77, 103, 55, 93, 120, 129, 129, + /* 40 */ 148, 146, 129, 149, 134, 136, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 339, 339, 323, 322, 268, 263, 282, 279, 266, 261, - /* 10 */ 295, 303, 303, 232, 332, 339, 339, 325, 313, 324, - /* 20 */ 283, 281, 280, 278, 339, 339, 304, 267, 265, 262, - /* 30 */ 260, 271, 231, 290, 288, 320, 292, 285, 257, 284, - /* 40 */ 272, 302, 253, 252, 241, 270, 240, 299, 296, 276, - /* 50 */ 275, 273, 239, 298, + /* 0 */ 336, 336, 320, 319, 266, 261, 280, 277, 264, 259, + /* 10 */ 293, 336, 230, 329, 336, 336, 322, 309, 321, 281, + /* 20 */ 279, 278, 276, 273, 336, 300, 265, 263, 260, 258, + /* 30 */ 269, 229, 288, 286, 316, 290, 283, 255, 282, 251, + /* 40 */ 250, 239, 268, 238, 297, 294, 272, 299, 299, 237, + /* 50 */ 296, }; /********** End of lemon-generated parsing tables *****************************/ @@ -292,23 +290,23 @@ static const YYCODETYPE yyFallback[] = { 0, /* LINE_CONTINUATION => nothing */ 3, /* LINE_INDENTED_TAB => LINE_CONTINUATION */ 3, /* LINE_INDENTED_SPACE => LINE_CONTINUATION */ + 3, /* LINE_TABLE => LINE_CONTINUATION */ 0, /* LINE_HTML => nothing */ - 6, /* LINE_ATX_1 => LINE_HTML */ - 6, /* LINE_ATX_2 => LINE_HTML */ - 6, /* LINE_ATX_3 => LINE_HTML */ - 6, /* LINE_ATX_4 => LINE_HTML */ - 6, /* LINE_ATX_5 => LINE_HTML */ - 6, /* LINE_ATX_6 => LINE_HTML */ - 6, /* LINE_HR => LINE_HTML */ - 6, /* LINE_BLOCKQUOTE => LINE_HTML */ - 6, /* LINE_LIST_BULLETED => LINE_HTML */ - 6, /* LINE_LIST_ENUMERATED => LINE_HTML */ - 6, /* LINE_TABLE => LINE_HTML */ - 6, /* LINE_DEF_CITATION => LINE_HTML */ - 6, /* LINE_DEF_FOOTNOTE => LINE_HTML */ - 6, /* LINE_DEF_LINK => LINE_HTML */ - 6, /* LINE_FENCE_BACKTICK => LINE_HTML */ - 6, /* LINE_FENCE_BACKTICK_START => LINE_HTML */ + 7, /* LINE_ATX_1 => LINE_HTML */ + 7, /* LINE_ATX_2 => LINE_HTML */ + 7, /* LINE_ATX_3 => LINE_HTML */ + 7, /* LINE_ATX_4 => LINE_HTML */ + 7, /* LINE_ATX_5 => LINE_HTML */ + 7, /* LINE_ATX_6 => LINE_HTML */ + 7, /* LINE_HR => LINE_HTML */ + 7, /* LINE_BLOCKQUOTE => LINE_HTML */ + 7, /* LINE_LIST_BULLETED => LINE_HTML */ + 7, /* LINE_LIST_ENUMERATED => LINE_HTML */ + 7, /* LINE_DEF_CITATION => LINE_HTML */ + 7, /* LINE_DEF_FOOTNOTE => LINE_HTML */ + 7, /* LINE_DEF_LINK => LINE_HTML */ + 7, /* LINE_FENCE_BACKTICK => LINE_HTML */ + 7, /* LINE_FENCE_BACKTICK_START => LINE_HTML */ }; #endif /* YYFALLBACK */ @@ -395,10 +393,10 @@ void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ ** are required. The following table supplies these names */ static const char *const yyTokenName[] = { "$", "LINE_PLAIN", "LINE_TABLE_SEPARATOR", "LINE_CONTINUATION", - "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_INDENTED_TAB", "LINE_INDENTED_SPACE", "LINE_TABLE", "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_DEF_CITATION", "LINE_DEF_FOOTNOTE", "LINE_DEF_LINK", "LINE_FENCE_BACKTICK", "LINE_FENCE_BACKTICK_START", "LINE_TOC", "LINE_EMPTY", "LINE_META", "LINE_DEFINITION", "error", "doc", "blocks", "block", "para", @@ -408,9 +406,10 @@ static const char *const yyTokenName[] = { "definition_block", "para_lines", "para_line", "code_line", "indented_line", "quote_lines", "quote_line", "item_bulleted", "cont_blocks", "item_enumerated", "cont_block", "table_header", - "table_body", "table_section", "html_block_lines", "html_block_line", - "fenced_lines", "fenced_line", "meta_lines", "meta_line", - "definition", "defs", "def", "def_lines", + "table_rows", "table_section", "table_body", "html_block_lines", + "html_block_line", "fenced_lines", "fenced_line", "meta_lines", + "meta_line", "definition", "defs", "def", + "def_lines", }; #endif /* NDEBUG */ @@ -462,12 +461,12 @@ static const char *const yyRuleName[] = { /* 41 */ "cont_blocks ::= cont_blocks cont_block", /* 42 */ "cont_block ::= empty indented_line para_lines", /* 43 */ "cont_block ::= empty indented_line", - /* 44 */ "table ::= table_header table_body LINE_EMPTY", - /* 45 */ "table ::= table_header table_body", - /* 46 */ "table_header ::= table_section LINE_TABLE_SEPARATOR", - /* 47 */ "table_body ::= table_body LINE_EMPTY table_section", - /* 48 */ "table_body ::= table_section", - /* 49 */ "table_section ::= table_section LINE_TABLE", + /* 44 */ "table_header ::= table_rows LINE_TABLE_SEPARATOR", + /* 45 */ "table_section ::= table_rows LINE_EMPTY", + /* 46 */ "table_section ::= table_rows", + /* 47 */ "table ::= table_header table_body", + /* 48 */ "table_body ::= table_body table_section", + /* 49 */ "table_rows ::= table_rows LINE_TABLE", /* 50 */ "def_citation ::= LINE_DEF_CITATION para_lines cont_blocks", /* 51 */ "def_citation ::= LINE_DEF_CITATION para_lines", /* 52 */ "def_citation ::= LINE_DEF_CITATION cont_blocks", @@ -491,44 +490,43 @@ static const char *const yyRuleName[] = { /* 70 */ "def ::= LINE_DEFINITION def_lines", /* 71 */ "def ::= LINE_DEFINITION", /* 72 */ "def_lines ::= def_lines LINE_CONTINUATION", - /* 73 */ "para ::= table_section LINE_EMPTY", - /* 74 */ "para ::= table_section para_lines", - /* 75 */ "para ::= table_section", - /* 76 */ "para ::= LINE_PLAIN", - /* 77 */ "para_lines ::= para_line", - /* 78 */ "para_line ::= LINE_CONTINUATION", - /* 79 */ "indented_code ::= indented_line", - /* 80 */ "code_line ::= indented_line", - /* 81 */ "code_line ::= LINE_EMPTY", - /* 82 */ "indented_line ::= LINE_INDENTED_TAB", - /* 83 */ "indented_line ::= LINE_INDENTED_SPACE", - /* 84 */ "empty ::= LINE_EMPTY", - /* 85 */ "blockquote ::= LINE_BLOCKQUOTE", - /* 86 */ "quote_lines ::= quote_line", - /* 87 */ "quote_line ::= LINE_BLOCKQUOTE", - /* 88 */ "quote_line ::= LINE_CONTINUATION", - /* 89 */ "list_bulleted ::= item_bulleted", - /* 90 */ "list_enumerated ::= item_enumerated", - /* 91 */ "cont_blocks ::= cont_block", - /* 92 */ "cont_block ::= empty", - /* 93 */ "table_section ::= LINE_TABLE", - /* 94 */ "def_citation ::= LINE_DEF_CITATION", - /* 95 */ "def_footnote ::= LINE_DEF_FOOTNOTE", - /* 96 */ "def_link ::= LINE_DEF_LINK", - /* 97 */ "html_block ::= LINE_HTML", - /* 98 */ "html_block_lines ::= html_block_line", - /* 99 */ "html_block_line ::= LINE_CONTINUATION", - /* 100 */ "html_block_line ::= LINE_HTML", - /* 101 */ "fenced_lines ::= fenced_line", - /* 102 */ "fenced_line ::= LINE_CONTINUATION", - /* 103 */ "fenced_line ::= LINE_EMPTY", - /* 104 */ "meta_block ::= LINE_META", - /* 105 */ "meta_lines ::= meta_line", - /* 106 */ "meta_line ::= LINE_META", - /* 107 */ "meta_line ::= LINE_CONTINUATION", - /* 108 */ "definition_block ::= definition", - /* 109 */ "defs ::= def", - /* 110 */ "def_lines ::= LINE_CONTINUATION", + /* 73 */ "para ::= table_rows", + /* 74 */ "para ::= LINE_PLAIN", + /* 75 */ "para_lines ::= para_line", + /* 76 */ "para_line ::= LINE_CONTINUATION", + /* 77 */ "indented_code ::= indented_line", + /* 78 */ "code_line ::= indented_line", + /* 79 */ "code_line ::= LINE_EMPTY", + /* 80 */ "indented_line ::= LINE_INDENTED_TAB", + /* 81 */ "indented_line ::= LINE_INDENTED_SPACE", + /* 82 */ "empty ::= LINE_EMPTY", + /* 83 */ "blockquote ::= LINE_BLOCKQUOTE", + /* 84 */ "quote_lines ::= quote_line", + /* 85 */ "quote_line ::= LINE_BLOCKQUOTE", + /* 86 */ "quote_line ::= LINE_CONTINUATION", + /* 87 */ "list_bulleted ::= item_bulleted", + /* 88 */ "list_enumerated ::= item_enumerated", + /* 89 */ "cont_blocks ::= cont_block", + /* 90 */ "cont_block ::= empty", + /* 91 */ "table_body ::= table_section", + /* 92 */ "table_rows ::= LINE_TABLE", + /* 93 */ "def_citation ::= LINE_DEF_CITATION", + /* 94 */ "def_footnote ::= LINE_DEF_FOOTNOTE", + /* 95 */ "def_link ::= LINE_DEF_LINK", + /* 96 */ "html_block ::= LINE_HTML", + /* 97 */ "html_block_lines ::= html_block_line", + /* 98 */ "html_block_line ::= LINE_CONTINUATION", + /* 99 */ "html_block_line ::= LINE_HTML", + /* 100 */ "fenced_lines ::= fenced_line", + /* 101 */ "fenced_line ::= LINE_CONTINUATION", + /* 102 */ "fenced_line ::= LINE_EMPTY", + /* 103 */ "meta_block ::= LINE_META", + /* 104 */ "meta_lines ::= meta_line", + /* 105 */ "meta_line ::= LINE_META", + /* 106 */ "meta_line ::= LINE_CONTINUATION", + /* 107 */ "definition_block ::= definition", + /* 108 */ "defs ::= def", + /* 109 */ "def_lines ::= LINE_CONTINUATION", }; #endif /* NDEBUG */ @@ -921,12 +919,12 @@ static const struct { { 52, 2 }, { 54, 3 }, { 54, 2 }, - { 37, 3 }, - { 37, 2 }, { 55, 2 }, - { 56, 3 }, - { 56, 1 }, { 57, 2 }, + { 57, 1 }, + { 37, 2 }, + { 58, 2 }, + { 56, 2 }, { 38, 3 }, { 38, 2 }, { 38, 2 }, @@ -935,23 +933,21 @@ static const struct { { 39, 2 }, { 40, 2 }, { 41, 2 }, - { 58, 2 }, + { 59, 2 }, { 42, 3 }, { 42, 2 }, { 42, 3 }, { 42, 2 }, - { 60, 2 }, + { 61, 2 }, { 43, 2 }, - { 62, 2 }, + { 63, 2 }, { 44, 3 }, { 44, 2 }, - { 64, 2 }, { 65, 2 }, { 66, 2 }, - { 66, 1 }, { 67, 2 }, - { 31, 2 }, - { 31, 2 }, + { 67, 1 }, + { 68, 2 }, { 31, 1 }, { 31, 1 }, { 45, 1 }, @@ -970,24 +966,25 @@ static const struct { { 35, 1 }, { 52, 1 }, { 54, 1 }, - { 57, 1 }, + { 58, 1 }, + { 56, 1 }, { 38, 1 }, { 39, 1 }, { 40, 1 }, { 41, 1 }, - { 58, 1 }, - { 59, 1 }, { 59, 1 }, { 60, 1 }, + { 60, 1 }, { 61, 1 }, - { 61, 1 }, - { 43, 1 }, { 62, 1 }, + { 62, 1 }, + { 43, 1 }, { 63, 1 }, - { 63, 1 }, + { 64, 1 }, + { 64, 1 }, { 44, 1 }, - { 65, 1 }, - { 67, 1 }, + { 66, 1 }, + { 68, 1 }, }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -1173,8 +1170,9 @@ static void yy_reduce( case 31: /* list_bulleted ::= list_bulleted item_bulleted */ yytestcase(yyruleno==31); case 36: /* list_enumerated ::= list_enumerated item_enumerated */ yytestcase(yyruleno==36); case 41: /* cont_blocks ::= cont_blocks cont_block */ yytestcase(yyruleno==41); - case 45: /* table ::= table_header table_body */ yytestcase(yyruleno==45); - case 49: /* table_section ::= table_section LINE_TABLE */ yytestcase(yyruleno==49); + case 47: /* table ::= table_header table_body */ yytestcase(yyruleno==47); + case 48: /* table_body ::= table_body table_section */ yytestcase(yyruleno==48); + case 49: /* table_rows ::= table_rows LINE_TABLE */ yytestcase(yyruleno==49); case 51: /* def_citation ::= LINE_DEF_CITATION para_lines */ yytestcase(yyruleno==51); case 52: /* def_citation ::= LINE_DEF_CITATION cont_blocks */ yytestcase(yyruleno==52); case 54: /* def_footnote ::= LINE_DEF_FOOTNOTE para_lines */ yytestcase(yyruleno==54); @@ -1190,8 +1188,6 @@ static void yy_reduce( case 67: /* definition_block ::= definition_block empty */ yytestcase(yyruleno==67); case 69: /* defs ::= defs def */ yytestcase(yyruleno==69); case 72: /* def_lines ::= def_lines LINE_CONTINUATION */ yytestcase(yyruleno==72); - case 73: /* para ::= table_section LINE_EMPTY */ yytestcase(yyruleno==73); - case 74: /* para ::= table_section para_lines */ yytestcase(yyruleno==74); { yylhsminor.yy0 = yymsp[-1].minor.yy0; token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); } yymsp[-1].minor.yy0 = yylhsminor.yy0; break; @@ -1226,25 +1222,24 @@ static void yy_reduce( { 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 44: /* table ::= table_header table_body LINE_EMPTY */ - case 50: /* def_citation ::= LINE_DEF_CITATION para_lines cont_blocks */ yytestcase(yyruleno==50); - case 53: /* def_footnote ::= LINE_DEF_FOOTNOTE para_lines cont_blocks */ yytestcase(yyruleno==53); - case 66: /* definition_block ::= definition_block empty definition */ yytestcase(yyruleno==66); -{ 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 46: /* table_header ::= table_section LINE_TABLE_SEPARATOR */ + case 44: /* table_header ::= table_rows LINE_TABLE_SEPARATOR */ { yylhsminor.yy0 = token_new_parent(yymsp[-1].minor.yy0, BLOCK_TABLE_HEADER); token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); } yymsp[-1].minor.yy0 = yylhsminor.yy0; break; - case 47: /* table_body ::= table_body LINE_EMPTY table_section */ -{ yylhsminor.yy0 = yymsp[-2].minor.yy0; token_chain_append(yymsp[-2].minor.yy0, yymsp[-1].minor.yy0); token_chain_append(yymsp[-2].minor.yy0, token_new_parent(yymsp[0].minor.yy0, BLOCK_TABLE_SECTION)); } - yymsp[-2].minor.yy0 = yylhsminor.yy0; + case 45: /* table_section ::= table_rows LINE_EMPTY */ +{ yylhsminor.yy0 = token_new_parent(yymsp[-1].minor.yy0, BLOCK_TABLE_SECTION); token_chain_append(yymsp[-1].minor.yy0, yymsp[0].minor.yy0); } + yymsp[-1].minor.yy0 = yylhsminor.yy0; break; - case 48: /* table_body ::= table_section */ + case 46: /* table_section ::= table_rows */ { yylhsminor.yy0 = token_new_parent(yymsp[0].minor.yy0, BLOCK_TABLE_SECTION); } yymsp[0].minor.yy0 = yylhsminor.yy0; break; + case 50: /* def_citation ::= LINE_DEF_CITATION para_lines cont_blocks */ + case 53: /* def_footnote ::= LINE_DEF_FOOTNOTE para_lines cont_blocks */ yytestcase(yyruleno==53); + case 66: /* definition_block ::= definition_block empty definition */ yytestcase(yyruleno==66); +{ 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 59: /* fenced_block ::= LINE_FENCE_BACKTICK fenced_lines LINE_FENCE_BACKTICK */ case 61: /* fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines LINE_FENCE_BACKTICK */ yytestcase(yyruleno==61); { 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; } @@ -1262,46 +1257,47 @@ static void yy_reduce( { yylhsminor.yy0 = token_new_parent(yymsp[0].minor.yy0, BLOCK_DEFINITION); } yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 75: /* para ::= table_section */ + case 73: /* para ::= table_rows */ { yylhsminor.yy0 = yymsp[0].minor.yy0; } yymsp[0].minor.yy0 = yylhsminor.yy0; break; default: - /* (76) para ::= LINE_PLAIN */ yytestcase(yyruleno==76); - /* (77) para_lines ::= para_line (OPTIMIZED OUT) */ assert(yyruleno!=77); - /* (78) para_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==78); - /* (79) indented_code ::= indented_line (OPTIMIZED OUT) */ assert(yyruleno!=79); - /* (80) code_line ::= indented_line (OPTIMIZED OUT) */ assert(yyruleno!=80); - /* (81) code_line ::= LINE_EMPTY */ yytestcase(yyruleno==81); - /* (82) indented_line ::= LINE_INDENTED_TAB */ yytestcase(yyruleno==82); - /* (83) indented_line ::= LINE_INDENTED_SPACE */ yytestcase(yyruleno==83); - /* (84) empty ::= LINE_EMPTY */ yytestcase(yyruleno==84); - /* (85) blockquote ::= LINE_BLOCKQUOTE */ yytestcase(yyruleno==85); - /* (86) quote_lines ::= quote_line (OPTIMIZED OUT) */ assert(yyruleno!=86); - /* (87) quote_line ::= LINE_BLOCKQUOTE */ yytestcase(yyruleno==87); - /* (88) quote_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==88); - /* (89) list_bulleted ::= item_bulleted (OPTIMIZED OUT) */ assert(yyruleno!=89); - /* (90) list_enumerated ::= item_enumerated (OPTIMIZED OUT) */ assert(yyruleno!=90); - /* (91) cont_blocks ::= cont_block (OPTIMIZED OUT) */ assert(yyruleno!=91); - /* (92) cont_block ::= empty */ yytestcase(yyruleno==92); - /* (93) table_section ::= LINE_TABLE */ yytestcase(yyruleno==93); - /* (94) def_citation ::= LINE_DEF_CITATION */ yytestcase(yyruleno==94); - /* (95) def_footnote ::= LINE_DEF_FOOTNOTE */ yytestcase(yyruleno==95); - /* (96) def_link ::= LINE_DEF_LINK */ yytestcase(yyruleno==96); - /* (97) html_block ::= LINE_HTML */ yytestcase(yyruleno==97); - /* (98) html_block_lines ::= html_block_line (OPTIMIZED OUT) */ assert(yyruleno!=98); - /* (99) html_block_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==99); - /* (100) html_block_line ::= LINE_HTML */ yytestcase(yyruleno==100); - /* (101) fenced_lines ::= fenced_line (OPTIMIZED OUT) */ assert(yyruleno!=101); - /* (102) fenced_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==102); - /* (103) fenced_line ::= LINE_EMPTY */ yytestcase(yyruleno==103); - /* (104) meta_block ::= LINE_META */ yytestcase(yyruleno==104); - /* (105) meta_lines ::= meta_line (OPTIMIZED OUT) */ assert(yyruleno!=105); - /* (106) meta_line ::= LINE_META */ yytestcase(yyruleno==106); - /* (107) meta_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==107); - /* (108) definition_block ::= definition (OPTIMIZED OUT) */ assert(yyruleno!=108); - /* (109) defs ::= def (OPTIMIZED OUT) */ assert(yyruleno!=109); - /* (110) def_lines ::= LINE_CONTINUATION */ yytestcase(yyruleno==110); + /* (74) para ::= LINE_PLAIN */ yytestcase(yyruleno==74); + /* (75) para_lines ::= para_line (OPTIMIZED OUT) */ assert(yyruleno!=75); + /* (76) para_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==76); + /* (77) indented_code ::= indented_line (OPTIMIZED OUT) */ assert(yyruleno!=77); + /* (78) code_line ::= indented_line (OPTIMIZED OUT) */ assert(yyruleno!=78); + /* (79) code_line ::= LINE_EMPTY */ yytestcase(yyruleno==79); + /* (80) indented_line ::= LINE_INDENTED_TAB */ yytestcase(yyruleno==80); + /* (81) indented_line ::= LINE_INDENTED_SPACE */ yytestcase(yyruleno==81); + /* (82) empty ::= LINE_EMPTY */ yytestcase(yyruleno==82); + /* (83) blockquote ::= LINE_BLOCKQUOTE */ yytestcase(yyruleno==83); + /* (84) quote_lines ::= quote_line (OPTIMIZED OUT) */ assert(yyruleno!=84); + /* (85) quote_line ::= LINE_BLOCKQUOTE */ yytestcase(yyruleno==85); + /* (86) quote_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==86); + /* (87) list_bulleted ::= item_bulleted (OPTIMIZED OUT) */ assert(yyruleno!=87); + /* (88) list_enumerated ::= item_enumerated (OPTIMIZED OUT) */ assert(yyruleno!=88); + /* (89) cont_blocks ::= cont_block (OPTIMIZED OUT) */ assert(yyruleno!=89); + /* (90) cont_block ::= empty */ yytestcase(yyruleno==90); + /* (91) table_body ::= table_section (OPTIMIZED OUT) */ assert(yyruleno!=91); + /* (92) table_rows ::= LINE_TABLE */ yytestcase(yyruleno==92); + /* (93) def_citation ::= LINE_DEF_CITATION */ yytestcase(yyruleno==93); + /* (94) def_footnote ::= LINE_DEF_FOOTNOTE */ yytestcase(yyruleno==94); + /* (95) def_link ::= LINE_DEF_LINK */ yytestcase(yyruleno==95); + /* (96) html_block ::= LINE_HTML */ yytestcase(yyruleno==96); + /* (97) html_block_lines ::= html_block_line (OPTIMIZED OUT) */ assert(yyruleno!=97); + /* (98) html_block_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==98); + /* (99) html_block_line ::= LINE_HTML */ yytestcase(yyruleno==99); + /* (100) fenced_lines ::= fenced_line (OPTIMIZED OUT) */ assert(yyruleno!=100); + /* (101) fenced_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==101); + /* (102) fenced_line ::= LINE_EMPTY */ yytestcase(yyruleno==102); + /* (103) meta_block ::= LINE_META */ yytestcase(yyruleno==103); + /* (104) meta_lines ::= meta_line (OPTIMIZED OUT) */ assert(yyruleno!=104); + /* (105) meta_line ::= LINE_META */ yytestcase(yyruleno==105); + /* (106) meta_line ::= LINE_CONTINUATION */ yytestcase(yyruleno==106); + /* (107) definition_block ::= definition (OPTIMIZED OUT) */ assert(yyruleno!=107); + /* (108) defs ::= def (OPTIMIZED OUT) */ assert(yyruleno!=108); + /* (109) def_lines ::= LINE_CONTINUATION */ yytestcase(yyruleno==109); break; /********** End reduce actions ************************************************/ }; diff --git a/src/parser.h b/src/parser.h index 02c261a..0eedfe9 100644 --- a/src/parser.h +++ b/src/parser.h @@ -3,18 +3,18 @@ #define LINE_CONTINUATION 3 #define LINE_INDENTED_TAB 4 #define LINE_INDENTED_SPACE 5 -#define LINE_HTML 6 -#define LINE_ATX_1 7 -#define LINE_ATX_2 8 -#define LINE_ATX_3 9 -#define LINE_ATX_4 10 -#define LINE_ATX_5 11 -#define LINE_ATX_6 12 -#define LINE_HR 13 -#define LINE_BLOCKQUOTE 14 -#define LINE_LIST_BULLETED 15 -#define LINE_LIST_ENUMERATED 16 -#define LINE_TABLE 17 +#define LINE_TABLE 6 +#define LINE_HTML 7 +#define LINE_ATX_1 8 +#define LINE_ATX_2 9 +#define LINE_ATX_3 10 +#define LINE_ATX_4 11 +#define LINE_ATX_5 12 +#define LINE_ATX_6 13 +#define LINE_HR 14 +#define LINE_BLOCKQUOTE 15 +#define LINE_LIST_BULLETED 16 +#define LINE_LIST_ENUMERATED 17 #define LINE_DEF_CITATION 18 #define LINE_DEF_FOOTNOTE 19 #define LINE_DEF_LINK 20 diff --git a/src/parser.out b/src/parser.out index 748d517..1d60a65 100644 --- a/src/parser.out +++ b/src/parser.out @@ -46,11 +46,10 @@ State 0: item_enumerated ::= * LINE_LIST_ENUMERATED para_lines item_enumerated ::= * LINE_LIST_ENUMERATED cont_blocks item_enumerated ::= * LINE_LIST_ENUMERATED - table ::= * table_header table_body LINE_EMPTY + table_header ::= * table_rows LINE_TABLE_SEPARATOR table ::= * table_header table_body - table_header ::= * table_section LINE_TABLE_SEPARATOR - table_section ::= * table_section LINE_TABLE - table_section ::= * LINE_TABLE + table_rows ::= * table_rows LINE_TABLE + table_rows ::= * LINE_TABLE def_citation ::= * LINE_DEF_CITATION para_lines cont_blocks def_citation ::= * LINE_DEF_CITATION para_lines def_citation ::= * LINE_DEF_CITATION cont_blocks @@ -73,14 +72,13 @@ State 0: definition_block ::= * definition_block empty definition_block ::= * definition definition ::= * para defs - para ::= * table_section LINE_EMPTY - para ::= * table_section para_lines - para ::= * table_section - - LINE_PLAIN shift 26 - LINE_INDENTED_TAB shift-reduce 82 indented_line ::= LINE_INDENTED_TAB - LINE_INDENTED_SPACE shift-reduce 83 indented_line ::= LINE_INDENTED_SPACE - LINE_HTML shift 17 + para ::= * table_rows + + LINE_PLAIN shift 25 + LINE_INDENTED_TAB shift-reduce 80 indented_line ::= LINE_INDENTED_TAB + LINE_INDENTED_SPACE shift-reduce 81 indented_line ::= LINE_INDENTED_SPACE + LINE_TABLE shift-reduce 92 table_rows ::= LINE_TABLE + LINE_HTML shift 16 LINE_ATX_1 shift-reduce 5 block ::= LINE_ATX_1 LINE_ATX_2 shift-reduce 6 block ::= LINE_ATX_2 LINE_ATX_3 shift-reduce 7 block ::= LINE_ATX_3 @@ -88,26 +86,25 @@ State 0: LINE_ATX_5 shift-reduce 9 block ::= LINE_ATX_5 LINE_ATX_6 shift-reduce 10 block ::= LINE_ATX_6 LINE_HR shift-reduce 16 block ::= LINE_HR - LINE_BLOCKQUOTE shift 18 + LINE_BLOCKQUOTE shift 17 LINE_LIST_BULLETED shift 5 LINE_LIST_ENUMERATED shift 4 - LINE_TABLE shift-reduce 93 table_section ::= LINE_TABLE LINE_DEF_CITATION shift 3 LINE_DEF_FOOTNOTE shift 2 - LINE_DEF_LINK shift 19 - LINE_FENCE_BACKTICK shift 16 - LINE_FENCE_BACKTICK_START shift 15 + LINE_DEF_LINK shift 18 + LINE_FENCE_BACKTICK shift 15 + LINE_FENCE_BACKTICK_START shift 14 LINE_TOC shift-reduce 23 block ::= LINE_TOC - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY - LINE_META shift 14 + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY + LINE_META shift 13 doc accept blocks shift 1 block shift-reduce 2 blocks ::= block - para shift 32 - indented_code shift 13 - empty shift 52 - list_bulleted shift 46 - list_enumerated shift 44 + para shift 31 + indented_code shift 12 + empty shift 49 + list_bulleted shift 43 + list_enumerated shift 41 blockquote shift-reduce 14 block ::= blockquote table shift-reduce 15 block ::= table def_citation shift-reduce 17 block ::= def_citation @@ -116,13 +113,13 @@ State 0: html_block shift-reduce 20 block ::= html_block fenced_block shift-reduce 21 block ::= fenced_block meta_block shift-reduce 22 block ::= meta_block - definition_block shift 43 - indented_line shift 13 /* because indented_line==indented_code */ - item_bulleted shift 46 /* because item_bulleted==list_bulleted */ - item_enumerated shift 44 /* because item_enumerated==list_enumerated */ - table_header shift 24 - table_section shift 11 - definition shift 43 /* because definition==definition_block */ + definition_block shift 40 + indented_line shift 12 /* because indented_line==indented_code */ + item_bulleted shift 43 /* because item_bulleted==list_bulleted */ + item_enumerated shift 41 /* because item_enumerated==list_enumerated */ + table_header shift 11 + table_rows shift 47 + definition shift 40 /* because definition==definition_block */ State 1: (0) doc ::= blocks * @@ -171,11 +168,10 @@ State 1: item_enumerated ::= * LINE_LIST_ENUMERATED para_lines item_enumerated ::= * LINE_LIST_ENUMERATED cont_blocks item_enumerated ::= * LINE_LIST_ENUMERATED - table ::= * table_header table_body LINE_EMPTY + table_header ::= * table_rows LINE_TABLE_SEPARATOR table ::= * table_header table_body - table_header ::= * table_section LINE_TABLE_SEPARATOR - table_section ::= * table_section LINE_TABLE - table_section ::= * LINE_TABLE + table_rows ::= * table_rows LINE_TABLE + table_rows ::= * LINE_TABLE def_citation ::= * LINE_DEF_CITATION para_lines cont_blocks def_citation ::= * LINE_DEF_CITATION para_lines def_citation ::= * LINE_DEF_CITATION cont_blocks @@ -198,15 +194,14 @@ State 1: definition_block ::= * definition_block empty definition_block ::= * definition definition ::= * para defs - para ::= * table_section LINE_EMPTY - para ::= * table_section para_lines - para ::= * table_section + para ::= * table_rows $ reduce 0 doc ::= blocks - LINE_PLAIN shift 26 - LINE_INDENTED_TAB shift-reduce 82 indented_line ::= LINE_INDENTED_TAB - LINE_INDENTED_SPACE shift-reduce 83 indented_line ::= LINE_INDENTED_SPACE - LINE_HTML shift 17 + LINE_PLAIN shift 25 + LINE_INDENTED_TAB shift-reduce 80 indented_line ::= LINE_INDENTED_TAB + LINE_INDENTED_SPACE shift-reduce 81 indented_line ::= LINE_INDENTED_SPACE + LINE_TABLE shift-reduce 92 table_rows ::= LINE_TABLE + LINE_HTML shift 16 LINE_ATX_1 shift-reduce 5 block ::= LINE_ATX_1 LINE_ATX_2 shift-reduce 6 block ::= LINE_ATX_2 LINE_ATX_3 shift-reduce 7 block ::= LINE_ATX_3 @@ -214,24 +209,23 @@ State 1: LINE_ATX_5 shift-reduce 9 block ::= LINE_ATX_5 LINE_ATX_6 shift-reduce 10 block ::= LINE_ATX_6 LINE_HR shift-reduce 16 block ::= LINE_HR - LINE_BLOCKQUOTE shift 18 + LINE_BLOCKQUOTE shift 17 LINE_LIST_BULLETED shift 5 LINE_LIST_ENUMERATED shift 4 - LINE_TABLE shift-reduce 93 table_section ::= LINE_TABLE LINE_DEF_CITATION shift 3 LINE_DEF_FOOTNOTE shift 2 - LINE_DEF_LINK shift 19 - LINE_FENCE_BACKTICK shift 16 - LINE_FENCE_BACKTICK_START shift 15 + LINE_DEF_LINK shift 18 + LINE_FENCE_BACKTICK shift 15 + LINE_FENCE_BACKTICK_START shift 14 LINE_TOC shift-reduce 23 block ::= LINE_TOC - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY - LINE_META shift 14 + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY + LINE_META shift 13 block shift-reduce 1 blocks ::= blocks block - para shift 32 - indented_code shift 13 - empty shift 52 - list_bulleted shift 46 - list_enumerated shift 44 + para shift 31 + indented_code shift 12 + empty shift 49 + list_bulleted shift 43 + list_enumerated shift 41 blockquote shift-reduce 14 block ::= blockquote table shift-reduce 15 block ::= table def_citation shift-reduce 17 block ::= def_citation @@ -240,13 +234,13 @@ State 1: html_block shift-reduce 20 block ::= html_block fenced_block shift-reduce 21 block ::= fenced_block meta_block shift-reduce 22 block ::= meta_block - definition_block shift 43 - indented_line shift 13 /* because indented_line==indented_code */ - item_bulleted shift 46 /* because item_bulleted==list_bulleted */ - item_enumerated shift 44 /* because item_enumerated==list_enumerated */ - table_header shift 24 - table_section shift 11 - definition shift 43 /* because definition==definition_block */ + definition_block shift 40 + indented_line shift 12 /* because indented_line==indented_code */ + item_bulleted shift 43 /* because item_bulleted==list_bulleted */ + item_enumerated shift 41 /* because item_enumerated==list_enumerated */ + table_header shift 11 + table_rows shift 47 + definition shift 40 /* because definition==definition_block */ State 2: para_lines ::= * para_lines para_line @@ -262,17 +256,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 - (95) def_footnote ::= LINE_DEF_FOOTNOTE * + (94) def_footnote ::= LINE_DEF_FOOTNOTE * - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY - LINE_EMPTY reduce 95 ** Parsing conflict ** - empty shift 35 + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY + LINE_EMPTY reduce 94 ** Parsing conflict ** + empty shift 34 para_lines shift 6 para_line shift 6 /* because para_line==para_lines */ - cont_blocks shift 20 - cont_block shift 20 /* because cont_block==cont_blocks */ - {default} reduce 95 def_footnote ::= LINE_DEF_FOOTNOTE + cont_blocks shift 19 + cont_block shift 19 /* because cont_block==cont_blocks */ + {default} reduce 94 def_footnote ::= LINE_DEF_FOOTNOTE State 3: para_lines ::= * para_lines para_line @@ -288,17 +282,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 - (94) def_citation ::= LINE_DEF_CITATION * + (93) def_citation ::= LINE_DEF_CITATION * - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY - LINE_EMPTY reduce 94 ** Parsing conflict ** - empty shift 35 + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY + LINE_EMPTY reduce 93 ** Parsing conflict ** + empty shift 34 para_lines shift 7 para_line shift 7 /* because para_line==para_lines */ - cont_blocks shift 22 - cont_block shift 22 /* because cont_block==cont_blocks */ - {default} reduce 94 def_citation ::= LINE_DEF_CITATION + cont_blocks shift 21 + cont_block shift 21 /* because cont_block==cont_blocks */ + {default} reduce 93 def_citation ::= LINE_DEF_CITATION State 4: para_lines ::= * para_lines para_line @@ -316,14 +310,14 @@ State 4: cont_block ::= * empty indented_line cont_block ::= * empty - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 40 ** Parsing conflict ** - empty shift 35 + empty shift 34 para_lines shift 8 para_line shift 8 /* because para_line==para_lines */ - cont_blocks shift 27 - cont_block shift 27 /* because cont_block==cont_blocks */ + cont_blocks shift 26 + cont_block shift 26 /* because cont_block==cont_blocks */ {default} reduce 40 item_enumerated ::= LINE_LIST_ENUMERATED State 5: @@ -342,14 +336,14 @@ State 5: cont_block ::= * empty indented_line cont_block ::= * empty - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 35 ** Parsing conflict ** - empty shift 35 + empty shift 34 para_lines shift 9 para_line shift 9 /* because para_line==para_lines */ - cont_blocks shift 29 - cont_block shift 29 /* because cont_block==cont_blocks */ + cont_blocks shift 28 + cont_block shift 28 /* because cont_block==cont_blocks */ {default} reduce 35 item_bulleted ::= LINE_LIST_BULLETED State 6: @@ -365,13 +359,13 @@ State 6: def_footnote ::= LINE_DEF_FOOTNOTE para_lines * cont_blocks (54) def_footnote ::= LINE_DEF_FOOTNOTE para_lines * - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 54 ** Parsing conflict ** - empty shift 35 + empty shift 34 para_line shift-reduce 26 para_lines ::= para_lines para_line - cont_blocks shift 21 - cont_block shift 21 /* because cont_block==cont_blocks */ + cont_blocks shift 20 + cont_block shift 20 /* because cont_block==cont_blocks */ {default} reduce 54 def_footnote ::= LINE_DEF_FOOTNOTE para_lines State 7: @@ -387,13 +381,13 @@ State 7: def_citation ::= LINE_DEF_CITATION para_lines * cont_blocks (51) def_citation ::= LINE_DEF_CITATION para_lines * - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 51 ** Parsing conflict ** - empty shift 35 + empty shift 34 para_line shift-reduce 26 para_lines ::= para_lines para_line - cont_blocks shift 23 - cont_block shift 23 /* because cont_block==cont_blocks */ + cont_blocks shift 22 + cont_block shift 22 /* because cont_block==cont_blocks */ {default} reduce 51 def_citation ::= LINE_DEF_CITATION para_lines State 8: @@ -409,13 +403,13 @@ State 8: cont_block ::= * empty indented_line cont_block ::= * empty - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 38 ** Parsing conflict ** - empty shift 35 + empty shift 34 para_line shift-reduce 26 para_lines ::= para_lines para_line - cont_blocks shift 28 - cont_block shift 28 /* because cont_block==cont_blocks */ + cont_blocks shift 27 + cont_block shift 27 /* because cont_block==cont_blocks */ {default} reduce 38 item_enumerated ::= LINE_LIST_ENUMERATED para_lines State 9: @@ -431,76 +425,52 @@ State 9: cont_block ::= * empty indented_line cont_block ::= * empty - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 33 ** Parsing conflict ** - empty shift 35 + empty shift 34 para_line shift-reduce 26 para_lines ::= para_lines para_line - cont_blocks shift 30 - cont_block shift 30 /* because cont_block==cont_blocks */ + cont_blocks shift 29 + cont_block shift 29 /* because cont_block==cont_blocks */ {default} reduce 33 item_bulleted ::= LINE_LIST_BULLETED para_lines State 10: para ::= * LINE_PLAIN para_lines para ::= * LINE_PLAIN empty ::= empty * LINE_EMPTY - table_section ::= * table_section LINE_TABLE - table_section ::= * LINE_TABLE + table_rows ::= * table_rows LINE_TABLE + table_rows ::= * LINE_TABLE definition_block ::= definition_block empty * definition (67) definition_block ::= definition_block empty * definition ::= * para defs - para ::= * table_section LINE_EMPTY - para ::= * table_section para_lines - para ::= * table_section + para ::= * table_rows - LINE_PLAIN shift 26 + LINE_PLAIN shift 25 LINE_PLAIN reduce 67 ** Parsing conflict ** - LINE_TABLE shift-reduce 93 table_section ::= LINE_TABLE + LINE_TABLE shift-reduce 92 table_rows ::= LINE_TABLE LINE_TABLE reduce 67 ** Parsing conflict ** LINE_EMPTY shift-reduce 28 empty ::= empty LINE_EMPTY LINE_EMPTY reduce 67 ** Parsing conflict ** - para shift 25 - table_section shift 12 + para shift 24 + table_rows shift 48 definition shift-reduce 66 definition_block ::= definition_block empty definition {default} reduce 67 definition_block ::= definition_block empty State 11: - para_lines ::= * para_lines para_line - para_lines ::= * para_line - para_line ::= * LINE_CONTINUATION - table_header ::= table_section * LINE_TABLE_SEPARATOR - table_section ::= table_section * LINE_TABLE - para ::= table_section * LINE_EMPTY - para ::= table_section * para_lines - (75) para ::= table_section * - - LINE_TABLE_SEPARATOR shift-reduce 46 table_header ::= table_section LINE_TABLE_SEPARATOR - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - LINE_TABLE shift-reduce 49 table_section ::= table_section LINE_TABLE - LINE_TABLE reduce 75 ** Parsing conflict ** - LINE_EMPTY shift-reduce 73 para ::= table_section LINE_EMPTY - LINE_EMPTY reduce 75 ** Parsing conflict ** - para_lines shift 41 - para_line shift 41 /* because para_line==para_lines */ - {default} reduce 75 para ::= table_section + table_section ::= * table_rows LINE_EMPTY + table_section ::= * table_rows + table ::= table_header * table_body + table_body ::= * table_body table_section + table_body ::= * table_section + table_rows ::= * table_rows LINE_TABLE + table_rows ::= * LINE_TABLE -State 12: - para_lines ::= * para_lines para_line - para_lines ::= * para_line - para_line ::= * LINE_CONTINUATION - table_section ::= table_section * LINE_TABLE - para ::= table_section * LINE_EMPTY - para ::= table_section * para_lines - (75) para ::= table_section * - - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - LINE_TABLE shift-reduce 49 table_section ::= table_section LINE_TABLE - LINE_EMPTY shift-reduce 73 para ::= table_section LINE_EMPTY - para_lines shift 41 - para_line shift 41 /* because para_line==para_lines */ - {default} reduce 75 para ::= table_section + LINE_TABLE shift-reduce 92 table_rows ::= LINE_TABLE + table_rows shift 46 + table_section shift 23 /* because table_section==table_body */ + table_body shift 23 -State 13: +State 12: (4) block ::= indented_code * indented_code ::= indented_code * code_line code_line ::= * indented_line @@ -508,32 +478,32 @@ State 13: indented_line ::= * LINE_INDENTED_TAB indented_line ::= * LINE_INDENTED_SPACE - LINE_INDENTED_TAB shift-reduce 82 indented_line ::= LINE_INDENTED_TAB + LINE_INDENTED_TAB shift-reduce 80 indented_line ::= LINE_INDENTED_TAB LINE_INDENTED_TAB reduce 4 ** Parsing conflict ** - LINE_INDENTED_SPACE shift-reduce 83 indented_line ::= LINE_INDENTED_SPACE + LINE_INDENTED_SPACE shift-reduce 81 indented_line ::= LINE_INDENTED_SPACE LINE_INDENTED_SPACE reduce 4 ** Parsing conflict ** - LINE_EMPTY shift-reduce 81 code_line ::= LINE_EMPTY + LINE_EMPTY shift-reduce 79 code_line ::= LINE_EMPTY LINE_EMPTY reduce 4 ** Parsing conflict ** code_line shift-reduce 27 indented_code ::= indented_code code_line indented_line shift-reduce 27 indented_code ::= indented_code code_line /* because indented_line==code_line */ {default} reduce 4 block ::= indented_code -State 14: +State 13: meta_block ::= LINE_META * meta_lines - (104) meta_block ::= LINE_META * + (103) 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 107 meta_line ::= LINE_CONTINUATION - LINE_META shift-reduce 106 meta_line ::= LINE_META - LINE_META reduce 104 ** Parsing conflict ** - meta_lines shift 36 - meta_line shift 36 /* because meta_line==meta_lines */ - {default} reduce 104 meta_block ::= LINE_META + LINE_CONTINUATION shift-reduce 106 meta_line ::= LINE_CONTINUATION + LINE_META shift-reduce 105 meta_line ::= LINE_META + LINE_META reduce 103 ** Parsing conflict ** + meta_lines shift 35 + meta_line shift 35 /* because meta_line==meta_lines */ + {default} reduce 103 meta_block ::= LINE_META -State 15: +State 14: fenced_block ::= LINE_FENCE_BACKTICK_START * fenced_lines LINE_FENCE_BACKTICK fenced_block ::= LINE_FENCE_BACKTICK_START * fenced_lines fenced_lines ::= * fenced_lines fenced_line @@ -541,12 +511,12 @@ State 15: fenced_line ::= * LINE_CONTINUATION fenced_line ::= * LINE_EMPTY - LINE_CONTINUATION shift-reduce 102 fenced_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 103 fenced_line ::= LINE_EMPTY - fenced_lines shift 33 - fenced_line shift 33 /* because fenced_line==fenced_lines */ + LINE_CONTINUATION shift-reduce 101 fenced_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 102 fenced_line ::= LINE_EMPTY + fenced_lines shift 32 + fenced_line shift 32 /* because fenced_line==fenced_lines */ -State 16: +State 15: fenced_block ::= LINE_FENCE_BACKTICK * fenced_lines LINE_FENCE_BACKTICK fenced_block ::= LINE_FENCE_BACKTICK * fenced_lines fenced_lines ::= * fenced_lines fenced_line @@ -554,54 +524,54 @@ State 16: fenced_line ::= * LINE_CONTINUATION fenced_line ::= * LINE_EMPTY - LINE_CONTINUATION shift-reduce 102 fenced_line ::= LINE_CONTINUATION - LINE_EMPTY shift-reduce 103 fenced_line ::= LINE_EMPTY - fenced_lines shift 34 - fenced_line shift 34 /* because fenced_line==fenced_lines */ + LINE_CONTINUATION shift-reduce 101 fenced_line ::= LINE_CONTINUATION + LINE_EMPTY shift-reduce 102 fenced_line ::= LINE_EMPTY + fenced_lines shift 33 + fenced_line shift 33 /* because fenced_line==fenced_lines */ -State 17: +State 16: html_block ::= LINE_HTML * html_block_lines - (97) html_block ::= LINE_HTML * + (96) 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 99 html_block_line ::= LINE_CONTINUATION - LINE_HTML shift-reduce 100 html_block_line ::= LINE_HTML - LINE_HTML reduce 97 ** Parsing conflict ** - html_block_lines shift 37 - html_block_line shift 37 /* because html_block_line==html_block_lines */ - {default} reduce 97 html_block ::= LINE_HTML + LINE_CONTINUATION shift-reduce 98 html_block_line ::= LINE_CONTINUATION + LINE_HTML shift-reduce 99 html_block_line ::= LINE_HTML + LINE_HTML reduce 96 ** Parsing conflict ** + html_block_lines shift 36 + html_block_line shift 36 /* because html_block_line==html_block_lines */ + {default} reduce 96 html_block ::= LINE_HTML -State 18: +State 17: blockquote ::= LINE_BLOCKQUOTE * quote_lines - (85) blockquote ::= LINE_BLOCKQUOTE * + (83) 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 88 quote_line ::= LINE_CONTINUATION - LINE_BLOCKQUOTE shift-reduce 87 quote_line ::= LINE_BLOCKQUOTE - LINE_BLOCKQUOTE reduce 85 ** Parsing conflict ** - quote_lines shift 38 - quote_line shift 38 /* because quote_line==quote_lines */ - {default} reduce 85 blockquote ::= LINE_BLOCKQUOTE + LINE_CONTINUATION shift-reduce 86 quote_line ::= LINE_CONTINUATION + LINE_BLOCKQUOTE shift-reduce 85 quote_line ::= LINE_BLOCKQUOTE + LINE_BLOCKQUOTE reduce 83 ** Parsing conflict ** + quote_lines shift 37 + quote_line shift 37 /* because quote_line==quote_lines */ + {default} reduce 83 blockquote ::= LINE_BLOCKQUOTE -State 19: +State 18: para_lines ::= * para_lines para_line para_lines ::= * para_line para_line ::= * LINE_CONTINUATION def_link ::= LINE_DEF_LINK * para_lines - (96) def_link ::= LINE_DEF_LINK * + (95) def_link ::= LINE_DEF_LINK * - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - para_lines shift 39 - para_line shift 39 /* because para_line==para_lines */ - {default} reduce 96 def_link ::= LINE_DEF_LINK + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION + para_lines shift 38 + para_line shift 38 /* because para_line==para_lines */ + {default} reduce 95 def_link ::= LINE_DEF_LINK -State 20: +State 19: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY cont_blocks ::= cont_blocks * cont_block @@ -610,13 +580,13 @@ State 20: cont_block ::= * empty (55) def_footnote ::= LINE_DEF_FOOTNOTE cont_blocks * - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 55 ** Parsing conflict ** - empty shift 35 + empty shift 34 cont_block shift-reduce 41 cont_blocks ::= cont_blocks cont_block {default} reduce 55 def_footnote ::= LINE_DEF_FOOTNOTE cont_blocks -State 21: +State 20: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY cont_blocks ::= cont_blocks * cont_block @@ -625,13 +595,13 @@ State 21: cont_block ::= * empty (53) def_footnote ::= LINE_DEF_FOOTNOTE para_lines cont_blocks * - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 53 ** Parsing conflict ** - empty shift 35 + empty shift 34 cont_block shift-reduce 41 cont_blocks ::= cont_blocks cont_block {default} reduce 53 def_footnote ::= LINE_DEF_FOOTNOTE para_lines cont_blocks -State 22: +State 21: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY cont_blocks ::= cont_blocks * cont_block @@ -640,13 +610,13 @@ State 22: cont_block ::= * empty (52) def_citation ::= LINE_DEF_CITATION cont_blocks * - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 52 ** Parsing conflict ** - empty shift 35 + empty shift 34 cont_block shift-reduce 41 cont_blocks ::= cont_blocks cont_block {default} reduce 52 def_citation ::= LINE_DEF_CITATION cont_blocks -State 23: +State 22: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY cont_blocks ::= cont_blocks * cont_block @@ -655,48 +625,50 @@ State 23: cont_block ::= * empty (50) def_citation ::= LINE_DEF_CITATION para_lines cont_blocks * - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 50 ** Parsing conflict ** - empty shift 35 + empty shift 34 cont_block shift-reduce 41 cont_blocks ::= cont_blocks cont_block {default} reduce 50 def_citation ::= LINE_DEF_CITATION para_lines cont_blocks -State 24: - table ::= table_header * table_body LINE_EMPTY - table ::= table_header * table_body - table_body ::= * table_body LINE_EMPTY table_section - table_body ::= * table_section - table_section ::= * table_section LINE_TABLE - table_section ::= * LINE_TABLE - - LINE_TABLE shift-reduce 93 table_section ::= LINE_TABLE - table_body shift 51 - table_section shift 49 +State 23: + table_section ::= * table_rows LINE_EMPTY + table_section ::= * table_rows + (47) table ::= table_header table_body * + table_body ::= table_body * table_section + table_rows ::= * table_rows LINE_TABLE + table_rows ::= * LINE_TABLE + + LINE_TABLE shift-reduce 92 table_rows ::= LINE_TABLE + LINE_TABLE reduce 47 ** Parsing conflict ** + table_rows shift 46 + table_section shift-reduce 48 table_body ::= table_body table_section + {default} reduce 47 table ::= table_header table_body -State 25: +State 24: definition ::= para * defs defs ::= * defs def defs ::= * def def ::= * LINE_DEFINITION def_lines def ::= * LINE_DEFINITION - LINE_DEFINITION shift 47 - defs shift 48 - def shift 48 /* because def==defs */ + LINE_DEFINITION shift 44 + defs shift 45 + def shift 45 /* because def==defs */ -State 26: +State 25: para ::= LINE_PLAIN * para_lines - (76) para ::= LINE_PLAIN * + (74) para ::= LINE_PLAIN * para_lines ::= * para_lines para_line para_lines ::= * para_line para_line ::= * LINE_CONTINUATION - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - para_lines shift 42 - para_line shift 42 /* because para_line==para_lines */ - {default} reduce 76 para ::= LINE_PLAIN + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION + para_lines shift 39 + para_line shift 39 /* because para_line==para_lines */ + {default} reduce 74 para ::= LINE_PLAIN -State 27: +State 26: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY (39) item_enumerated ::= LINE_LIST_ENUMERATED cont_blocks * @@ -705,13 +677,13 @@ State 27: cont_block ::= * empty indented_line cont_block ::= * empty - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 39 ** Parsing conflict ** - empty shift 35 + empty shift 34 cont_block shift-reduce 41 cont_blocks ::= cont_blocks cont_block {default} reduce 39 item_enumerated ::= LINE_LIST_ENUMERATED cont_blocks -State 28: +State 27: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY (37) item_enumerated ::= LINE_LIST_ENUMERATED para_lines cont_blocks * @@ -720,13 +692,13 @@ State 28: cont_block ::= * empty indented_line cont_block ::= * empty - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 37 ** Parsing conflict ** - empty shift 35 + empty shift 34 cont_block shift-reduce 41 cont_blocks ::= cont_blocks cont_block {default} reduce 37 item_enumerated ::= LINE_LIST_ENUMERATED para_lines cont_blocks -State 29: +State 28: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY (34) item_bulleted ::= LINE_LIST_BULLETED cont_blocks * @@ -735,13 +707,13 @@ State 29: cont_block ::= * empty indented_line cont_block ::= * empty - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 34 ** Parsing conflict ** - empty shift 35 + empty shift 34 cont_block shift-reduce 41 cont_blocks ::= cont_blocks cont_block {default} reduce 34 item_bulleted ::= LINE_LIST_BULLETED cont_blocks -State 30: +State 29: empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY (32) item_bulleted ::= LINE_LIST_BULLETED para_lines cont_blocks * @@ -750,25 +722,25 @@ State 30: cont_block ::= * empty indented_line cont_block ::= * empty - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 32 ** Parsing conflict ** - empty shift 35 + empty shift 34 cont_block shift-reduce 41 cont_blocks ::= cont_blocks cont_block {default} reduce 32 item_bulleted ::= LINE_LIST_BULLETED para_lines cont_blocks -State 31: +State 30: para_lines ::= * para_lines para_line para_lines ::= * para_line para_line ::= * LINE_CONTINUATION cont_block ::= empty indented_line * para_lines (43) cont_block ::= empty indented_line * - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - para_lines shift 45 - para_line shift 45 /* because para_line==para_lines */ + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION + para_lines shift 42 + para_line shift 42 /* because para_line==para_lines */ {default} reduce 43 cont_block ::= empty indented_line -State 32: +State 31: (3) block ::= para * definition ::= para * defs defs ::= * defs def @@ -776,145 +748,125 @@ State 32: def ::= * LINE_DEFINITION def_lines def ::= * LINE_DEFINITION - LINE_DEFINITION shift 47 - defs shift 48 - def shift 48 /* because def==defs */ + LINE_DEFINITION shift 44 + defs shift 45 + def shift 45 /* because def==defs */ {default} reduce 3 block ::= para -State 33: +State 32: fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines * LINE_FENCE_BACKTICK (62) 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 102 fenced_line ::= LINE_CONTINUATION + LINE_CONTINUATION shift-reduce 101 fenced_line ::= LINE_CONTINUATION LINE_FENCE_BACKTICK shift-reduce 61 fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK reduce 62 ** Parsing conflict ** - LINE_EMPTY shift-reduce 103 fenced_line ::= LINE_EMPTY + LINE_EMPTY shift-reduce 102 fenced_line ::= LINE_EMPTY LINE_EMPTY reduce 62 ** Parsing conflict ** fenced_line shift-reduce 63 fenced_lines ::= fenced_lines fenced_line {default} reduce 62 fenced_block ::= LINE_FENCE_BACKTICK_START fenced_lines -State 34: +State 33: fenced_block ::= LINE_FENCE_BACKTICK fenced_lines * LINE_FENCE_BACKTICK (60) 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 102 fenced_line ::= LINE_CONTINUATION + LINE_CONTINUATION shift-reduce 101 fenced_line ::= LINE_CONTINUATION LINE_FENCE_BACKTICK shift-reduce 59 fenced_block ::= LINE_FENCE_BACKTICK fenced_lines LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK reduce 60 ** Parsing conflict ** - LINE_EMPTY shift-reduce 103 fenced_line ::= LINE_EMPTY + LINE_EMPTY shift-reduce 102 fenced_line ::= LINE_EMPTY LINE_EMPTY reduce 60 ** Parsing conflict ** fenced_line shift-reduce 63 fenced_lines ::= fenced_lines fenced_line {default} reduce 60 fenced_block ::= LINE_FENCE_BACKTICK fenced_lines -State 35: +State 34: indented_line ::= * LINE_INDENTED_TAB indented_line ::= * LINE_INDENTED_SPACE empty ::= empty * LINE_EMPTY cont_block ::= empty * indented_line para_lines cont_block ::= empty * indented_line - (92) cont_block ::= empty * + (90) cont_block ::= empty * - LINE_INDENTED_TAB shift-reduce 82 indented_line ::= LINE_INDENTED_TAB - LINE_INDENTED_TAB reduce 92 ** Parsing conflict ** - LINE_INDENTED_SPACE shift-reduce 83 indented_line ::= LINE_INDENTED_SPACE - LINE_INDENTED_SPACE reduce 92 ** Parsing conflict ** + LINE_INDENTED_TAB shift-reduce 80 indented_line ::= LINE_INDENTED_TAB + LINE_INDENTED_TAB reduce 90 ** Parsing conflict ** + LINE_INDENTED_SPACE shift-reduce 81 indented_line ::= LINE_INDENTED_SPACE + LINE_INDENTED_SPACE reduce 90 ** Parsing conflict ** LINE_EMPTY shift-reduce 28 empty ::= empty LINE_EMPTY - LINE_EMPTY reduce 92 ** Parsing conflict ** - indented_line shift 31 - {default} reduce 92 cont_block ::= empty + LINE_EMPTY reduce 90 ** Parsing conflict ** + indented_line shift 30 + {default} reduce 90 cont_block ::= empty -State 36: +State 35: (64) meta_block ::= LINE_META meta_lines * meta_lines ::= meta_lines * meta_line meta_line ::= * LINE_META meta_line ::= * LINE_CONTINUATION - LINE_CONTINUATION shift-reduce 107 meta_line ::= LINE_CONTINUATION - LINE_META shift-reduce 106 meta_line ::= LINE_META + LINE_CONTINUATION shift-reduce 106 meta_line ::= LINE_CONTINUATION + LINE_META shift-reduce 105 meta_line ::= LINE_META LINE_META reduce 64 ** Parsing conflict ** meta_line shift-reduce 65 meta_lines ::= meta_lines meta_line {default} reduce 64 meta_block ::= LINE_META meta_lines -State 37: +State 36: (57) 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 99 html_block_line ::= LINE_CONTINUATION - LINE_HTML shift-reduce 100 html_block_line ::= LINE_HTML + LINE_CONTINUATION shift-reduce 98 html_block_line ::= LINE_CONTINUATION + LINE_HTML shift-reduce 99 html_block_line ::= LINE_HTML LINE_HTML reduce 57 ** Parsing conflict ** html_block_line shift-reduce 58 html_block_lines ::= html_block_lines html_block_line {default} reduce 57 html_block ::= LINE_HTML html_block_lines -State 38: +State 37: (29) blockquote ::= LINE_BLOCKQUOTE quote_lines * quote_lines ::= quote_lines * quote_line quote_line ::= * LINE_BLOCKQUOTE quote_line ::= * LINE_CONTINUATION - LINE_CONTINUATION shift-reduce 88 quote_line ::= LINE_CONTINUATION - LINE_BLOCKQUOTE shift-reduce 87 quote_line ::= LINE_BLOCKQUOTE + LINE_CONTINUATION shift-reduce 86 quote_line ::= LINE_CONTINUATION + LINE_BLOCKQUOTE shift-reduce 85 quote_line ::= LINE_BLOCKQUOTE LINE_BLOCKQUOTE reduce 29 ** Parsing conflict ** quote_line shift-reduce 30 quote_lines ::= quote_lines quote_line {default} reduce 29 blockquote ::= LINE_BLOCKQUOTE quote_lines -State 39: +State 38: para_lines ::= para_lines * para_line para_line ::= * LINE_CONTINUATION (56) def_link ::= LINE_DEF_LINK para_lines * - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION para_line shift-reduce 26 para_lines ::= para_lines para_line {default} reduce 56 def_link ::= LINE_DEF_LINK para_lines -State 40: - (44) table ::= table_header table_body LINE_EMPTY * - table_body ::= table_body LINE_EMPTY * table_section - table_section ::= * table_section LINE_TABLE - table_section ::= * LINE_TABLE - - LINE_TABLE shift-reduce 93 table_section ::= LINE_TABLE - LINE_TABLE reduce 44 ** Parsing conflict ** - table_section shift 50 - {default} reduce 44 table ::= table_header table_body LINE_EMPTY - -State 41: - para_lines ::= para_lines * para_line - para_line ::= * LINE_CONTINUATION - (74) para ::= table_section para_lines * - - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION - para_line shift-reduce 26 para_lines ::= para_lines para_line - {default} reduce 74 para ::= table_section para_lines - -State 42: +State 39: (25) para ::= LINE_PLAIN para_lines * para_lines ::= para_lines * para_line para_line ::= * LINE_CONTINUATION - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION para_line shift-reduce 26 para_lines ::= para_lines para_line {default} reduce 25 para ::= LINE_PLAIN para_lines -State 43: +State 40: (24) block ::= definition_block * empty ::= * empty LINE_EMPTY empty ::= * LINE_EMPTY definition_block ::= definition_block * empty definition definition_block ::= definition_block * empty - LINE_EMPTY shift-reduce 84 empty ::= LINE_EMPTY + LINE_EMPTY shift-reduce 82 empty ::= LINE_EMPTY LINE_EMPTY reduce 24 ** Parsing conflict ** empty shift 10 {default} reduce 24 block ::= definition_block -State 44: +State 41: (13) block ::= list_enumerated * list_enumerated ::= list_enumerated * item_enumerated item_enumerated ::= * LINE_LIST_ENUMERATED para_lines cont_blocks @@ -927,16 +879,16 @@ State 44: item_enumerated shift-reduce 36 list_enumerated ::= list_enumerated item_enumerated {default} reduce 13 block ::= list_enumerated -State 45: +State 42: para_lines ::= para_lines * para_line para_line ::= * LINE_CONTINUATION (42) cont_block ::= empty indented_line para_lines * - LINE_CONTINUATION shift-reduce 78 para_line ::= LINE_CONTINUATION + LINE_CONTINUATION shift-reduce 76 para_line ::= LINE_CONTINUATION para_line shift-reduce 26 para_lines ::= para_lines para_line {default} reduce 42 cont_block ::= empty indented_line para_lines -State 46: +State 43: (12) block ::= list_bulleted * list_bulleted ::= list_bulleted * item_bulleted item_bulleted ::= * LINE_LIST_BULLETED para_lines cont_blocks @@ -949,52 +901,55 @@ State 46: item_bulleted shift-reduce 31 list_bulleted ::= list_bulleted item_bulleted {default} reduce 12 block ::= list_bulleted -State 47: +State 44: def ::= LINE_DEFINITION * def_lines (71) def ::= LINE_DEFINITION * def_lines ::= * def_lines LINE_CONTINUATION def_lines ::= * LINE_CONTINUATION - LINE_CONTINUATION shift-reduce 110 def_lines ::= LINE_CONTINUATION - def_lines shift 53 + LINE_CONTINUATION shift-reduce 109 def_lines ::= LINE_CONTINUATION + def_lines shift 50 {default} reduce 71 def ::= LINE_DEFINITION -State 48: +State 45: (68) definition ::= para defs * defs ::= defs * def def ::= * LINE_DEFINITION def_lines def ::= * LINE_DEFINITION - LINE_DEFINITION shift 47 + LINE_DEFINITION shift 44 def shift-reduce 69 defs ::= defs def {default} reduce 68 definition ::= para defs -State 49: - (48) table_body ::= table_section * - table_section ::= table_section * LINE_TABLE +State 46: + table_section ::= table_rows * LINE_EMPTY + (46) table_section ::= table_rows * + table_rows ::= table_rows * LINE_TABLE - LINE_TABLE shift-reduce 49 table_section ::= table_section LINE_TABLE - LINE_TABLE reduce 48 ** Parsing conflict ** - {default} reduce 48 table_body ::= table_section + LINE_TABLE shift-reduce 49 table_rows ::= table_rows LINE_TABLE + LINE_TABLE reduce 46 ** Parsing conflict ** + LINE_EMPTY shift-reduce 45 table_section ::= table_rows LINE_EMPTY + LINE_EMPTY reduce 46 ** Parsing conflict ** + {default} reduce 46 table_section ::= table_rows -State 50: - (47) table_body ::= table_body LINE_EMPTY table_section * - table_section ::= table_section * LINE_TABLE +State 47: + table_header ::= table_rows * LINE_TABLE_SEPARATOR + table_rows ::= table_rows * LINE_TABLE + (73) para ::= table_rows * - LINE_TABLE shift-reduce 49 table_section ::= table_section LINE_TABLE - LINE_TABLE reduce 47 ** Parsing conflict ** - {default} reduce 47 table_body ::= table_body LINE_EMPTY table_section + LINE_TABLE_SEPARATOR shift-reduce 44 table_header ::= table_rows LINE_TABLE_SEPARATOR + LINE_TABLE shift-reduce 49 table_rows ::= table_rows LINE_TABLE + LINE_TABLE reduce 73 ** Parsing conflict ** + {default} reduce 73 para ::= table_rows -State 51: - table ::= table_header table_body * LINE_EMPTY - (45) table ::= table_header table_body * - table_body ::= table_body * LINE_EMPTY table_section +State 48: + table_rows ::= table_rows * LINE_TABLE + (73) para ::= table_rows * - LINE_EMPTY shift 40 - LINE_EMPTY reduce 45 ** Parsing conflict ** - {default} reduce 45 table ::= table_header table_body + LINE_TABLE shift-reduce 49 table_rows ::= table_rows LINE_TABLE + {default} reduce 73 para ::= table_rows -State 52: +State 49: (11) block ::= empty * empty ::= empty * LINE_EMPTY @@ -1002,7 +957,7 @@ State 52: LINE_EMPTY reduce 11 ** Parsing conflict ** {default} reduce 11 block ::= empty -State 53: +State 50: (70) def ::= LINE_DEFINITION def_lines * def_lines ::= def_lines * LINE_CONTINUATION @@ -1017,18 +972,18 @@ Symbols: 3: LINE_CONTINUATION 4: LINE_INDENTED_TAB 5: LINE_INDENTED_SPACE - 6: LINE_HTML - 7: LINE_ATX_1 - 8: LINE_ATX_2 - 9: LINE_ATX_3 - 10: LINE_ATX_4 - 11: LINE_ATX_5 - 12: LINE_ATX_6 - 13: LINE_HR - 14: LINE_BLOCKQUOTE - 15: LINE_LIST_BULLETED - 16: LINE_LIST_ENUMERATED - 17: LINE_TABLE + 6: LINE_TABLE + 7: LINE_HTML + 8: LINE_ATX_1 + 9: LINE_ATX_2 + 10: LINE_ATX_3 + 11: LINE_ATX_4 + 12: LINE_ATX_5 + 13: LINE_ATX_6 + 14: LINE_HR + 15: LINE_BLOCKQUOTE + 16: LINE_LIST_BULLETED + 17: LINE_LIST_ENUMERATED 18: LINE_DEF_CITATION 19: LINE_DEF_FOOTNOTE 20: LINE_DEF_LINK @@ -1039,9 +994,9 @@ Symbols: 25: LINE_META 26: LINE_DEFINITION 27: error: - 28: 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 - 29: 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 - 30: 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 + 28: doc: LINE_PLAIN LINE_INDENTED_TAB LINE_INDENTED_SPACE LINE_TABLE 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_DEF_CITATION LINE_DEF_FOOTNOTE LINE_DEF_LINK LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK_START LINE_TOC LINE_EMPTY LINE_META + 29: blocks: LINE_PLAIN LINE_INDENTED_TAB LINE_INDENTED_SPACE LINE_TABLE 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_DEF_CITATION LINE_DEF_FOOTNOTE LINE_DEF_LINK LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK_START LINE_TOC LINE_EMPTY LINE_META + 30: block: LINE_PLAIN LINE_INDENTED_TAB LINE_INDENTED_SPACE LINE_TABLE 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_DEF_CITATION LINE_DEF_FOOTNOTE LINE_DEF_LINK LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK_START LINE_TOC LINE_EMPTY LINE_META 31: para: LINE_PLAIN LINE_TABLE 32: indented_code: LINE_INDENTED_TAB LINE_INDENTED_SPACE 33: empty: LINE_EMPTY @@ -1067,15 +1022,16 @@ Symbols: 53: item_enumerated: LINE_LIST_ENUMERATED 54: cont_block: LINE_EMPTY 55: table_header: LINE_TABLE - 56: table_body: LINE_TABLE + 56: table_rows: LINE_TABLE 57: table_section: LINE_TABLE - 58: html_block_lines: LINE_CONTINUATION LINE_HTML - 59: html_block_line: LINE_CONTINUATION LINE_HTML - 60: fenced_lines: LINE_CONTINUATION LINE_EMPTY - 61: fenced_line: LINE_CONTINUATION LINE_EMPTY - 62: meta_lines: LINE_CONTINUATION LINE_META - 63: meta_line: LINE_CONTINUATION LINE_META - 64: definition: LINE_PLAIN LINE_TABLE - 65: defs: LINE_DEFINITION - 66: def: LINE_DEFINITION - 67: def_lines: LINE_CONTINUATION + 58: table_body: LINE_TABLE + 59: html_block_lines: LINE_CONTINUATION LINE_HTML + 60: html_block_line: LINE_CONTINUATION LINE_HTML + 61: fenced_lines: LINE_CONTINUATION LINE_EMPTY + 62: fenced_line: LINE_CONTINUATION LINE_EMPTY + 63: meta_lines: LINE_CONTINUATION LINE_META + 64: meta_line: LINE_CONTINUATION LINE_META + 65: definition: LINE_PLAIN LINE_TABLE + 66: defs: LINE_DEFINITION + 67: def: LINE_DEFINITION + 68: def_lines: LINE_CONTINUATION diff --git a/src/parser.y b/src/parser.y index 752fb84..d7dc2b1 100644 --- a/src/parser.y +++ b/src/parser.y @@ -64,9 +64,9 @@ %fallback LINE_PLAIN LINE_TABLE_SEPARATOR. -%fallback LINE_CONTINUATION LINE_PLAIN LINE_INDENTED_TAB LINE_INDENTED_SPACE. +%fallback LINE_CONTINUATION LINE_PLAIN LINE_INDENTED_TAB LINE_INDENTED_SPACE LINE_TABLE. -%fallback 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. +%fallback 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_DEF_CITATION LINE_DEF_FOOTNOTE LINE_DEF_LINK LINE_FENCE_BACKTICK LINE_FENCE_BACKTICK_START. doc ::= blocks(B). { engine->root = B; } @@ -165,16 +165,20 @@ cont_block(A) ::= empty(B) indented_line(C) para_lines(D).{ A = B; token_chain_ cont_block(A) ::= empty(B) indented_line(C). { A = B; token_chain_append(B, C); C->type = LINE_CONTINUATION; } cont_block ::= empty. -table(A) ::= table_header(B) table_body(C) LINE_EMPTY(D). { A = B; token_chain_append(B, C); token_chain_append(B, D); } + +table_header(A) ::= table_rows(B) LINE_TABLE_SEPARATOR(C). { A = token_new_parent(B, BLOCK_TABLE_HEADER); token_chain_append(B, C); } +table_section(A) ::= table_rows(B) LINE_EMPTY(C). { A = token_new_parent(B, BLOCK_TABLE_SECTION); token_chain_append(B, C); } +table_section(A) ::= table_rows(B). { A = token_new_parent(B, BLOCK_TABLE_SECTION); } + + table(A) ::= table_header(B) table_body(C). { A = B; token_chain_append(B, C); } -table_header(A) ::= table_section(B) LINE_TABLE_SEPARATOR(C). { A = token_new_parent(B, BLOCK_TABLE_HEADER); token_chain_append(B, C); } +table_body(A) ::= table_body(B) table_section(C). { A = B; token_chain_append(B, C); } +table_body ::= table_section. -table_body(A) ::= table_body(B) LINE_EMPTY(C) table_section(D). { A = B; token_chain_append(B, C); token_chain_append(B, token_new_parent(D, BLOCK_TABLE_SECTION)); } -table_body(A) ::= table_section(B). { A = token_new_parent(B, BLOCK_TABLE_SECTION); } +table_rows(A) ::= table_rows(B) LINE_TABLE(C). { A = B; token_chain_append(B, C); } +table_rows ::= LINE_TABLE. -table_section(A) ::= table_section(B) LINE_TABLE(C). { A = B; token_chain_append(B, C); } -table_section ::= LINE_TABLE. def_citation(A) ::= LINE_DEF_CITATION(B) para_lines(C) cont_blocks(D). { A = B; token_chain_append(B, C); token_chain_append(B, D); } def_citation(A) ::= LINE_DEF_CITATION(B) para_lines(C). { A = B; token_chain_append(B, C); } @@ -238,9 +242,9 @@ def_lines ::= LINE_CONTINUATION. // Fallbacks for improper structures -para(A) ::= table_section(B) LINE_EMPTY(C). { A = B; token_chain_append(B, C); } -para(A) ::= table_section(B) para_lines(C). { A = B; token_chain_append(B, C); } -para(A) ::= table_section(B). { A = B; } +// para(A) ::= table_section(B) LINE_EMPTY(C). { A = B; token_chain_append(B, C); } +// para(A) ::= table_section(B) para_lines(C). { A = B; token_chain_append(B, C); } +para(A) ::= table_rows(B). { A = B; } diff --git a/templates/README.md.in b/templates/README.md.in index 834e4b1..b544d48 100644 --- a/templates/README.md.in +++ b/templates/README.md.in @@ -29,6 +29,8 @@ * "pathologic" test suite -- fix handling of nested brackets, e.g. `[[[[foo]]]]` to avoid bogging down checking for reference links that don't exist. + * Table support + * Definition list support ## An Announcement! ## diff --git a/tests/MMD6Tests/Tables.html b/tests/MMD6Tests/Tables.html index 4e4c245..7ee3ec1 100644 --- a/tests/MMD6Tests/Tables.html +++ b/tests/MMD6Tests/Tables.html @@ -1,44 +1,126 @@ -+ + + + + + + + + + + + + + + + + + +
Prototype table
foo bar
foo bar
foo bar
+ + ++ - - + + + + + + + + + - - - + + + +
Grouping foo1 bar1
foo bar
First Header Second Header Third Header foo bar
+ + ++++ + + + + + - - + + - - - + - - - + + + + + + + + + + + +
foo2 bar2
Content Long Cell foo bar
Content Cell Cell foo bar
New section More Data foo3 bar3
foo bar
foo bar
+ +

| foo4 | bar4 |
+foo | bar |
+| foo bar ||

+ +

5

+ + ++++ + + + + + + + + + + + + - - + + + + + + + +
foo5 bar5
foo bar
And more With an escaped ‘|’ foo bar |
foo6 bar6
+ +

| :—- | —-: | +foo | bar | +| foo bar ||

diff --git a/tests/MMD6Tests/Tables.htmlc b/tests/MMD6Tests/Tables.htmlc index 06c07d9..8a80926 100644 --- a/tests/MMD6Tests/Tables.htmlc +++ b/tests/MMD6Tests/Tables.htmlc @@ -1,9 +1,34 @@ -

| | Grouping || -First Header | Second Header | Third Header | ------------- | :-----------: | -----------: | -Content | Long Cell || -| Content | Cell | Cell |

- -

New section | More | Data -And more || With an escaped '|' |
-[Prototype table]

+

| foo | bar |
+| ------ | :------: |
+| foo | bar |
+| foo bar ||

+ +

| foo1 | bar1 | +| :---+ | ----: | +foo | bar | +| foo bar ||

+ +

| foo2 | bar2 | +| :---- | ----: | +foo | bar | +| foo bar ||

+ +

| foo3 | bar3 |
+foo | bar |
+| foo bar ||

+ +

| foo4 | bar4 |
+foo | bar |
+| foo bar ||

+ +

5

+ +

| foo5 | bar5 |
+| :---- | ------: |
+foo | bar |
+| foo bar | ||

+ +

| foo6 | bar6 | +| :---- | ----: | +foo | bar | +| foo bar ||

diff --git a/tests/MMD6Tests/Tables.text b/tests/MMD6Tests/Tables.text index d5b1151..696e78f 100644 --- a/tests/MMD6Tests/Tables.text +++ b/tests/MMD6Tests/Tables.text @@ -1,10 +1,37 @@ -[Prototype table] -| | Grouping || -First Header | Second Header | Third Header | - ------------ | :-----------: | -----------: | -Content | *Long Cell* || -| Content | **Cell** | Cell | - -New section | More | Data -And more || With an escaped '\|' | -[Prototype table] +| foo | bar | +| ------ | :------: | +| *foo* | *bar* | +| **foo bar** || + + +| foo1 | bar1 | +| :---+ | ----: | + *foo* | *bar* | +| **foo bar** || + + +| foo2 | bar2 | +| :---- | ----: | + *foo* | *bar* | +| **foo bar** || + +| foo3 | bar3 | + *foo* | *bar* | +| **foo bar** || + + +| foo4 | bar4 | + *foo* | *bar* | +| **foo bar** || + +5 + +| foo5 | bar5 | +| :---- | ------: | + *foo* | *bar* | +| **foo bar** \| || + +| foo6 | bar6 | +| :---- | ----: | + *foo* | *bar* | +| **foo bar** || \ No newline at end of file