Comments
(node *ast.Node)
| 5255 | // |
| 5256 | |
| 5257 | func (p *Printer) emitCommentsBeforeNode(node *ast.Node) *commentState { |
| 5258 | if !p.shouldEmitComments(node) { |
| 5259 | return nil |
| 5260 | } |
| 5261 | |
| 5262 | emitFlags := p.emitContext.EmitFlags(node) |
| 5263 | commentRange := p.emitContext.CommentRange(node) |
| 5264 | containerPos := p.containerPos |
| 5265 | containerEnd := p.containerEnd |
| 5266 | declarationListContainerEnd := p.declarationListContainerEnd |
| 5267 | |
| 5268 | // Emit leading comments |
| 5269 | p.emitLeadingCommentsOfNode(node, emitFlags, commentRange) |
| 5270 | p.emitLeadingSyntheticCommentsOfNode(node, emitFlags) |
| 5271 | if emitFlags&EFNoNestedComments != 0 { |
| 5272 | p.commentsDisabled = true |
| 5273 | } |
| 5274 | |
| 5275 | c := p.commentStateArena.New() |
| 5276 | *c = commentState{emitFlags, commentRange, containerPos, containerEnd, declarationListContainerEnd} |
| 5277 | return c |
| 5278 | } |
| 5279 | |
| 5280 | func (p *Printer) emitCommentsAfterNode(node *ast.Node, state *commentState) { |
| 5281 | if state == nil { |
no test coverage detected