node: make sure transferred comments do not comment out legitimate source lines(!)

This commit is contained in:
mappu 2020-04-10 20:07:45 +12:00
parent 475ddeb13c
commit 199654f552
1 changed files with 4 additions and 0 deletions

View File

@ -93,6 +93,10 @@ func (this *conversionState) convert(n node.Node) (string, error) {
return "", err
}
if len(freePrefix) > 0 && !(strings.HasSuffix(freePrefix, "\n") || strings.HasSuffix(freePrefix, `*/`)) {
freePrefix += "\n"
}
return freePrefix + ret + freeSuffix, nil
}