@abaplint/core 2.93.55 → 2.93.57
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 +6 -1
- package/build/src/abap/2_statements/expressions/entity_association.js +11 -0
- package/build/src/abap/2_statements/expressions/index.js +3 -1
- package/build/src/abap/2_statements/expressions/source.js +3 -2
- package/build/src/abap/2_statements/expressions/sql_aggregation.js +1 -1
- package/build/src/abap/2_statements/expressions/sql_function.js +3 -2
- package/build/src/abap/2_statements/expressions/sql_in.js +2 -1
- package/build/src/abap/2_statements/statements/method_def.js +4 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/avoid_use.js +4 -2
- package/package.json +1 -1
package/build/abaplint.d.ts
CHANGED
|
@@ -1758,6 +1758,10 @@ declare class EnhancementSpot extends AbstractObject {
|
|
|
1758
1758
|
private parseXML;
|
|
1759
1759
|
}
|
|
1760
1760
|
|
|
1761
|
+
declare class EntityAssociation extends Expression {
|
|
1762
|
+
getRunnable(): IStatementRunnable;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1761
1765
|
declare class EventBinding extends AbstractObject {
|
|
1762
1766
|
getType(): string;
|
|
1763
1767
|
getAllowedNaming(): {
|
|
@@ -1853,7 +1857,6 @@ declare namespace Expressions {
|
|
|
1853
1857
|
Cast,
|
|
1854
1858
|
ClassFinal,
|
|
1855
1859
|
ClassFriends,
|
|
1856
|
-
SimpleTarget,
|
|
1857
1860
|
ClassGlobal_2 as ClassGlobal,
|
|
1858
1861
|
ClassName,
|
|
1859
1862
|
Color,
|
|
@@ -1885,6 +1888,7 @@ declare namespace Expressions {
|
|
|
1885
1888
|
Dereference,
|
|
1886
1889
|
Destination,
|
|
1887
1890
|
Dynamic,
|
|
1891
|
+
EntityAssociation,
|
|
1888
1892
|
EventHandler,
|
|
1889
1893
|
ExceptionName,
|
|
1890
1894
|
FieldAll,
|
|
@@ -1980,6 +1984,7 @@ declare namespace Expressions {
|
|
|
1980
1984
|
SimpleSource2,
|
|
1981
1985
|
SimpleSource3,
|
|
1982
1986
|
SimpleSource4,
|
|
1987
|
+
SimpleTarget,
|
|
1983
1988
|
SourceFieldSymbol,
|
|
1984
1989
|
SourceField,
|
|
1985
1990
|
Source,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityAssociation = void 0;
|
|
4
|
+
const combi_1 = require("../combi");
|
|
5
|
+
class EntityAssociation extends combi_1.Expression {
|
|
6
|
+
getRunnable() {
|
|
7
|
+
return (0, combi_1.regex)(/^[\w]+\\_[\w]+$/);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.EntityAssociation = EntityAssociation;
|
|
11
|
+
//# sourceMappingURL=entity_association.js.map
|
|
@@ -30,7 +30,6 @@ __exportStar(require("./call_transformation_parameters"), exports);
|
|
|
30
30
|
__exportStar(require("./cast"), exports);
|
|
31
31
|
__exportStar(require("./class_final"), exports);
|
|
32
32
|
__exportStar(require("./class_friends"), exports);
|
|
33
|
-
__exportStar(require("./simple_target"), exports);
|
|
34
33
|
__exportStar(require("./class_global"), exports);
|
|
35
34
|
__exportStar(require("./class_name"), exports);
|
|
36
35
|
__exportStar(require("./color"), exports);
|
|
@@ -62,6 +61,8 @@ __exportStar(require("./definition_name"), exports);
|
|
|
62
61
|
__exportStar(require("./dereference"), exports);
|
|
63
62
|
__exportStar(require("./destination"), exports);
|
|
64
63
|
__exportStar(require("./dynamic"), exports);
|
|
64
|
+
__exportStar(require("./entity_association"), exports);
|
|
65
|
+
__exportStar(require("./entity_association"), exports);
|
|
65
66
|
__exportStar(require("./event_handler"), exports);
|
|
66
67
|
__exportStar(require("./exception_name"), exports);
|
|
67
68
|
__exportStar(require("./field_all"), exports);
|
|
@@ -157,6 +158,7 @@ __exportStar(require("./simple_source1"), exports);
|
|
|
157
158
|
__exportStar(require("./simple_source2"), exports);
|
|
158
159
|
__exportStar(require("./simple_source3"), exports);
|
|
159
160
|
__exportStar(require("./simple_source4"), exports);
|
|
161
|
+
__exportStar(require("./simple_target"), exports);
|
|
160
162
|
__exportStar(require("./source_field_symbol"), exports);
|
|
161
163
|
__exportStar(require("./source_field"), exports);
|
|
162
164
|
__exportStar(require("./source"), exports);
|
|
@@ -21,7 +21,7 @@ class Source extends combi_1.Expression {
|
|
|
21
21
|
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), Source, rparen);
|
|
22
22
|
const after = (0, combi_1.seq)((0, combi_1.altPrio)("&", "&&", _1.ArithOperator), Source);
|
|
23
23
|
const bool = (0, combi_1.seq)((0, combi_1.altPrio)((0, combi_1.ver)(version_1.Version.v702, (0, combi_1.regex)(/^BOOLC$/i)), (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.regex)(/^XSDBOOL$/i))), (0, combi_1.tok)(tokens_1.ParenLeftW), _1.Cond, ")");
|
|
24
|
-
const prefix = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.
|
|
24
|
+
const prefix = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WPlus), "BIT-NOT");
|
|
25
25
|
const old = (0, combi_1.seq)((0, combi_1.optPrio)(prefix), (0, combi_1.altPrio)(_1.Constant, _1.StringTemplate, text_element_1.TextElement, bool, method, (0, combi_1.seq)(_1.FieldChain, (0, combi_1.optPrio)(dereference_1.Dereference)), paren), (0, combi_1.optPrio)(after));
|
|
26
26
|
const corr = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CORRESPONDING", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.CorrespondingBody, rparen, (0, combi_1.optPrio)(after)));
|
|
27
27
|
const conv = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("CONV", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.ConvBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
|
|
@@ -32,7 +32,8 @@ class Source extends combi_1.Expression {
|
|
|
32
32
|
const exact = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("EXACT", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), Source, rparen, (0, combi_1.optPrio)(after)));
|
|
33
33
|
const filter = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)("FILTER", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.FilterBody, rparen));
|
|
34
34
|
const reduce = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)("REDUCE", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.ReduceBody, rparen, (0, combi_1.optPrio)(after)));
|
|
35
|
-
const
|
|
35
|
+
const prefix1 = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WDashW), (0, combi_1.tok)(tokens_1.WPlusW));
|
|
36
|
+
const ret = (0, combi_1.seq)((0, combi_1.starPrio)(prefix1), (0, combi_1.altPrio)(filter, reff, corr, conv, value, cond, exact, swit, reduce, old));
|
|
36
37
|
return ret;
|
|
37
38
|
}
|
|
38
39
|
}
|
|
@@ -8,7 +8,7 @@ const dynamic_1 = require("./dynamic");
|
|
|
8
8
|
const sql_arithmetics_1 = require("./sql_arithmetics");
|
|
9
9
|
class SQLAggregation extends combi_1.Expression {
|
|
10
10
|
getRunnable() {
|
|
11
|
-
const f = (0, combi_1.altPrio)(sql_arithmetics_1.SQLArithmetics, dynamic_1.Dynamic);
|
|
11
|
+
const f = (0, combi_1.altPrio)(sql_arithmetics_1.SQLArithmetics, dynamic_1.Dynamic, _1.SQLFunction);
|
|
12
12
|
const fparen = (0, combi_1.seq)("(", _1.Field, ")");
|
|
13
13
|
const count = (0, combi_1.seq)("COUNT", (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.tok)(tokens_1.ParenLeftW)), (0, combi_1.optPrio)("DISTINCT"), (0, combi_1.altPrio)("*", _1.Field, fparen), ")");
|
|
14
14
|
const max = (0, combi_1.seq)("MAX", (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenLeft), (0, combi_1.tok)(tokens_1.ParenLeftW)), f, ")");
|
|
@@ -10,12 +10,13 @@ const sql_alias_field_1 = require("./sql_alias_field");
|
|
|
10
10
|
const sql_field_name_1 = require("./sql_field_name");
|
|
11
11
|
const simple_source3_1 = require("./simple_source3");
|
|
12
12
|
const source_1 = require("./source");
|
|
13
|
+
const sql_aggregation_1 = require("./sql_aggregation");
|
|
13
14
|
class SQLFunction extends combi_1.Expression {
|
|
14
15
|
getRunnable() {
|
|
15
16
|
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), source_1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
16
17
|
const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.alt)(simple_source3_1.SimpleSource3, paren)));
|
|
17
|
-
const param = (0, combi_1.alt)(sql_field_name_1.SQLFieldName, sql_alias_field_1.SQLAliasField, SQLFunction, constant_1.Constant, at);
|
|
18
|
-
const castTypes = (0, combi_1.altPrio)((0, combi_1.seq)("CHAR", (0, combi_1.tok)(tokens_1.ParenLeftW), integer_1.Integer, (0, combi_1.tok)(tokens_1.WParenRightW)), "FLTP");
|
|
18
|
+
const param = (0, combi_1.alt)(sql_field_name_1.SQLFieldName, sql_alias_field_1.SQLAliasField, SQLFunction, constant_1.Constant, sql_aggregation_1.SQLAggregation, at);
|
|
19
|
+
const castTypes = (0, combi_1.altPrio)((0, combi_1.seq)("CHAR", (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)), "FLTP");
|
|
19
20
|
const abs = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("abs", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
20
21
|
const cast = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.seq)("cast", (0, combi_1.tok)(tokens_1.ParenLeftW), param, "AS", castTypes, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
21
22
|
const ceil = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("ceil", (0, combi_1.tok)(tokens_1.ParenLeftW), param, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
@@ -8,7 +8,8 @@ const version_1 = require("../../../version");
|
|
|
8
8
|
class SQLIn extends combi_1.Expression {
|
|
9
9
|
getRunnable() {
|
|
10
10
|
const val = new _1.SQLSource();
|
|
11
|
-
const
|
|
11
|
+
const short = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.At), _1.SimpleSource3);
|
|
12
|
+
const listOld = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeft), (0, combi_1.alt)((0, combi_1.ver)(version_1.Version.v740sp05, short), val), (0, combi_1.starPrio)((0, combi_1.seq)(",", val)), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRight), (0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
12
13
|
const listNew = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), val, (0, combi_1.starPrio)((0, combi_1.seq)(",", val)), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRight), (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
13
14
|
const list = (0, combi_1.alt)(listOld, (0, combi_1.ver)(version_1.Version.v740sp02, listNew)); // version is a guess, https://github.com/abaplint/abaplint/issues/2530
|
|
14
15
|
const subSelect = (0, combi_1.seq)("(", _1.Select, ")");
|
|
@@ -13,7 +13,10 @@ class MethodDef {
|
|
|
13
13
|
const tableFunction = (0, combi_1.seq)("TABLE FUNCTION", (0, combi_1.regex)(/^\w+?$/));
|
|
14
14
|
// todo, this is only from version something
|
|
15
15
|
const ddl = "DDL OBJECT OPTIONS CDS SESSION CLIENT REQUIRED";
|
|
16
|
-
const
|
|
16
|
+
const result = (0, combi_1.seq)("RESULT", expressions_1.MethodParamName);
|
|
17
|
+
const link = (0, combi_1.seq)("LINK", expressions_1.MethodParamName);
|
|
18
|
+
const full = (0, combi_1.seq)("FULL", expressions_1.MethodParamName);
|
|
19
|
+
const behavior = (0, combi_1.altPrio)((0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, "FOR ACTION", expressions_1.TypeName, result), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, "FOR CREATE", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation)), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, "FOR READ", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation), (0, combi_1.optPrio)(full), result, (0, combi_1.optPrio)(link)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("DETERMINE ON MODIFY IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName));
|
|
17
20
|
// todo, this is only from version something
|
|
18
21
|
const amdp = (0, combi_1.seq)("AMDP OPTIONS CDS SESSION CLIENT CURRENT", (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));
|
|
19
22
|
const ret = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)("FOR", (0, combi_1.alt)(tableFunction, ddl, behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
|
package/build/src/registry.js
CHANGED
|
@@ -12,6 +12,8 @@ const edit_helper_1 = require("../edit_helper");
|
|
|
12
12
|
class AvoidUseConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
|
+
/** Do not emit quick fix suggestion */
|
|
16
|
+
this.skipQuickFix = false;
|
|
15
17
|
/** Detects DEFINE (macro definitions) */
|
|
16
18
|
this.define = true;
|
|
17
19
|
/** Detects statics */
|
|
@@ -73,7 +75,7 @@ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md
|
|
|
73
75
|
const children = statementNode.getChildren();
|
|
74
76
|
if (children.length === 6 && children[3].getFirstToken().getStr().toUpperCase() === "LINES") {
|
|
75
77
|
message = "DESCRIBE LINES, use lines() instead";
|
|
76
|
-
fix = this.getDescribeLinesFix(file, statementNode);
|
|
78
|
+
fix = this.conf.skipQuickFix === true ? undefined : this.getDescribeLinesFix(file, statementNode);
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
81
|
else if (this.conf.statics && statement instanceof Statements.StaticBegin) {
|
|
@@ -91,7 +93,7 @@ TEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md
|
|
|
91
93
|
}
|
|
92
94
|
else if (this.conf.break && statement instanceof Statements.Break) {
|
|
93
95
|
message = "BREAK/BREAK-POINT";
|
|
94
|
-
fix = edit_helper_1.EditHelper.deleteStatement(file, statementNode);
|
|
96
|
+
fix = this.conf.skipQuickFix === true ? undefined : edit_helper_1.EditHelper.deleteStatement(file, statementNode);
|
|
95
97
|
}
|
|
96
98
|
if (message) {
|
|
97
99
|
issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity, fix));
|