summary refs log tree commit diff stats
path: root/lib/packages/docutils
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-12-05 00:03:27 +0100
committerAraq <rumpf_a@web.de>2013-12-05 00:03:27 +0100
commit5eba93d584d5446256d05f0eef111ace5e12bac3 (patch)
tree7b638031f3e77c16ca0c27b9c83630d78846f19e /lib/packages/docutils
parent9035d15ed22de1f80486d94ec63e720a4d04cbc0 (diff)
parent2264875237cb72cf0288f2bd3d4a930c2a1acc50 (diff)
downloadNim-5eba93d584d5446256d05f0eef111ace5e12bac3.tar.gz
Merge branch 'master' into vm2
Conflicts:
	compiler/sem.nim
Diffstat (limited to 'lib/packages/docutils')
-rw-r--r--lib/packages/docutils/rst.nim10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/packages/docutils/rst.nim b/lib/packages/docutils/rst.nim
index 91664cd50..6dd407155 100644
--- a/lib/packages/docutils/rst.nim
+++ b/lib/packages/docutils/rst.nim
@@ -868,6 +868,12 @@ proc parseLine(p: var TRstParser, father: PRstNode) =
     case p.tok[p.idx].kind
     of tkWhite, tkWord, tkOther, tkPunct: parseInline(p, father)
     else: break 
+
+proc parseUntilNewline(p: var TRstParser, father: PRstNode) = 
+  while True: 
+    case p.tok[p.idx].kind
+    of tkWhite, tkWord, tkAdornment, tkOther, tkPunct: parseInline(p, father)
+    of tkEof, tkIndent: break
   
 proc parseSection(p: var TRstParser, result: PRstNode)
 proc parseField(p: var TRstParser): PRstNode = 
@@ -1078,7 +1084,7 @@ proc parseParagraph(p: var TRstParser, result: PRstNode) =
 
 proc parseHeadline(p: var TRstParser): PRstNode = 
   result = newRstNode(rnHeadline)
-  parseLine(p, result)
+  parseUntilNewLine(p, result)
   assert(p.tok[p.idx].kind == tkIndent)
   assert(p.tok[p.idx + 1].kind == tkAdornment)
   var c = p.tok[p.idx + 1].symbol[0]
@@ -1172,7 +1178,7 @@ proc parseOverline(p: var TRstParser): PRstNode =
   inc(p.idx, 2)
   result = newRstNode(rnOverline)
   while true: 
-    parseLine(p, result)
+    parseUntilNewline(p, result)
     if p.tok[p.idx].kind == tkIndent: 
       inc(p.idx)
       if p.tok[p.idx - 1].ival > currInd(p):