summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-16 19:57:49 +0200
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-16 19:57:49 +0200
commitc45e21547a2a471ab2147494f505001269374480 (patch)
tree1ed2d5232c4391a63f2248ca05288b2470739598
parent95482834c8a7a99f677fc6ffafd72399d157f58d (diff)
downloadcontext-rst-c45e21547a2a471ab2147494f505001269374480.tar.gz
fixed grouped single-line comments
-rw-r--r--rst_context.lua3
-rw-r--r--rst_parser.lua7
2 files changed, 6 insertions, 4 deletions
diff --git a/rst_context.lua b/rst_context.lua
index 3107a29..00b93f5 100644
--- a/rst_context.lua
+++ b/rst_context.lua
@@ -96,7 +96,7 @@ do
local w = S" \v\t\n" / "_"
local wp = Cs((w + 1)^1)
function rst_context.whitespace_to_underscore(str)
- return wp:match(str)
+ return str and wp:match(str) or ""
end
end
@@ -477,6 +477,7 @@ function rst_context.paragraph (data)
else
str = data
end
+ print(str)
return string.format([[
\\startparagraph
diff --git a/rst_parser.lua b/rst_parser.lua
index f5e3f28..f09e959 100644
--- a/rst_parser.lua
+++ b/rst_parser.lua
@@ -1055,16 +1055,17 @@ local parser = P{
-- Comments
--------------------------------------------------------------------------------
- comment = V"double_dot" * V"whitespace"^0
+ --comment_block = V"comment" * (V"blank_line"^-1 * V"comment")^0,
+ comment = (V"double_dot" * V"whitespace"^0) / ""
* ((V"block_comment" + V"line_comment") - V"footnote_marker" - V"bar")
,
block_comment = V"eol"
* Cs(V"indented_lines")
- * V"eol"^0
+ * V"end_block"
/ rst.block_comment,
- line_comment = Cs((1 - V"eol")^0 * V"eol")
+ line_comment = Cs((1 - V"eol")^0 * V"eol") * V"end_block"^-1
/ rst.line_comment,
--------------------------------------------------------------------------------