Fix commentOffsetA for doc comments (#15643)
This commit is contained in:
parent
0f4b1ed270
commit
f20e485827
3 changed files with 11 additions and 1 deletions
|
|
@ -1042,7 +1042,7 @@ proc scanComment(L: var Lexer, tok: var Token) =
|
||||||
tok.iNumber = 0
|
tok.iNumber = 0
|
||||||
assert L.buf[pos+1] == '#'
|
assert L.buf[pos+1] == '#'
|
||||||
when defined(nimpretty):
|
when defined(nimpretty):
|
||||||
tok.commentOffsetA = L.offsetBase + pos - 1
|
tok.commentOffsetA = L.offsetBase + pos
|
||||||
|
|
||||||
if L.buf[pos+2] == '[':
|
if L.buf[pos+2] == '[':
|
||||||
skipMultiLineComment(L, tok, pos+3, true)
|
skipMultiLineComment(L, tok, pos+3, true)
|
||||||
|
|
|
||||||
|
|
@ -11,3 +11,8 @@ proc a() =
|
||||||
|
|
||||||
# comment 2
|
# comment 2
|
||||||
discard
|
discard
|
||||||
|
|
||||||
|
# bug #15596
|
||||||
|
discard ## comment 3
|
||||||
|
|
||||||
|
discard # comment 4
|
||||||
|
|
|
||||||
|
|
@ -11,3 +11,8 @@ proc a() =
|
||||||
|
|
||||||
# comment 2
|
# comment 2
|
||||||
discard
|
discard
|
||||||
|
|
||||||
|
# bug #15596
|
||||||
|
discard## comment 3
|
||||||
|
|
||||||
|
discard # comment 4
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue