Gets the range for a token of a node when emitting source maps.
(node *ast.Node, kind ast.Kind)
| 616 | |
| 617 | // Gets the range for a token of a node when emitting source maps. |
| 618 | func (c *EmitContext) TokenSourceMapRange(node *ast.Node, kind ast.Kind) (core.TextRange, bool) { |
| 619 | if emitNode := c.emitNodes.TryGet(node); emitNode != nil && emitNode.tokenSourceMapRanges != nil { |
| 620 | if loc, ok := emitNode.tokenSourceMapRanges[kind]; ok { |
| 621 | return loc, true |
| 622 | } |
| 623 | } |
| 624 | return core.TextRange{}, false |
| 625 | } |
| 626 | |
| 627 | // Sets the range for a token of a node when emitting source maps. |
| 628 | func (c *EmitContext) SetTokenSourceMapRange(node *ast.Node, kind ast.Kind, loc core.TextRange) { |
no test coverage detected