summaryrefslogtreecommitdiff
path: root/rst_parser.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-15 15:34:30 +0200
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-15 15:34:30 +0200
commit35b9bd9ecc9fc606f8652f20b1126e6019b96006 (patch)
treef8fc2e4f8fafcb89f579c28ec4f38a2ad4084b0f /rst_parser.lua
parent18f1a4107f48beb33fced6c7c4a770a718c15aa1 (diff)
downloadcontext-rst-35b9bd9ecc9fc606f8652f20b1126e6019b96006.tar.gz
image substitution directive
Diffstat (limited to 'rst_parser.lua')
-rw-r--r--rst_parser.lua41
1 files changed, 18 insertions, 23 deletions
diff --git a/rst_parser.lua b/rst_parser.lua
index b065bea..dd20354 100644
--- a/rst_parser.lua
+++ b/rst_parser.lua
@@ -100,7 +100,6 @@ local parser = P{
block = V"target_block"
+ Cs(V"list") / rst.escape
- + V"comment"
+ V"line_block"
+ Cs(V"table_block") / rst.escape
+ Cs(V"section") / rst.escape
@@ -108,6 +107,7 @@ local parser = P{
+ V"literal_block"
+ Cs(V"block_quote") / rst.escape
+ V"explicit_markup"
+ + V"comment"
+ Cs(V"paragraph") / rst.escape
,
@@ -123,35 +123,30 @@ local parser = P{
explicit_markup_start = V"double_dot" * V"whitespace",
explicit_markup = V"footnote_block"
- --+ V"hyperlink_target"
--+ V"directive"
- --+ V"substitution_definition"
+ + V"substitution_definition"
--+ V"comment block"
,
--------------------------------------------------------------------------------
--- Explicit markup hyperlink target
+-- Substitution definition block
--------------------------------------------------------------------------------
- --hyperlink_target_block = V"hyperlink_target"
- --* (V"blank_line"^-1 * V"hyperlink_target")^0
- --* V"end_block"
- --,
-
- --hyperlink_target = V"hl_anonymous"
- ----+ V"hl_named"
- --,
-
- --hl_anonymous = V"hl_anonymous_start"
- --* C(V"link_block")
- --,
-
- --hl_anonymous_start = (V"double_underscore"
- --+ V"double_dot" * V"space" * V"double_underscore" * V"colon")
- --* V"whitespace"
- --,
+ substitution_definition = V"explicit_markup_start"
+ * V"bar"
+ * C((1 - V"bar" - V"eol")^1) -- substitution text
+ * V"bar"
+ * V"whitespace"
+ * C((1 - V"colon" - V"space" - V"eol")^1) -- directive
+ * V"double_colon"
+ * C(V"data_directive_block")
+ * V"end_block"
+ / rst.substitution_definition
+ ,
- --link_block =
+ data_directive_block = V"rest_of_line" * V"eol"
+ * V"indented_lines"^-1 -- nothing said about definitions
+ , -- spanning multiple paragraphs
--------------------------------------------------------------------------------
-- Explicit markup footnote block
@@ -1004,7 +999,7 @@ local parser = P{
--------------------------------------------------------------------------------
comment = V"double_dot" * V"whitespace"^0
- * ((V"block_comment" + V"line_comment") - V"footnote_marker")
+ * ((V"block_comment" + V"line_comment") - V"footnote_marker" - V"bar")
,
block_comment = V"eol"