nimpretty: test for idempotence; fixes #9483

This commit is contained in:
Araq 2018-10-24 15:19:29 +02:00
commit 06a6433db7
4 changed files with 28 additions and 8 deletions

View file

@ -1140,7 +1140,10 @@ proc skip(L: var TLexer, tok: var TToken) =
inc(pos)
inc(indent)
elif buf[pos] == '#' and buf[pos+1] == '[':
when defined(nimpretty): hasComment = true
when defined(nimpretty):
hasComment = true
if tok.line < 0:
tok.line = L.lineNumber
skipMultiLineComment(L, tok, pos+2, false)
pos = L.bufpos
buf = L.buf
@ -1160,7 +1163,6 @@ proc skip(L: var TLexer, tok: var TToken) =
hasComment = true
if tok.line < 0:
tok.line = L.lineNumber
#commentIndent = L.currLineIndent # if tok.strongSpaceA == 0: -1 else: tok.strongSpaceA
if buf[pos+1] == '[':
skipMultiLineComment(L, tok, pos+2, false)