UNPKG

@abaplint/transpiler

Version:
30 lines 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetReferenceTranspiler = void 0; const abaplint = require("@abaplint/core"); const chunk_1 = require("../chunk"); class GetReferenceTranspiler { transpile(node, traversal) { const s = node.findDirectExpression(abaplint.Expressions.Source); const t = node.findDirectExpression(abaplint.Expressions.Target); if (s === undefined) { throw new Error("GetReference, Source not found"); } else if (t === undefined) { throw new Error("GetReference, Target not found"); } const source = traversal.traverse(s); const target = traversal.traverse(t); if (s.getFirstToken().getStr().startsWith("<")) { // its a field symbol source.appendString(".getPointer()"); } return new chunk_1.Chunk() .appendChunk(target) .appendString(".assign(") .appendChunk(source) .append(");", node.getLastToken(), traversal); } } exports.GetReferenceTranspiler = GetReferenceTranspiler; //# sourceMappingURL=get_reference.js.map