@abaplint/core 2.113.48 → 2.113.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/abaplint.d.ts +5 -0
- package/build/src/cds/expressions/cds_aggregate.js +1 -1
- package/build/src/cds/expressions/cds_arithmetics.js +5 -1
- package/build/src/cds/expressions/cds_function.js +36 -33
- package/build/src/cds/expressions/cds_function_input.js +14 -0
- package/build/src/cds/expressions/index.js +1 -0
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
package/build/abaplint.d.ts
CHANGED
|
@@ -835,6 +835,10 @@ declare class CDSFunction extends Expression {
|
|
|
835
835
|
getRunnable(): IStatementRunnable;
|
|
836
836
|
}
|
|
837
837
|
|
|
838
|
+
declare class CDSFunctionInput extends Expression {
|
|
839
|
+
getRunnable(): IStatementRunnable;
|
|
840
|
+
}
|
|
841
|
+
|
|
838
842
|
declare class CDSGroupBy extends Expression {
|
|
839
843
|
getRunnable(): IStatementRunnable;
|
|
840
844
|
}
|
|
@@ -2408,6 +2412,7 @@ declare namespace ExpressionsCDS {
|
|
|
2408
2412
|
CDSElement,
|
|
2409
2413
|
CDSExtendView,
|
|
2410
2414
|
CDSFunction,
|
|
2415
|
+
CDSFunctionInput,
|
|
2411
2416
|
CDSGroupBy,
|
|
2412
2417
|
CDSHaving,
|
|
2413
2418
|
CDSInteger,
|
|
@@ -6,7 +6,7 @@ const combi_1 = require("../../abap/2_statements/combi");
|
|
|
6
6
|
class CDSAggregate extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
8
|
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)));
|
|
9
|
-
const value = (0, combi_1.alt)(name, _1.CDSCast, _1.CDSCase);
|
|
9
|
+
const value = (0, combi_1.alt)(name, "*", _1.CDSCast, _1.CDSCase, _1.CDSFunction);
|
|
10
10
|
return (0, combi_1.seq)((0, combi_1.alt)("MAX", "MIN", "SUM", "AVG", "COUNT"), "(", (0, combi_1.opt)("DISTINCT"), value, ")");
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -9,7 +9,11 @@ class CDSArithmetics extends combi_1.Expression {
|
|
|
9
9
|
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)));
|
|
10
10
|
const val = (0, combi_1.alt)(cds_integer_1.CDSInteger, name, _1.CDSFunction, _1.CDSCase, _1.CDSCast, _1.CDSString);
|
|
11
11
|
const operator = (0, combi_1.altPrio)("+", "-", "*", "/");
|
|
12
|
-
|
|
12
|
+
const operatorValue = (0, combi_1.seq)(operator, val);
|
|
13
|
+
const paren = (0, combi_1.seq)("(", val, (0, combi_1.plus)(operatorValue), ")");
|
|
14
|
+
const noParen = (0, combi_1.seq)(val, (0, combi_1.plus)(operatorValue));
|
|
15
|
+
// todo: this is pretty bad, it needs a rewrite
|
|
16
|
+
return (0, combi_1.altPrio)((0, combi_1.seq)(paren, (0, combi_1.plus)(operatorValue)), paren, noParen);
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
19
|
exports.CDSArithmetics = CDSArithmetics;
|
|
@@ -5,40 +5,43 @@ const _1 = require(".");
|
|
|
5
5
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
6
6
|
class CDSFunction extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const dats_tims_to_tstmp = (0, combi_1.seq)("DATS_TIMS_TO_TSTMP", "(", input, ",", input, ",", input, ",", input, ",", input, ")");
|
|
32
|
-
const tstmp_is_valid = (0, combi_1.seq)("TSTMP_IS_VALID", "(", input, ")");
|
|
8
|
+
const coalesce = (0, combi_1.seq)("COALESCE", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
9
|
+
const concat = (0, combi_1.seq)("CONCAT", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
10
|
+
const concat_with_space = (0, combi_1.seq)("CONCAT_WITH_SPACE", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
11
|
+
const dats_add_days = (0, combi_1.seq)("DATS_ADD_DAYS", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
12
|
+
const dats_add_months = (0, combi_1.seq)("DATS_ADD_MONTHS", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
13
|
+
const dats_days_between = (0, combi_1.seq)("DATS_DAYS_BETWEEN", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
14
|
+
const dats_is_valid = (0, combi_1.seq)("DATS_IS_VALID", "(", _1.CDSFunctionInput, ")");
|
|
15
|
+
const substring = (0, combi_1.seq)("SUBSTRING", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
16
|
+
const bintohex = (0, combi_1.seq)("BINTOHEX", "(", _1.CDSFunctionInput, ")");
|
|
17
|
+
const hextobin = (0, combi_1.seq)("HEXTOBIN", "(", _1.CDSFunctionInput, ")");
|
|
18
|
+
const upper = (0, combi_1.seq)("UPPER", "(", _1.CDSFunctionInput, ")");
|
|
19
|
+
const lower = (0, combi_1.seq)("LOWER", "(", _1.CDSFunctionInput, ")");
|
|
20
|
+
const abs = (0, combi_1.seq)("ABS", "(", _1.CDSFunctionInput, ")");
|
|
21
|
+
const ceil = (0, combi_1.seq)("CEIL", "(", _1.CDSFunctionInput, ")");
|
|
22
|
+
const floor = (0, combi_1.seq)("FLOOR", "(", _1.CDSFunctionInput, ")");
|
|
23
|
+
const round = (0, combi_1.seq)("ROUND", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
24
|
+
const div = (0, combi_1.seq)("DIV", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
25
|
+
const division = (0, combi_1.seq)("DIVISION", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
26
|
+
const tstmp_to_dats = (0, combi_1.seq)("TSTMP_TO_DATS", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
27
|
+
const tstmp_to_tims = (0, combi_1.seq)("TSTMP_TO_TIMS", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
28
|
+
const tstmp_to_dst = (0, combi_1.seq)("TSTMP_TO_DST", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
29
|
+
const dats_tims_to_tstmp = (0, combi_1.seq)("DATS_TIMS_TO_TSTMP", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
30
|
+
const tstmp_is_valid = (0, combi_1.seq)("TSTMP_IS_VALID", "(", _1.CDSFunctionInput, ")");
|
|
33
31
|
const tstmp_current_utctimestamp = (0, combi_1.seq)("TSTMP_CURRENT_UTCTIMESTAMP", "(", ")");
|
|
34
|
-
const tstmp_seconds_between = (0, combi_1.seq)("TSTMP_SECONDS_BETWEEN", "(",
|
|
35
|
-
const tstmp_add_seconds = (0, combi_1.seq)("TSTMP_ADD_SECONDS", "(",
|
|
36
|
-
const abap_system_timezone = (0, combi_1.seq)("ABAP_SYSTEM_TIMEZONE", "(",
|
|
37
|
-
const abap_user_timezone = (0, combi_1.seq)("ABAP_USER_TIMEZONE", "(",
|
|
38
|
-
const mod = (0, combi_1.seq)("MOD", "(",
|
|
39
|
-
const left = (0, combi_1.seq)("LEFT", "(",
|
|
40
|
-
const right = (0, combi_1.seq)("RIGHT", "(",
|
|
41
|
-
|
|
32
|
+
const tstmp_seconds_between = (0, combi_1.seq)("TSTMP_SECONDS_BETWEEN", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
33
|
+
const tstmp_add_seconds = (0, combi_1.seq)("TSTMP_ADD_SECONDS", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
34
|
+
const abap_system_timezone = (0, combi_1.seq)("ABAP_SYSTEM_TIMEZONE", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
35
|
+
const abap_user_timezone = (0, combi_1.seq)("ABAP_USER_TIMEZONE", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
36
|
+
const mod = (0, combi_1.seq)("MOD", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
37
|
+
const left = (0, combi_1.seq)("LEFT", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
38
|
+
const right = (0, combi_1.seq)("RIGHT", "(", _1.CDSFunctionInput, ",", _1.CDSFunctionInput, ")");
|
|
39
|
+
const conversionInput = (0, combi_1.seq)(_1.CDSName, "=", ">", _1.CDSFunctionInput);
|
|
40
|
+
const conversionInputs = (0, combi_1.seq)(conversionInput, (0, combi_1.starPrio)((0, combi_1.seq)(",", conversionInput)));
|
|
41
|
+
const unitConversion = (0, combi_1.seq)("UNIT_CONVERSION", "(", conversionInputs, ")");
|
|
42
|
+
const currencyConversion = (0, combi_1.seq)("CURRENCY_CONVERSION", "(", conversionInputs, ")");
|
|
43
|
+
const decimalShift = (0, combi_1.seq)("DECIMAL_SHIFT", "(", conversionInputs, ")");
|
|
44
|
+
return (0, combi_1.altPrio)(substring, coalesce, tstmp_to_dats, concat, tstmp_to_tims, upper, lower, abs, ceil, floor, round, div, division, concat_with_space, dats_is_valid, dats_days_between, tstmp_add_seconds, tstmp_seconds_between, tstmp_current_utctimestamp, tstmp_is_valid, abap_system_timezone, abap_user_timezone, bintohex, hextobin, dats_add_days, dats_add_months, tstmp_to_dst, dats_tims_to_tstmp, mod, left, right, unitConversion, currencyConversion, decimalShift);
|
|
42
45
|
}
|
|
43
46
|
}
|
|
44
47
|
exports.CDSFunction = CDSFunction;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CDSFunctionInput = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const combi_1 = require("../../abap/2_statements/combi");
|
|
6
|
+
class CDSFunctionInput extends combi_1.Expression {
|
|
7
|
+
getRunnable() {
|
|
8
|
+
const qualified = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)(_1.CDSParameters), (0, combi_1.starPrio)((0, combi_1.seq)(".", _1.CDSName, (0, combi_1.opt)(_1.CDSParameters))));
|
|
9
|
+
const input = (0, combi_1.altPrio)(_1.CDSCast, _1.CDSFunction, _1.CDSArithmetics, _1.CDSCase, _1.CDSString, qualified, (0, combi_1.regex)(/^\d+$/));
|
|
10
|
+
return input;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.CDSFunctionInput = CDSFunctionInput;
|
|
14
|
+
//# sourceMappingURL=cds_function_input.js.map
|
|
@@ -35,6 +35,7 @@ __exportStar(require("./cds_define_view"), exports);
|
|
|
35
35
|
__exportStar(require("./cds_element"), exports);
|
|
36
36
|
__exportStar(require("./cds_extend_view"), exports);
|
|
37
37
|
__exportStar(require("./cds_function"), exports);
|
|
38
|
+
__exportStar(require("./cds_function_input"), exports);
|
|
38
39
|
__exportStar(require("./cds_group_by"), exports);
|
|
39
40
|
__exportStar(require("./cds_having"), exports);
|
|
40
41
|
__exportStar(require("./cds_integer"), exports);
|
package/build/src/registry.js
CHANGED