UNPKG

@abaplint/core

Version:
25 lines 1.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Compare = void 0; const combi_1 = require("../combi"); const _1 = require("."); const tokens_1 = require("../../1_lexer/tokens"); const version_1 = require("../../../version"); class Compare extends combi_1.Expression { getRunnable() { const val = (0, combi_1.altPrio)(_1.FieldSub, _1.Constant); const list = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeft), val, (0, combi_1.plus)((0, combi_1.seq)(",", val)), (0, combi_1.tok)(tokens_1.ParenRightW)); const inn = (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), "IN", (0, combi_1.altPrio)(_1.Source, list)); const sopt = (0, combi_1.seq)("IS", (0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)("SUPPLIED", "BOUND", (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("INSTANCE OF", _1.ClassName), version_1.Version.OpenABAP), "REQUESTED", "INITIAL")); const between = (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), "BETWEEN", _1.Source, "AND", _1.Source); // https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abennews-740_sp08-expressions.htm // but also seems to work in v740sp05, blah const predicate = (0, combi_1.ver)(version_1.Version.v740sp08, _1.MethodCallChain, version_1.Version.OpenABAP); const rett = (0, combi_1.seq)(_1.Source, (0, combi_1.altPrio)((0, combi_1.seq)(_1.CompareOperator, _1.Source), inn, between, sopt)); const fsassign = (0, combi_1.seq)(_1.SourceFieldSymbolChain, "IS", (0, combi_1.optPrio)("NOT"), "ASSIGNED"); const ret = (0, combi_1.seq)((0, combi_1.opt)("NOT"), (0, combi_1.altPrio)(rett, predicate, fsassign)); return ret; } } exports.Compare = Compare; //# sourceMappingURL=compare.js.map