rst parser: show the beginning of the quote in the error message
This commit is contained in:
parent
7b5b9656f5
commit
0c13512db9
1 changed files with 8 additions and 1 deletions
|
|
@ -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.s.msgHandler(p.filename, p.line + p.tok[p.idx].line,
|
||||||
p.col + p.tok[p.idx].col, msgKind, arg)
|
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) =
|
proc rstMessage(p: TRstParser, msgKind: TMsgKind) =
|
||||||
p.s.msgHandler(p.filename, p.line + p.tok[p.idx].line,
|
p.s.msgHandler(p.filename, p.line + p.tok[p.idx].line,
|
||||||
p.col + p.tok[p.idx].col, msgKind,
|
p.col + p.tok[p.idx].col, msgKind,
|
||||||
|
|
@ -684,6 +688,9 @@ when false:
|
||||||
|
|
||||||
proc parseUntil(p: var TRstParser, father: PRstNode, postfix: string,
|
proc parseUntil(p: var TRstParser, father: PRstNode, postfix: string,
|
||||||
interpretBackslash: bool) =
|
interpretBackslash: bool) =
|
||||||
|
let
|
||||||
|
line = p.tok[p.idx].line
|
||||||
|
col = p.tok[p.idx].col
|
||||||
while true:
|
while true:
|
||||||
case p.tok[p.idx].kind
|
case p.tok[p.idx].kind
|
||||||
of tkPunct:
|
of tkPunct:
|
||||||
|
|
@ -707,7 +714,7 @@ proc parseUntil(p: var TRstParser, father: PRstNode, postfix: string,
|
||||||
of tkWhite:
|
of tkWhite:
|
||||||
add(father, newRstNode(rnLeaf, " "))
|
add(father, newRstNode(rnLeaf, " "))
|
||||||
inc(p.idx)
|
inc(p.idx)
|
||||||
else: rstMessage(p, meExpected, postfix)
|
else: rstMessage(p, meExpected, postfix, line, col)
|
||||||
|
|
||||||
proc parseMarkdownCodeblock(p: var TRstParser): PRstNode =
|
proc parseMarkdownCodeblock(p: var TRstParser): PRstNode =
|
||||||
var args = newRstNode(rnDirArg)
|
var args = newRstNode(rnDirArg)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue