@abaplint/core
Version:
abaplint - Core API
37 lines • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CondBody = void 0;
const Expressions = require("../../2_statements/expressions");
const source_1 = require("./source");
const let_1 = require("./let");
const cond_1 = require("./cond");
class CondBody {
static runSyntax(node, input, targetType) {
if (node === undefined) {
return undefined;
}
let scoped = false;
const l = node.findDirectExpression(Expressions.Let);
if (l) {
scoped = let_1.Let.runSyntax(l, input);
}
for (const s of node.findDirectExpressions(Expressions.Cond)) {
cond_1.Cond.runSyntax(s, input);
}
let type = undefined;
for (const s of node.findDirectExpressions(Expressions.Source)) {
if (type === undefined) {
type = source_1.Source.runSyntax(s, input, targetType);
}
else {
source_1.Source.runSyntax(s, input, targetType);
}
}
if (scoped === true) {
input.scope.pop(node.getLastToken().getEnd());
}
return type;
}
}
exports.CondBody = CondBody;
//# sourceMappingURL=cond_body.js.map