@abaplint/runtime
Version:
Transpiler - Runtime
45 lines • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ca = ca;
const types_1 = require("../types");
function ca(left, right) {
if (left instanceof types_1.FieldSymbol) {
return ca(left.getPointer(), right);
}
else if (right instanceof types_1.FieldSymbol) {
return ca(left, right.getPointer());
}
let l = "";
if (typeof left === "number" || typeof left === "string") {
l = left.toString();
}
else if (left instanceof types_1.Structure) {
l = left.getCharacter();
}
else {
l = left.get().toString();
}
if (l === "") {
l = " ";
}
let r = "";
if (typeof right === "string") {
r = right.toString();
}
else {
r = right.get().toString();
}
let fdpos = 0;
for (const c of l) {
if (r.includes(c) === true) {
// @ts-ignore
abap.builtin.sy.get().fdpos.set(fdpos);
return true;
}
fdpos++;
}
// @ts-ignore
abap.builtin.sy.get().fdpos.set(fdpos);
return false;
}
//# sourceMappingURL=ca.js.map