@abaplint/core 2.91.21 → 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 +15 -0
- package/build/src/abap/2_statements/expressions/index.js +1 -0
- package/build/src/abap/2_statements/expressions/perform_changing.js +2 -2
- 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/abap/5_syntax/statements/perform.js +3 -2
- package/build/src/objects/event_binding.js +21 -0
- package/build/src/objects/index.js +1 -0
- package/build/src/registry.js +1 -1
- package/build/src/rules/downport.js +6 -5
- package/build/src/rules/select_add_order_by.js +2 -2
- package/build/src/rules/sy_modification.js +6 -1
- package/package.json +3 -3
package/build/abaplint.d.ts
CHANGED
|
@@ -1705,6 +1705,15 @@ declare class EnhancementSpot extends AbstractObject {
|
|
|
1705
1705
|
private parseXML;
|
|
1706
1706
|
}
|
|
1707
1707
|
|
|
1708
|
+
declare class EventBinding extends AbstractObject {
|
|
1709
|
+
getType(): string;
|
|
1710
|
+
getAllowedNaming(): {
|
|
1711
|
+
maxLength: number;
|
|
1712
|
+
allowNamespace: boolean;
|
|
1713
|
+
};
|
|
1714
|
+
getDescription(): string | undefined;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1708
1717
|
declare class EventHandler extends Expression {
|
|
1709
1718
|
getRunnable(): IStatementRunnable;
|
|
1710
1719
|
}
|
|
@@ -1924,6 +1933,7 @@ declare namespace Expressions {
|
|
|
1924
1933
|
SQLCompareOperator,
|
|
1925
1934
|
SQLCompare,
|
|
1926
1935
|
SQLCond,
|
|
1936
|
+
SQLField,
|
|
1927
1937
|
SQLFieldListLoop,
|
|
1928
1938
|
SQLFieldList,
|
|
1929
1939
|
SQLFieldName,
|
|
@@ -3957,6 +3967,7 @@ declare namespace Objects {
|
|
|
3957
3967
|
EnhancementImplementation,
|
|
3958
3968
|
IBadiDefinition,
|
|
3959
3969
|
EnhancementSpot,
|
|
3970
|
+
EventBinding,
|
|
3960
3971
|
ExtensionIndex,
|
|
3961
3972
|
FieldCatalog,
|
|
3962
3973
|
FormObjectForm,
|
|
@@ -4928,6 +4939,10 @@ declare class SQLCond extends Expression {
|
|
|
4928
4939
|
getRunnable(): IStatementRunnable;
|
|
4929
4940
|
}
|
|
4930
4941
|
|
|
4942
|
+
declare class SQLField extends Expression {
|
|
4943
|
+
getRunnable(): IStatementRunnable;
|
|
4944
|
+
}
|
|
4945
|
+
|
|
4931
4946
|
declare class SQLFieldList extends Expression {
|
|
4932
4947
|
getRunnable(): IStatementRunnable;
|
|
4933
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);
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PerformChanging = void 0;
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
|
-
const
|
|
5
|
+
const target_1 = require("./target");
|
|
6
6
|
class PerformChanging extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
const changing = (0, combi_1.seq)("CHANGING", (0, combi_1.plus)(
|
|
8
|
+
const changing = (0, combi_1.seq)("CHANGING", (0, combi_1.plus)(target_1.Target));
|
|
9
9
|
return changing;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -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;
|
|
@@ -5,6 +5,7 @@ const Expressions = require("../../2_statements/expressions");
|
|
|
5
5
|
const Statements = require("../../2_statements/statements");
|
|
6
6
|
const _reference_1 = require("../_reference");
|
|
7
7
|
const source_1 = require("../expressions/source");
|
|
8
|
+
const target_1 = require("../expressions/target");
|
|
8
9
|
class Perform {
|
|
9
10
|
runSyntax(node, scope, filename) {
|
|
10
11
|
if (!(node.get() instanceof Statements.Perform)) {
|
|
@@ -13,8 +14,8 @@ class Perform {
|
|
|
13
14
|
////////////////////////////
|
|
14
15
|
// check parameters are defined
|
|
15
16
|
for (const c of node.findDirectExpressions(Expressions.PerformChanging)) {
|
|
16
|
-
for (const s of c.findDirectExpressions(Expressions.
|
|
17
|
-
new
|
|
17
|
+
for (const s of c.findDirectExpressions(Expressions.Target)) {
|
|
18
|
+
new target_1.Target().runSyntax(s, scope, filename);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
for (const t of node.findDirectExpressions(Expressions.PerformTables)) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventBinding = void 0;
|
|
4
|
+
const _abstract_object_1 = require("./_abstract_object");
|
|
5
|
+
class EventBinding extends _abstract_object_1.AbstractObject {
|
|
6
|
+
getType() {
|
|
7
|
+
return "EVTB";
|
|
8
|
+
}
|
|
9
|
+
getAllowedNaming() {
|
|
10
|
+
return {
|
|
11
|
+
maxLength: 40,
|
|
12
|
+
allowNamespace: true,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
getDescription() {
|
|
16
|
+
// todo
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.EventBinding = EventBinding;
|
|
21
|
+
//# sourceMappingURL=event_binding.js.map
|
|
@@ -51,6 +51,7 @@ __exportStar(require("./ecatt_test_data_container"), exports);
|
|
|
51
51
|
__exportStar(require("./ecatt_test_script"), exports);
|
|
52
52
|
__exportStar(require("./enhancement_implementation"), exports);
|
|
53
53
|
__exportStar(require("./enhancement_spot"), exports);
|
|
54
|
+
__exportStar(require("./event_binding"), exports);
|
|
54
55
|
__exportStar(require("./extension_index"), exports);
|
|
55
56
|
__exportStar(require("./field_catalog"), exports);
|
|
56
57
|
__exportStar(require("./form_object_form"), exports);
|
package/build/src/registry.js
CHANGED
|
@@ -340,8 +340,9 @@ Only one transformation is applied to a statement at a time, so multiple steps m
|
|
|
340
340
|
const candidates = [high.findAllExpressionsRecursive(Expressions.SQLTarget),
|
|
341
341
|
high.findAllExpressionsRecursive(Expressions.SQLSource),
|
|
342
342
|
high.findAllExpressionsRecursive(Expressions.SQLSourceSimple)].flat();
|
|
343
|
-
for (const c of candidates) {
|
|
344
|
-
if (c.getFirstToken() instanceof tokens_1.WAt
|
|
343
|
+
for (const c of candidates.reverse()) {
|
|
344
|
+
if (c.getFirstToken() instanceof tokens_1.WAt
|
|
345
|
+
|| c.getFirstToken() instanceof tokens_1.At) {
|
|
345
346
|
addFix(c.getFirstToken());
|
|
346
347
|
}
|
|
347
348
|
}
|
|
@@ -353,7 +354,7 @@ Only one transformation is applied to a statement at a time, so multiple steps m
|
|
|
353
354
|
}
|
|
354
355
|
}
|
|
355
356
|
if (fix !== undefined) {
|
|
356
|
-
return issue_1.Issue.atToken(lowFile, low.getFirstToken(), "SQL, remove
|
|
357
|
+
return issue_1.Issue.atToken(lowFile, low.getFirstToken(), "SQL, remove @ and ,", this.getMetadata().key, this.conf.severity, fix);
|
|
357
358
|
}
|
|
358
359
|
for (const c of high.findAllExpressionsRecursive(Expressions.SQLIn)) {
|
|
359
360
|
const children = c.getChildren();
|
|
@@ -420,7 +421,7 @@ Only one transformation is applied to a statement at a time, so multiple steps m
|
|
|
420
421
|
return undefined;
|
|
421
422
|
}
|
|
422
423
|
let fieldDefinition = "";
|
|
423
|
-
const fields = fieldList.
|
|
424
|
+
const fields = fieldList.findAllExpressions(Expressions.SQLFieldName);
|
|
424
425
|
const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || "error";
|
|
425
426
|
if (fields.length === 1) {
|
|
426
427
|
fieldDefinition = `DATA ${name} TYPE ${tableName}-${fields[0].concatTokens()}.`;
|
|
@@ -476,7 +477,7 @@ ${indentation}`);
|
|
|
476
477
|
return undefined;
|
|
477
478
|
}
|
|
478
479
|
let fieldDefinitions = "";
|
|
479
|
-
for (const f of fieldList.
|
|
480
|
+
for (const f of fieldList.findAllExpressions(Expressions.SQLFieldName)) {
|
|
480
481
|
let fieldName = f.concatTokens();
|
|
481
482
|
if (fieldName.includes("~")) {
|
|
482
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)) {
|
|
@@ -19,7 +19,9 @@ class SyModification extends _abap_rule_1.ABAPRule {
|
|
|
19
19
|
key: "sy_modification",
|
|
20
20
|
title: "Modification of SY fields",
|
|
21
21
|
shortDescription: `Finds modification of sy fields`,
|
|
22
|
-
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
22
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm
|
|
23
|
+
|
|
24
|
+
Changes to SY-TVAR* fields are not reported`,
|
|
23
25
|
tags: [_irule_1.RuleTag.SingleFile],
|
|
24
26
|
badExample: `
|
|
25
27
|
sy-uname = 2.
|
|
@@ -42,6 +44,9 @@ sy = sy.`,
|
|
|
42
44
|
const firstChild = t.getChildren()[0];
|
|
43
45
|
if (firstChild.get() instanceof Expressions.TargetField
|
|
44
46
|
&& firstChild.getFirstToken().getStr().toUpperCase() === "SY") {
|
|
47
|
+
if (t.concatTokens().toUpperCase().startsWith("SY-TVAR")) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
45
50
|
const message = "Modification of SY field";
|
|
46
51
|
const issue = issue_1.Issue.atToken(file, firstChild.getFirstToken(), message, this.getMetadata().key, this.conf.severity);
|
|
47
52
|
issues.push(issue);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.91.
|
|
3
|
+
"version": "2.91.24",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://abaplint.org",
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@microsoft/api-extractor": "^7.
|
|
48
|
+
"@microsoft/api-extractor": "^7.29.0",
|
|
49
49
|
"@types/chai": "^4.3.1",
|
|
50
50
|
"@types/mocha": "^9.1.1",
|
|
51
|
-
"@types/node": "^18.6.
|
|
51
|
+
"@types/node": "^18.6.4",
|
|
52
52
|
"chai": "^4.3.6",
|
|
53
53
|
"eslint": "^8.21.0",
|
|
54
54
|
"mocha": "^10.0.0",
|