nimpretty: next steps
This commit is contained in:
parent
a230307b48
commit
9bc963508f
5 changed files with 34 additions and 17 deletions
|
|
@ -125,7 +125,13 @@ proc rawSkipComment(p: var TParser, node: PNode) =
|
|||
if p.tok.tokType == tkComment:
|
||||
if node != nil:
|
||||
if node.comment == nil: node.comment = ""
|
||||
add(node.comment, p.tok.literal)
|
||||
when defined(nimpretty):
|
||||
if p.tok.commentOffsetB > p.tok.commentOffsetA:
|
||||
add node.comment, fileSection(p.lex.fileIdx, p.tok.commentOffsetA, p.tok.commentOffsetB)
|
||||
else:
|
||||
add node.comment, p.tok.literal
|
||||
else:
|
||||
add(node.comment, p.tok.literal)
|
||||
else:
|
||||
parMessage(p, errInternal, "skipComment")
|
||||
getTok(p)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue