(parentNode *ast.Node, prevChildNode *ast.Node, nextChildNode *ast.Node)
| 400 | } |
| 401 | |
| 402 | func (p *Printer) writeLineOrSpace(parentNode *ast.Node, prevChildNode *ast.Node, nextChildNode *ast.Node) { |
| 403 | if p.shouldEmitOnSingleLine(parentNode) { |
| 404 | p.writeSpace() |
| 405 | } else if p.Options.PreserveSourceNewlines { |
| 406 | lines := p.getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode) |
| 407 | if lines > 0 { |
| 408 | p.writeLineRepeat(lines) |
| 409 | } else { |
| 410 | p.writeSpace() |
| 411 | } |
| 412 | } else { |
| 413 | p.writeLine() |
| 414 | } |
| 415 | } |
| 416 | |
| 417 | func (p *Printer) writeLinesAndIndent(lineCount int, writeSpaceIfNotIndenting bool) { |
| 418 | if lineCount > 0 { |
no test coverage detected