From 487ca9d3573b38f33e66b5ec120b938ce0d51dc3 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 19 Sep 2010 20:52:34 +0200 Subject: =?UTF-8?q?cleaning=20sweep=20throug=20subtitutions=20and=20direct?= =?UTF-8?q?ives.=20=E2=80=9Ccaution=E2=80=9D=20and=20=E2=80=9Cdanger?= =?UTF-8?q?=E2=80=9D=20directives.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rst_parser.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'rst_parser.lua') diff --git a/rst_parser.lua b/rst_parser.lua index 7d604aa..7162597 100644 --- a/rst_parser.lua +++ b/rst_parser.lua @@ -149,7 +149,6 @@ local parser = P{ , explicit_markup_block = V"explicit_markup"^1 - * V"end_block" , -------------------------------------------------------------------------------- @@ -162,7 +161,7 @@ local parser = P{ , directive = V"explicit_markup_start" - * C((V"escaped_colon" + (1 - V"colon" - V"eol"))^1) + * C(((V"escaped_colon" + (1 - V"colon" - V"eol")) - V"substitution_text")^1) * V"double_colon" * (V"directive_block_multi" + V"directive_block_single") / rst.directive @@ -179,16 +178,20 @@ local parser = P{ -------------------------------------------------------------------------------- substitution_definition = V"explicit_markup_start" - * V"bar" - * C((1 - V"bar" - V"eol")^1) -- substitution text - * V"bar" + * V"substitution_text" * V"whitespace" * C((1 - V"colon" - V"space" - V"eol")^1) -- directive * V"double_colon" * Ct(V"data_directive_block") + * V"end_block"^-1 / rst.substitution_definition , + substitution_text = V"bar" + * C((1 - V"bar" - V"eol")^1) + * V"bar" + , + data_directive_block = V"data_directive_block_long" + V"data_directive_block_short" , @@ -1081,7 +1084,8 @@ local parser = P{ par_other = V"par_matchindent" * C((1 - V"literal_block_shorthand" - V"eol")^1) - * (V"included_literal_block" + V"eol"), + * (V"included_literal_block" + V"eol") + , par_setindent = Cmt(V"space"^0, function (s, i, indent) warn("par-i", #indent, "", "", i) -- cgit v1.2.3