diff options
Diffstat (limited to 'rst_parser.lua')
-rw-r--r-- | rst_parser.lua | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/rst_parser.lua b/rst_parser.lua index 470b789..c489849 100644 --- a/rst_parser.lua +++ b/rst_parser.lua @@ -582,9 +582,11 @@ local parser = P{ -------------------------------------------------------------------------------- paragraph = -(V"double_dot" + V"double_underscore") -- + V"bullet_indent") - * Cs((V"enclosed_inline" + * Cs((V"included_literal_block" + + V"enclosed_inline" + V"inline_elements" + V"word" + + V"punctuation" + (V"eol" - V"endpar") + V"spacing")^1) * V"endpar" @@ -663,6 +665,19 @@ local parser = P{ _reference = (1 - V"underscore" - V"spacing" - V"eol" - V"punctuation" - V"groupchars")^1 * V"underscore", + included_literal_block = V"literal_block_shorthand" + * V"literal_block_markerless", + + literal_block_shorthand = ((V"colon" * V"space"^1)^-1 + * V"double_colon") / ":" + * (V"eol" * V"blank_line" / "") + , + + literal_block_markerless = Cs(V"literal_block_lines" + * (V"blank_line"^1 * V"literal_block_lines")^0) + * V"blank_line"^0 + / rst.literal_block, + -------------------------------------------------------------------------------- -- Comments -------------------------------------------------------------------------------- @@ -721,7 +736,7 @@ local parser = P{ -- Terminal Symbols and Low-Level Elements -------------------------------------------------------------------------------- - word = (1 - V"endpar" - V"spacing" - V"eol")^1, -- TODO : no punctuation (later) + word = (1 - V"punctuation" - V"endpar" - V"spacing" - V"eol")^1, -- TODO : no punctuation (later) asterisk = P"*", double_asterisk = V"asterisk" * V"asterisk", |