@ton-community/tlb-parser
Version:
Parse TLB syntax into TypeScript objects
16 lines (15 loc) • 532 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.withLocations = withLocations;
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;
}