rawKeySuffix returns the raw bytes of the key of the expression, skipping the first n parts.
(expr *unstable.Node, n int)
| 1120 | // rawKeySuffix returns the raw bytes of the key of the expression, skipping |
| 1121 | // the first n parts. |
| 1122 | func (d *decoder) rawKeySuffix(expr *unstable.Node, n int) []byte { |
| 1123 | it := expr.Key() |
| 1124 | idx := 0 |
| 1125 | var start, end unstable.Range |
| 1126 | for it.Next() { |
| 1127 | if idx >= n { |
| 1128 | r := it.Node().Raw |
| 1129 | if start.Length == 0 && start.Offset == 0 && idx == n { |
| 1130 | start = r |
| 1131 | } |
| 1132 | end = r |
| 1133 | } |
| 1134 | idx++ |
| 1135 | } |
| 1136 | return d.p.Data()[start.Offset : end.Offset+end.Length] |
| 1137 | } |
| 1138 | |
| 1139 | // startCapture registers a new capture for the table at the given path |
| 1140 | // (prefix of tableKey). |
no test coverage detected