@abaplint/runtime
Version:
Transpiler - Runtime
22 lines • 697 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.expandDynamic = expandDynamic;
const types_1 = require("./types");
function expandDynamic(code, ev) {
if (code === "") {
return "1 = 1";
}
else {
// todo more here, this is just one simple case,
const match = code.match(/ <(\w+)>/);
if (match && match[1]) {
const name = "fs_" + match[1] + "_";
const found = ev(name);
if (found instanceof types_1.FieldSymbol) {
code = code.replace(/ <(\w+)>/, "'" + found.get() + "'");
}
}
return code;
}
}
//# sourceMappingURL=expand_dynamic.js.map