@abaplint/core 2.113.245 → 2.113.247
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 +0 -5
- package/build/src/abap/2_statements/expressions/index.js +0 -1
- package/build/src/abap/2_statements/expressions/sql_field.js +1 -1
- package/build/src/abap/2_statements/expressions/sql_function.js +2 -1
- package/build/src/abap/2_statements/statements/convert.js +5 -4
- package/build/src/abap/5_syntax/statements/convert.js +15 -8
- package/build/src/objects/_abap_object.js +1 -0
- package/build/src/objects/_abstract_object.js +1 -0
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
- package/build/src/abap/2_statements/expressions/sql_cast.js +0 -17
package/build/abaplint.d.ts
CHANGED
|
@@ -2463,7 +2463,6 @@ declare namespace Expressions {
|
|
|
2463
2463
|
SQLArithmetics,
|
|
2464
2464
|
SQLAsName,
|
|
2465
2465
|
SQLCase,
|
|
2466
|
-
SQLCast,
|
|
2467
2466
|
SQLCDSParameters,
|
|
2468
2467
|
SQLClient,
|
|
2469
2468
|
SQLCompareOperator,
|
|
@@ -6196,10 +6195,6 @@ declare class SQLCase extends Expression {
|
|
|
6196
6195
|
getRunnable(): IStatementRunnable;
|
|
6197
6196
|
}
|
|
6198
6197
|
|
|
6199
|
-
declare class SQLCast extends Expression {
|
|
6200
|
-
getRunnable(): IStatementRunnable;
|
|
6201
|
-
}
|
|
6202
|
-
|
|
6203
6198
|
declare class SQLCDSParameters extends Expression {
|
|
6204
6199
|
getRunnable(): IStatementRunnable;
|
|
6205
6200
|
}
|
|
@@ -179,7 +179,6 @@ __exportStar(require("./sql_arithmetic_operator"), exports);
|
|
|
179
179
|
__exportStar(require("./sql_arithmetics"), exports);
|
|
180
180
|
__exportStar(require("./sql_as_name"), exports);
|
|
181
181
|
__exportStar(require("./sql_case"), exports);
|
|
182
|
-
__exportStar(require("./sql_cast"), exports);
|
|
183
182
|
__exportStar(require("./sql_cds_parameters"), exports);
|
|
184
183
|
__exportStar(require("./sql_client"), exports);
|
|
185
184
|
__exportStar(require("./sql_compare_operator"), exports);
|
|
@@ -12,7 +12,7 @@ class SQLField extends combi_1.Expression {
|
|
|
12
12
|
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2), version_1.Version.OpenABAP);
|
|
13
13
|
const as = (0, combi_1.seq)("AS", _1.SQLAsName);
|
|
14
14
|
const parenFieldName = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFieldName, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.WParenRight)));
|
|
15
|
-
const field = (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLCase,
|
|
15
|
+
const field = (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLCase, sql_function_1.SQLFunction, sql_path_1.SQLPath, _1.SQLFieldName, abap, _1.Constant, parenFieldName);
|
|
16
16
|
const parenField = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), field, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
17
17
|
const sub = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.altPrio)(parenField, field)));
|
|
18
18
|
const arith = (0, combi_1.ver)(version_1.Version.v740sp05, sub);
|
|
@@ -8,10 +8,11 @@ const integer_1 = require("./integer");
|
|
|
8
8
|
const sql_function_input_1 = require("./sql_function_input");
|
|
9
9
|
class SQLFunction extends combi_1.Expression {
|
|
10
10
|
getRunnable() {
|
|
11
|
-
const castTypes = (0, combi_1.altPrio)((0, combi_1.seq)("CHAR", (0, combi_1.optPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)))), (0, combi_1.seq)("DEC", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, ",", integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.seq)("NUMC", (0, combi_1.optPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)))), "FLTP", "INT2", "INT4", "INT8");
|
|
11
|
+
const castTypes = (0, combi_1.altPrio)((0, combi_1.seq)("CHAR", (0, combi_1.optPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)))), (0, combi_1.seq)("DEC", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, ",", integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.seq)("NUMC", (0, combi_1.optPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)))), "DATS", "FLTP", "INT2", "INT4", "INT8");
|
|
12
12
|
const commaParam = (0, combi_1.seq)(",", sql_function_input_1.SQLFunctionInput);
|
|
13
13
|
// note: the function names are not keywords, they are usually in lower case
|
|
14
14
|
const abs = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^abs$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
15
|
+
// yea, 750 is correct, but it also works technically in version v740sp05
|
|
15
16
|
const cast = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)((0, combi_1.regex)(/^cast$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, "AS", castTypes, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
16
17
|
const ceil = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^ceil$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
17
18
|
const coalesce = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.regex)(/^coalesce$/i), (0, combi_1.tok)(tokens_1.ParenLeftW), sql_function_input_1.SQLFunctionInput, commaParam, (0, combi_1.optPrio)(commaParam), (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
@@ -9,17 +9,18 @@ class Convert {
|
|
|
9
9
|
const intoTime = (0, combi_1.seq)("TIME", expressions_1.Target);
|
|
10
10
|
const intoDate = (0, combi_1.seq)("DATE", expressions_1.Target);
|
|
11
11
|
const into = (0, combi_1.seq)("INTO", (0, combi_1.per)(intoTime, intoDate));
|
|
12
|
-
const
|
|
12
|
+
const daylightSource = (0, combi_1.seq)("DAYLIGHT SAVING TIME", expressions_1.Source);
|
|
13
|
+
const daylightTarget = (0, combi_1.seq)("DAYLIGHT SAVING TIME", expressions_1.Target);
|
|
13
14
|
const zone = (0, combi_1.seq)("TIME ZONE", expressions_1.Source);
|
|
14
|
-
const time = (0, combi_1.seq)("TIME STAMP", expressions_1.Source, (0, combi_1.per)(zone, into,
|
|
15
|
+
const time = (0, combi_1.seq)("TIME STAMP", expressions_1.Source, (0, combi_1.per)(zone, into, daylightTarget));
|
|
15
16
|
const dat = (0, combi_1.seq)("DATE", expressions_1.Source);
|
|
16
17
|
const tim = (0, combi_1.seq)("TIME", expressions_1.Source);
|
|
17
18
|
const stamp = (0, combi_1.seq)("INTO TIME STAMP", expressions_1.Target);
|
|
18
19
|
const intoutc = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("INTO UTCLONG", expressions_1.Target));
|
|
19
20
|
const invert = (0, combi_1.seq)("INTO INVERTED-DATE", expressions_1.Target);
|
|
20
|
-
const date = (0, combi_1.seq)((0, combi_1.per)(dat, tim), (0, combi_1.per)(
|
|
21
|
+
const date = (0, combi_1.seq)((0, combi_1.per)(dat, tim), (0, combi_1.per)(daylightSource, stamp, zone, invert, intoutc));
|
|
21
22
|
const inv = (0, combi_1.seq)("INVERTED-DATE", expressions_1.Source, "INTO DATE", expressions_1.Target);
|
|
22
|
-
const utclong = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("UTCLONG", expressions_1.Source, (0, combi_1.per)(zone, into,
|
|
23
|
+
const utclong = (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("UTCLONG", expressions_1.Source, (0, combi_1.per)(zone, into, daylightSource)));
|
|
23
24
|
return (0, combi_1.seq)("CONVERT", (0, combi_1.alt)(time, date, inv, utclong));
|
|
24
25
|
}
|
|
25
26
|
}
|
|
@@ -12,14 +12,21 @@ class Convert {
|
|
|
12
12
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
13
13
|
source_1.Source.runSyntax(s, input);
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const timeTargets = node.findExpressionsAfterToken("TIME");
|
|
16
|
+
for (const timeTarget of timeTargets) {
|
|
17
|
+
const concat = node.concatTokens().toUpperCase();
|
|
18
|
+
if ((timeTarget === null || timeTarget === void 0 ? void 0 : timeTarget.get()) instanceof Expressions.Target) {
|
|
19
|
+
const inline = timeTarget === null || timeTarget === void 0 ? void 0 : timeTarget.findDirectExpression(Expressions.InlineData);
|
|
20
|
+
if (inline) {
|
|
21
|
+
let targetType = new basic_1.TimeType();
|
|
22
|
+
if (concat.includes("DAYLIGHT SAVING TIME " + inline.concatTokens().toUpperCase())) {
|
|
23
|
+
targetType = new basic_1.CharacterType(1);
|
|
24
|
+
}
|
|
25
|
+
inline_data_1.InlineData.runSyntax(inline, input, targetType);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
target_1.Target.runSyntax(timeTarget, input);
|
|
29
|
+
}
|
|
23
30
|
}
|
|
24
31
|
}
|
|
25
32
|
const dateTarget = node.findExpressionAfterToken("DATE");
|
package/build/src/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SQLCast = void 0;
|
|
4
|
-
const _1 = require(".");
|
|
5
|
-
const version_1 = require("../../../version");
|
|
6
|
-
const tokens_1 = require("../../1_lexer/tokens");
|
|
7
|
-
const combi_1 = require("../combi");
|
|
8
|
-
const sql_field_name_1 = require("./sql_field_name");
|
|
9
|
-
class SQLCast extends combi_1.Expression {
|
|
10
|
-
getRunnable() {
|
|
11
|
-
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2), version_1.Version.OpenABAP);
|
|
12
|
-
// todo: from version something
|
|
13
|
-
return (0, combi_1.seq)("CAST", "(", (0, combi_1.opt)((0, combi_1.altPrio)(sql_field_name_1.SQLFieldName, abap)), "AS", sql_field_name_1.SQLFieldName, ")");
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.SQLCast = SQLCast;
|
|
17
|
-
//# sourceMappingURL=sql_cast.js.map
|