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)
| 1105 | // appendCaptureHeader writes the table header of expr in the capture buffer, |
| 1106 | // adjusted to be relative to the capture root. |
| 1107 | func (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. |
no test coverage detected