@abaplint/core
Version:
abaplint - Core API
30 lines • 1.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SwitchBody = void 0;
const Expressions = require("../../2_statements/expressions");
const source_1 = require("./source");
const _syntax_input_1 = require("../_syntax_input");
const basic_1 = require("../../types/basic");
class SwitchBody {
static runSyntax(node, input) {
if (node === undefined) {
return;
}
const thenSource = node.findExpressionAfterToken("THEN");
if (!((thenSource === null || thenSource === void 0 ? void 0 : thenSource.get()) instanceof Expressions.Source)) {
const message = "SwitchBody, unexpected";
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
}
const type = source_1.Source.runSyntax(thenSource, input);
for (const s of node.findDirectExpressions(Expressions.Source)) {
if (s === thenSource) {
continue;
}
source_1.Source.runSyntax(s, input);
}
return type;
}
}
exports.SwitchBody = SwitchBody;
//# sourceMappingURL=switch_body.js.map