summaryrefslogtreecommitdiff
path: root/mod/tex/context
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2011-08-29 09:29:46 +0200
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2011-08-29 09:29:46 +0200
commit49f65ea2ee7f6939c9220a32641af202cccb0835 (patch)
tree4a6a4f9bc9f2141801754c92579dc9c9272cc395 /mod/tex/context
parent03bf8d3228645891312069656b4e8ab74e56f5d3 (diff)
downloadcontext-rst-49f65ea2ee7f6939c9220a32641af202cccb0835.tar.gz
Solidified Comment Blocks
Thanks to Philipp A. for the bug report!
Diffstat (limited to 'mod/tex/context')
-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