nimpretty: add #!nimpretty on/off directives
This commit is contained in:
parent
ed38079b9b
commit
f3c0703b7d
5 changed files with 43 additions and 9 deletions
|
|
@ -1114,7 +1114,9 @@ proc skip(L: var TLexer, tok: var TToken) =
|
|||
buf = L.buf
|
||||
else:
|
||||
tokenBegin(tok, pos)
|
||||
while buf[pos] notin {CR, LF, nimlexbase.EndOfFile}: inc(pos)
|
||||
while buf[pos] notin {CR, LF, nimlexbase.EndOfFile}:
|
||||
when defined(nimpretty): tok.literal.add buf[pos]
|
||||
inc(pos)
|
||||
tokenEndIgnore(tok, pos+1)
|
||||
when defined(nimpretty):
|
||||
tok.commentOffsetB = L.offsetBase + pos + 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue