MCPcopy Index your code
hub / github.com/microsoft/typescript-go / createNode

Method createNode

internal/api/encoder/decoder.go:242–254  ·  view source on GitHub ↗
(kind ast.Kind, data uint32, childIndices []int)

Source from the content-addressed store, hash-verified

240}
241
242func (d *astDecoder) createNode(kind ast.Kind, data uint32, childIndices []int) (*ast.Node, error) {
243 dataType := data & NodeDataTypeMask
244 commonData := uint8((data >> 24) & 0x3f)
245
246 switch dataType {
247 case NodeDataTypeString:
248 return d.createStringNode(kind, data, commonData)
249 case NodeDataTypeExtendedData:
250 return d.createExtendedNode(kind, data, childIndices, commonData)
251 default:
252 return d.createChildrenNode(kind, data, childIndices, commonData)
253 }
254}
255
256func (d *astDecoder) decodeExtendedData_SourceFile(data uint32, childIndices []int, commonData uint8) (*ast.Node, error) {
257 extOff := int(d.extData) + int(data&NodeDataStringIndexMask)

Callers 1

decodeMethod · 0.95

Calls 3

createStringNodeMethod · 0.95
createExtendedNodeMethod · 0.95
createChildrenNodeMethod · 0.95

Tested by

no test coverage detected