summaryrefslogtreecommitdiff
path: root/rst_parser.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-19 20:52:34 +0200
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-19 20:52:34 +0200
commit487ca9d3573b38f33e66b5ec120b938ce0d51dc3 (patch)
tree4d77828788cace8fe0ea723e4538a1b555f148a2 /rst_parser.lua
parent7358c6bd092cf39fee1e73420aa7f9687c8833dd (diff)
downloadcontext-rst-487ca9d3573b38f33e66b5ec120b938ce0d51dc3.tar.gz
cleaning sweep throug subtitutions and directives. “caution” and “danger” directives.
Diffstat (limited to 'rst_parser.lua')
-rw-r--r--rst_parser.lua16
1 files changed, 10 insertions, 6 deletions
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)