(node *ast.Node, state *commentState)
| 5278 | } |
| 5279 | |
| 5280 | func (p *Printer) emitCommentsAfterNode(node *ast.Node, state *commentState) { |
| 5281 | if state == nil { |
| 5282 | return |
| 5283 | } |
| 5284 | |
| 5285 | emitFlags := state.emitFlags |
| 5286 | commentRange := state.commentRange |
| 5287 | containerPos := state.containerPos |
| 5288 | containerEnd := state.containerEnd |
| 5289 | declarationListContainerEnd := state.declarationListContainerEnd |
| 5290 | |
| 5291 | // Emit trailing comments |
| 5292 | if emitFlags&EFNoNestedComments != 0 { |
| 5293 | p.commentsDisabled = false |
| 5294 | } |
| 5295 | |
| 5296 | p.emitTrailingSyntheticCommentsOfNode(node, emitFlags) |
| 5297 | p.emitTrailingCommentsOfNode(node, emitFlags, commentRange, containerPos, containerEnd, declarationListContainerEnd) |
| 5298 | |
| 5299 | // Preserve comments from erased type annotation |
| 5300 | if typeNode := p.emitContext.GetTypeNode(node); typeNode != nil { |
| 5301 | p.emitTrailingCommentsOfNode(node, emitFlags, typeNode.Loc, containerPos, containerEnd, declarationListContainerEnd) |
| 5302 | } |
| 5303 | } |
| 5304 | |
| 5305 | func (p *Printer) emitCommentsBeforeToken(token ast.Kind, pos int, contextNode *ast.Node, flags tokenEmitFlags) (*commentState, int) { |
| 5306 | if flags&tefNoComments != 0 || p.commentsDisabled { |
no test coverage detected