location.js 925 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.SourceLocation = exports.Position = void 0;
  6. exports.createPositionWithColumnOffset = createPositionWithColumnOffset;
  7. class Position {
  8. constructor(line, col, index) {
  9. this.line = void 0;
  10. this.column = void 0;
  11. this.index = void 0;
  12. this.line = line;
  13. this.column = col;
  14. this.index = index;
  15. }
  16. }
  17. exports.Position = Position;
  18. class SourceLocation {
  19. constructor(start, end) {
  20. this.start = void 0;
  21. this.end = void 0;
  22. this.filename = void 0;
  23. this.identifierName = void 0;
  24. this.start = start;
  25. this.end = end;
  26. }
  27. }
  28. exports.SourceLocation = SourceLocation;
  29. function createPositionWithColumnOffset(position, columnOffset) {
  30. const {
  31. line,
  32. column,
  33. index
  34. } = position;
  35. return new Position(line, column + columnOffset, index + columnOffset);
  36. }
  37. //# sourceMappingURL=location.js.map