MCPcopy
hub / github.com/pelletier/go-toml / appendCaptureHeader

Method appendCaptureHeader

unmarshaler.go:1107–1118  ·  view source on GitHub ↗

appendCaptureHeader writes the table header of expr in the capture buffer, adjusted to be relative to the capture root.

(c *rawCapture, expr *unstable.Node, skip int)

Source from the content-addressed store, hash-verified

1105// appendCaptureHeader writes the table header of expr in the capture buffer,
1106// adjusted to be relative to the capture root.
1107func (d *decoder) appendCaptureHeader(c *rawCapture, expr *unstable.Node, skip int) {
1108 c.buf = append(c.buf, '[')
1109 if expr.Kind == unstable.ArrayTable {
1110 c.buf = append(c.buf, '[')
1111 }
1112 c.buf = append(c.buf, d.rawKeySuffix(expr, skip)...)
1113 c.buf = append(c.buf, ']')
1114 if expr.Kind == unstable.ArrayTable {
1115 c.buf = append(c.buf, ']')
1116 }
1117 c.buf = append(c.buf, '\n')
1118}
1119
1120// rawKeySuffix returns the raw bytes of the key of the expression, skipping
1121// the first n parts.

Callers 2

resumeCaptureMethod · 0.95
startCaptureMethod · 0.95

Calls 1

rawKeySuffixMethod · 0.95

Tested by

no test coverage detected