summary refs log tree commit diff stats
path: root/packages
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-01-21 01:10:23 +0100
committerAraq <rumpf_a@web.de>2013-01-21 01:10:23 +0100
commit0c13512db954e5224dcfcc218ae4bd4f3df40f7a (patch)
treeab407d64fceab94dd8e63a250271bc113e4f135f /packages
parent7b5b9656f5cc92f76fbaba763385970169e3a7f6 (diff)
downloadNim-0c13512db954e5224dcfcc218ae4bd4f3df40f7a.tar.gz
rst parser: show the beginning of the quote in the error message
Diffstat (limited to 'packages')
-rwxr-xr-xpackages/docutils/rst.nim9
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/docutils/rst.nim b/packages/docutils/rst.nim
index c752e5065..b22bdf6ce 100755
--- a/packages/docutils/rst.nim
+++ b/packages/docutils/rst.nim
@@ -313,6 +313,10 @@ proc rstMessage(p: TRstParser, msgKind: TMsgKind, arg: string) =
   p.s.msgHandler(p.filename, p.line + p.tok[p.idx].line, 
                              p.col + p.tok[p.idx].col, msgKind, arg)
 
+proc rstMessage(p: TRstParser, msgKind: TMsgKind, arg: string, line, col: int) = 
+  p.s.msgHandler(p.filename, p.line + line, 
+                             p.col + col, msgKind, arg)
+
 proc rstMessage(p: TRstParser, msgKind: TMsgKind) = 
   p.s.msgHandler(p.filename, p.line + p.tok[p.idx].line, 
                              p.col + p.tok[p.idx].col, msgKind, 
@@ -684,6 +688,9 @@ when false:
 
 proc parseUntil(p: var TRstParser, father: PRstNode, postfix: string, 
                 interpretBackslash: bool) = 
+  let
+    line = p.tok[p.idx].line
+    col = p.tok[p.idx].col
   while true: 
     case p.tok[p.idx].kind
     of tkPunct: 
@@ -707,7 +714,7 @@ proc parseUntil(p: var TRstParser, father: PRstNode, postfix: string,
     of tkWhite: 
       add(father, newRstNode(rnLeaf, " "))
       inc(p.idx)
-    else: rstMessage(p, meExpected, postfix)
+    else: rstMessage(p, meExpected, postfix, line, col)
 
 proc parseMarkdownCodeblock(p: var TRstParser): PRstNode =
   var args = newRstNode(rnDirArg)