UNPKG

@igorivaniuk/tlb-parser

Version:

Parse TLB syntax into TypeScript objects

17 lines (16 loc) 564 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.withLocations = void 0; function withLocations(astNode, intermediateNode) { // It exists, but is not listed in TS definitions. // @ts-ignore const lineAndColumn = intermediateNode.source.getLineAndColumn(); // This is the only place where we set it, ignore the type error // @ts-ignore astNode.locations = { 'line': lineAndColumn.lineNum, 'column': lineAndColumn.colNum, }; return astNode; } exports.withLocations = withLocations;