@abaplint/core
Version:
abaplint - Core API
16 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CDSCase = void 0;
const _1 = require(".");
const combi_1 = require("../../abap/2_statements/combi");
class CDSCase extends combi_1.Expression {
getRunnable() {
// CDSArithmetics first: handles cast()*n, sum()*n, field+n, etc. before standalone alternatives
const value = (0, combi_1.altPrio)(_1.CDSString, CDSCase, _1.CDSArithmetics, _1.CDSCast, _1.CDSAggregate, _1.CDSArithParen, _1.CDSFunction, _1.CDSInteger, _1.CDSPrefixedName);
const simple = (0, combi_1.seq)((0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSArithParen, _1.CDSFunction, _1.CDSPrefixedName), (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", value, "THEN", value)));
const complex = (0, combi_1.plusPrio)((0, combi_1.seq)("WHEN", _1.CDSCondition, "THEN", value));
return (0, combi_1.seq)("CASE", (0, combi_1.altPrio)(complex, simple), (0, combi_1.optPrio)((0, combi_1.seq)("ELSE", value)), "END");
}
}
exports.CDSCase = CDSCase;
//# sourceMappingURL=cds_case.js.map