| 543 | } |
| 544 | |
| 545 | push({name, start}: RangeMapping) { |
| 546 | let nameIndex = this._namesMap.get(name); |
| 547 | if (typeof nameIndex !== 'number') { |
| 548 | nameIndex = this._names.length; |
| 549 | this._names[nameIndex] = name; |
| 550 | this._namesMap.set(name, nameIndex); |
| 551 | } |
| 552 | const lineDelta = this._line.next(start.line); |
| 553 | const firstOfLine = this._mappings.pos === 0 || lineDelta > 0; |
| 554 | if (lineDelta > 0) { |
| 555 | // The next entry will have the line offset, so emit just one semicolon. |
| 556 | this._mappings.markLines(1); |
| 557 | this._column.reset(0); |
| 558 | } |
| 559 | this._mappings.startSegment(this._column.next(start.column)); |
| 560 | this._mappings.append(this._nameIndex.next(nameIndex)); |
| 561 | if (firstOfLine) { |
| 562 | this._mappings.append(lineDelta); |
| 563 | } |
| 564 | } |
| 565 | } |
| 566 | |
| 567 | class RelativeValue { |