@abaplint/core 2.91.23 → 2.91.24
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/abap/2_statements/expressions/index.js +1 -0
- package/build/src/abap/2_statements/expressions/sql_field.js +22 -0
- package/build/src/abap/2_statements/expressions/sql_field_list.js +1 -10
- package/build/src/abap/2_statements/expressions/sql_field_list_loop.js +1 -2
- package/build/src/registry.js +1 -1
- package/build/src/rules/downport.js +2 -2
- package/build/src/rules/select_add_order_by.js +2 -2
- package/package.json +1 -1
package/build/abaplint.d.ts
CHANGED
|
@@ -1933,6 +1933,7 @@ declare namespace Expressions {
|
|
|
1933
1933
|
SQLCompareOperator,
|
|
1934
1934
|
SQLCompare,
|
|
1935
1935
|
SQLCond,
|
|
1936
|
+
SQLField,
|
|
1936
1937
|
SQLFieldListLoop,
|
|
1937
1938
|
SQLFieldList,
|
|
1938
1939
|
SQLFieldName,
|
|
@@ -4938,6 +4939,10 @@ declare class SQLCond extends Expression {
|
|
|
4938
4939
|
getRunnable(): IStatementRunnable;
|
|
4939
4940
|
}
|
|
4940
4941
|
|
|
4942
|
+
declare class SQLField extends Expression {
|
|
4943
|
+
getRunnable(): IStatementRunnable;
|
|
4944
|
+
}
|
|
4945
|
+
|
|
4941
4946
|
declare class SQLFieldList extends Expression {
|
|
4942
4947
|
getRunnable(): IStatementRunnable;
|
|
4943
4948
|
}
|
|
@@ -163,6 +163,7 @@ __exportStar(require("./sql_client"), exports);
|
|
|
163
163
|
__exportStar(require("./sql_compare_operator"), exports);
|
|
164
164
|
__exportStar(require("./sql_compare"), exports);
|
|
165
165
|
__exportStar(require("./sql_cond"), exports);
|
|
166
|
+
__exportStar(require("./sql_field"), exports);
|
|
166
167
|
__exportStar(require("./sql_field_list_loop"), exports);
|
|
167
168
|
__exportStar(require("./sql_field_list"), exports);
|
|
168
169
|
__exportStar(require("./sql_field_name"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SQLField = void 0;
|
|
4
|
+
const combi_1 = require("../combi");
|
|
5
|
+
const _1 = require(".");
|
|
6
|
+
const version_1 = require("../../../version");
|
|
7
|
+
const tokens_1 = require("../../1_lexer/tokens");
|
|
8
|
+
const sql_function_1 = require("./sql_function");
|
|
9
|
+
const simple_field_chain_1 = require("./simple_field_chain");
|
|
10
|
+
const sql_path_1 = require("./sql_path");
|
|
11
|
+
class SQLField extends combi_1.Expression {
|
|
12
|
+
getRunnable() {
|
|
13
|
+
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), simple_field_chain_1.SimpleFieldChain));
|
|
14
|
+
const as = (0, combi_1.seq)("AS", _1.SQLAsName);
|
|
15
|
+
const field = (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLCase, sql_function_1.SQLFunction, sql_path_1.SQLPath, _1.SQLFieldName, abap, _1.Constant);
|
|
16
|
+
const sub = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), field, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW))));
|
|
17
|
+
const arith = (0, combi_1.ver)(version_1.Version.v740sp05, sub);
|
|
18
|
+
return (0, combi_1.seq)(field, (0, combi_1.optPrio)(arith), (0, combi_1.optPrio)(as));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.SQLField = SQLField;
|
|
22
|
+
//# sourceMappingURL=sql_field.js.map
|
|
@@ -4,19 +4,10 @@ exports.SQLFieldList = void 0;
|
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
const version_1 = require("../../../version");
|
|
7
|
-
const tokens_1 = require("../../1_lexer/tokens");
|
|
8
|
-
const sql_function_1 = require("./sql_function");
|
|
9
|
-
const simple_field_chain_1 = require("./simple_field_chain");
|
|
10
|
-
const sql_path_1 = require("./sql_path");
|
|
11
7
|
class SQLFieldList extends combi_1.Expression {
|
|
12
8
|
getRunnable() {
|
|
13
9
|
const comma = (0, combi_1.optPrio)((0, combi_1.ver)(version_1.Version.v740sp05, ","));
|
|
14
|
-
|
|
15
|
-
const as = (0, combi_1.seq)("AS", _1.SQLAsName);
|
|
16
|
-
const field = (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLCase, sql_function_1.SQLFunction, sql_path_1.SQLPath, _1.SQLFieldName, abap, _1.Constant);
|
|
17
|
-
const sub = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), field, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW))));
|
|
18
|
-
const arith = (0, combi_1.ver)(version_1.Version.v740sp05, sub);
|
|
19
|
-
return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.plusPrio)((0, combi_1.seq)(field, (0, combi_1.optPrio)(arith), (0, combi_1.optPrio)(as), comma)));
|
|
10
|
+
return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.plusPrio)((0, combi_1.seq)(_1.SQLField, comma)));
|
|
20
11
|
}
|
|
21
12
|
}
|
|
22
13
|
exports.SQLFieldList = SQLFieldList;
|
|
@@ -4,14 +4,13 @@ exports.SQLFieldListLoop = void 0;
|
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
const version_1 = require("../../../version");
|
|
7
|
-
const sql_function_1 = require("./sql_function");
|
|
8
7
|
const sql_path_1 = require("./sql_path");
|
|
9
8
|
// loop must include one field from the database table
|
|
10
9
|
class SQLFieldListLoop extends combi_1.Expression {
|
|
11
10
|
getRunnable() {
|
|
12
11
|
const comma = (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp05, ","));
|
|
13
12
|
const as = (0, combi_1.seq)("AS", _1.SQLAsName);
|
|
14
|
-
const someField = (0, combi_1.seq)(
|
|
13
|
+
const someField = (0, combi_1.seq)(_1.SQLField, comma);
|
|
15
14
|
const fieldList = (0, combi_1.seq)((0, combi_1.star)(someField), (0, combi_1.alt)(_1.SQLFieldName, sql_path_1.SQLPath), (0, combi_1.optPrio)(as), comma, (0, combi_1.star)(someField));
|
|
16
15
|
const fields = (0, combi_1.alt)("*", _1.Dynamic, fieldList);
|
|
17
16
|
return fields;
|
package/build/src/registry.js
CHANGED
|
@@ -421,7 +421,7 @@ Only one transformation is applied to a statement at a time, so multiple steps m
|
|
|
421
421
|
return undefined;
|
|
422
422
|
}
|
|
423
423
|
let fieldDefinition = "";
|
|
424
|
-
const fields = fieldList.
|
|
424
|
+
const fields = fieldList.findAllExpressions(Expressions.SQLFieldName);
|
|
425
425
|
const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
|
|
426
426
|
if (fields.length === 1) {
|
|
427
427
|
fieldDefinition = `DATA ${name} TYPE ${tableName}-${fields[0].concatTokens()}.`;
|
|
@@ -477,7 +477,7 @@ ${indentation}`);
|
|
|
477
477
|
return undefined;
|
|
478
478
|
}
|
|
479
479
|
let fieldDefinitions = "";
|
|
480
|
-
for (const f of fieldList.
|
|
480
|
+
for (const f of fieldList.findAllExpressions(Expressions.SQLFieldName)) {
|
|
481
481
|
let fieldName = f.concatTokens();
|
|
482
482
|
if (fieldName.includes("~")) {
|
|
483
483
|
const split = fieldName.split("~");
|
|
@@ -60,8 +60,8 @@ If the target is a sorted/hashed table, no issue is reported`,
|
|
|
60
60
|
continue;
|
|
61
61
|
}
|
|
62
62
|
// skip COUNT(*)
|
|
63
|
-
const list = s.
|
|
64
|
-
if (
|
|
63
|
+
const list = s.findAllExpressions(Expressions.SQLField);
|
|
64
|
+
if (list.length === 1 && ((_a = list[0].getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SQLAggregation) {
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
67
67
|
else if (s.findFirstExpression(Expressions.SQLOrderBy)) {
|