1234567891011121314151617181920 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.Context = void 0;
- const lines_and_columns_1 = require("lines-and-columns");
- class Context {
- constructor(text) {
- this.text = text;
- this.locator = new Locator(this.text);
- }
- }
- exports.Context = Context;
- class Locator {
- constructor(text) {
- this._lineAndColumn = new lines_and_columns_1.default(text);
- }
- locationForIndex(index) {
- const { line, column } = this._lineAndColumn.locationForIndex(index);
- return { line: line + 1, column };
- }
- }
|