(index)
| 232 | } |
| 233 | |
| 234 | positionInside(index) { |
| 235 | let column = this.source.start.column |
| 236 | let line = this.source.start.line |
| 237 | let inputString = |
| 238 | 'document' in this.source.input |
| 239 | ? this.source.input.document |
| 240 | : this.source.input.css |
| 241 | let offset = sourceOffset(inputString, this.source.start) |
| 242 | let end = offset + index |
| 243 | |
| 244 | for (let i = offset; i < end; i++) { |
| 245 | if (inputString[i] === '\n') { |
| 246 | column = 1 |
| 247 | line += 1 |
| 248 | } else { |
| 249 | column += 1 |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | return { column, line, offset: end } |
| 254 | } |
| 255 | |
| 256 | prev() { |
| 257 | if (!this.parent) return undefined |
no test coverage detected