summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/tex/context/third/rst/rst_context.lua4
-rw-r--r--mod/tex/context/third/rst/rst_parser.lua21
2 files changed, 14 insertions, 11 deletions
diff --git a/mod/tex/context/third/rst/rst_context.lua b/mod/tex/context/third/rst/rst_context.lua
index 1a86da1..1ce25f0 100644
--- a/mod/tex/context/third/rst/rst_context.lua
+++ b/mod/tex/context/third/rst/rst_context.lua
@@ -889,8 +889,8 @@ end
function rst_context.block_comment (str)
return fmt([[
-\iffalse
-%s\fi
+\iffalse %% start block comment
+%s\fi %% stop block comment
]], str)
end
diff --git a/mod/tex/context/third/rst/rst_parser.lua b/mod/tex/context/third/rst/rst_parser.lua
index 19f0a10..ab80dc2 100644
--- a/mod/tex/context/third/rst/rst_parser.lua
+++ b/mod/tex/context/third/rst/rst_parser.lua
@@ -1176,20 +1176,21 @@ local parser = P{
-- Comments
--------------------------------------------------------------------------------
- comment_block = V"comment"^1
- * V"end_block"
+ comment_block = V"comment"
+ * V"end_block"^-1
,
comment = V"double_dot" / ""
* (V"block_comment" + V"line_comment")
,
- block_comment = V"eol"
- * Cs(V"indented_lines")
+ block_comment = V"whitespace"^0
+ * Cs((1 - V"eol")^0 * V"eol"
+ * V"indented_lines")
/ rst.block_comment,
line_comment = V"whitespace"^1
- * Cs((1 - V"eol")^0 * V"eol")
+ * C((1 - V"eol")^0 * V"eol")
/ rst.line_comment
,
@@ -1206,16 +1207,18 @@ local parser = P{
warn("idt-f", indent, i)
state.currentindent = indent
return true
- end)
+ end) / ""
* (1 - V"eol")^1
- * V"eol",
+ * V"eol"
+ ,
indented_other = Cmt(V"space"^1, function (s, i, indent)
warn("idt-m", #indent, #state.currentindent, #indent == #state.currentindent, i)
return indent == state.currentindent
- end)
+ end) / ""
* (1 - V"eol")^1
- * V"eol",
+ * V"eol"
+ ,
--------------------------------------------------------------------------------
-- Urls