diff options
Diffstat (limited to 'rst_parser.lua')
-rw-r--r-- | rst_parser.lua | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/rst_parser.lua b/rst_parser.lua index b17e2fd..dec4b6b 100644 --- a/rst_parser.lua +++ b/rst_parser.lua @@ -130,10 +130,10 @@ local parser = P{ + Cs(V"line_block") / rst.escape + Cs(V"table_block") / rst.escape + V"transition" --/ rst.escape + + V"comment_block" + Cs(V"section") / rst.escape + V"literal_block" + Cs(V"block_quote") / rst.escape - + V"comment_block" + Cs(V"paragraph") / rst.escape , @@ -802,10 +802,8 @@ local parser = P{ -- the next rule handles enumerations as well bullet_list = V"bullet_init" - --* (V"bullet_list" - --+ V"bullet_continue")^0 - --* (V"bullet_continue" + V"bullet_list")^0 - * (V"blank_line"^-1 * (V"bullet_list" + V"bullet_continue"))^0 + --* ((V"blank_line" - V"end_block")^-1 * (V"bullet_list" + V"bullet_continue"))^0 + * (V"blank_line"^-1 * (V"bullet_list" + V"bullet_continue" + V"comment"))^0 * V"bullet_stop" * Cmt(Cc(nil), function (s, i) local t = state @@ -817,7 +815,7 @@ local parser = P{ end), --bullet_stop = V"blank_line" * Cs(Cc("")) / rst.stopitemize, - bullet_stop = V"end_block" * Cs(Cc("")) / rst.stopitemize, + bullet_stop = V"end_block" / rst.stopitemize, bullet_init = V"bullet_first" * V"bullet_itemrest", @@ -897,7 +895,8 @@ local parser = P{ bullet_rest = Cs((1 - V"eol")^1 * V"eol"), -- rest of one line - bullet_next = V"space"^1, + bullet_next = V"space"^1 + , bullet_match = #Cmt(V"bullet_next", function (s, i, this) local t = state @@ -906,7 +905,8 @@ local parser = P{ string.len(this) == utf.len(t.bullets[t.depth]), utf.len(t.bullets[t.depth]), string.len(this) ) return string.len(this) == utf.len(t.bullets[t.depth]) - end), + end) + , bullet_expr = V"bullet_char" + (P"(" * V"number_char" * P")") @@ -920,7 +920,8 @@ local parser = P{ + P"#" + V"digit"^1 + R"AZ" - + R"az", + + R"az" + , -------------------------------------------------------------------------------- -- Transitions |