@abaplint/cli 2.113.219 → 2.113.220
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/cli.js +71 -17
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -15209,7 +15209,8 @@ class ModifyEntities {
|
|
|
15209
15209
|
const updateFrom = (0, combi_1.seq)("UPDATE FROM", expressions_1.Source, (0, combi_1.opt)(relating));
|
|
15210
15210
|
const deleteFrom = (0, combi_1.seq)("DELETE FROM", expressions_1.Source);
|
|
15211
15211
|
const updateFields = (0, combi_1.seq)("UPDATE", fieldsWith);
|
|
15212
|
-
const
|
|
15212
|
+
const updateSetFields = (0, combi_1.seq)("UPDATE SET FIELDS WITH", expressions_1.Source);
|
|
15213
|
+
const operation = (0, combi_1.alt)(updateSetFields, (0, combi_1.seq)("CREATE SET FIELDS WITH", expressions_1.Source), updateFields, deleteFrom, updateFrom, create, execute, (0, combi_1.seq)("CREATE", (0, combi_1.opt)(by), (0, combi_1.optPrio)("AUTO FILL CID"), (0, combi_1.altPrio)(withh, fieldsWith)));
|
|
15213
15214
|
const failed = (0, combi_1.seq)("FAILED", expressions_1.Target);
|
|
15214
15215
|
const result = (0, combi_1.seq)("RESULT", expressions_1.Target);
|
|
15215
15216
|
const mapped = (0, combi_1.seq)("MAPPED", expressions_1.Target);
|
|
@@ -15219,7 +15220,7 @@ class ModifyEntities {
|
|
|
15219
15220
|
const create2 = (0, combi_1.seq)("CREATE", fieldsWith, (0, combi_1.opt)((0, combi_1.seq)("CREATE BY", expressions_1.AssociationName, fieldsWith)));
|
|
15220
15221
|
const create3 = (0, combi_1.seq)("CREATE BY", expressions_1.AssociationName, fieldsWith);
|
|
15221
15222
|
const create4 = (0, combi_1.seq)("CREATE FROM", expressions_1.Source, (0, combi_1.plus)((0, combi_1.seq)("CREATE BY", expressions_1.AssociationName, "FROM", expressions_1.Source)));
|
|
15222
|
-
const entity = (0, combi_1.seq)("ENTITY", (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.alt)(expressions_1.NamespaceSimpleName, expressions_1.EntityAssociation), (0, combi_1.alt)(execute, create, updateFields, deleteFrom, updateFrom, create2, create3, create4));
|
|
15223
|
+
const entity = (0, combi_1.seq)("ENTITY", (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.alt)(expressions_1.NamespaceSimpleName, expressions_1.EntityAssociation), (0, combi_1.alt)(execute, create, updateFields, deleteFrom, updateSetFields, updateFrom, create2, create3, create4));
|
|
15223
15224
|
return (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)("MODIFY", (0, combi_1.alt)(entities, entity), end));
|
|
15224
15225
|
}
|
|
15225
15226
|
}
|
|
@@ -16161,7 +16162,8 @@ class ReadEntities {
|
|
|
16161
16162
|
const result = (0, combi_1.seq)("RESULT", expressions_1.Target);
|
|
16162
16163
|
const failed = (0, combi_1.seq)("FAILED", expressions_1.Target);
|
|
16163
16164
|
const reported = (0, combi_1.seq)("REPORTED", expressions_1.Target);
|
|
16164
|
-
const
|
|
16165
|
+
const foo = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.seq)("BY", expressions_1.AssociationName)), (0, combi_1.alt)(fields, from, all), (0, combi_1.optPrio)(result));
|
|
16166
|
+
const entity = (0, combi_1.seq)("ENTITY", expressions_1.NamespaceSimpleName, (0, combi_1.plus)(foo));
|
|
16165
16167
|
const s = (0, combi_1.seq)("ENTITIES OF", expressions_1.NamespaceSimpleName, (0, combi_1.opt)("IN LOCAL MODE"), (0, combi_1.plus)(entity), (0, combi_1.optPrio)((0, combi_1.seq)("LINK", expressions_1.Target)), (0, combi_1.optPrio)((0, combi_1.per)(failed, reported)));
|
|
16166
16168
|
const byall = (0, combi_1.seq)("BY", expressions_1.AssociationName, all);
|
|
16167
16169
|
const by = (0, combi_1.seq)("BY", expressions_1.AssociationName, fields);
|
|
@@ -21375,7 +21377,9 @@ class BuiltIn {
|
|
|
21375
21377
|
// https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abennews-610-system.htm
|
|
21376
21378
|
const id3 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), "sy-repid");
|
|
21377
21379
|
const syrepid = new _typed_identifier_1.TypedIdentifier(id3, BuiltIn.filename, new basic_1.CharacterType(40, { qualifiedName: "sy-repid" }), ["read_only" /* IdentifierMeta.ReadOnly */, "built-in" /* IdentifierMeta.BuiltIn */]);
|
|
21378
|
-
|
|
21380
|
+
const id4 = new tokens_1.Identifier(new position_1.Position(this.row++, 1), "syst-repid");
|
|
21381
|
+
const systrepid = new _typed_identifier_1.TypedIdentifier(id4, BuiltIn.filename, new basic_1.CharacterType(40, { qualifiedName: "syst-repid" }), ["read_only" /* IdentifierMeta.ReadOnly */, "built-in" /* IdentifierMeta.BuiltIn */]);
|
|
21382
|
+
return [sy, syst, syrepid, systrepid];
|
|
21379
21383
|
}
|
|
21380
21384
|
buildConstant(name, type, value) {
|
|
21381
21385
|
const id = new tokens_1.Identifier(new position_1.Position(this.row++, 1), name);
|
|
@@ -24395,7 +24399,7 @@ class BasicTypes {
|
|
|
24395
24399
|
const name = typename.concatTokens();
|
|
24396
24400
|
const type = (_d = this.input.scope.getDDIC().lookupDDLS(name)) === null || _d === void 0 ? void 0 : _d.type;
|
|
24397
24401
|
if (type) {
|
|
24398
|
-
return new Types.TableType(basic_1.VoidType.get("
|
|
24402
|
+
return new Types.TableType(basic_1.VoidType.get("RAP-TODO"), options);
|
|
24399
24403
|
}
|
|
24400
24404
|
else if (this.input.scope.getDDIC().inErrorNamespace(name)) {
|
|
24401
24405
|
return new Types.UnknownType(`DDLS ${name} not found`);
|
|
@@ -30682,7 +30686,7 @@ class ClassImplementation {
|
|
|
30682
30686
|
}
|
|
30683
30687
|
else {
|
|
30684
30688
|
// todo: instead of the void type, do proper typing, ie. only empty constructor method
|
|
30685
|
-
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(new tokens_1.Identifier(new position_1.Position(1, 1), "super"), _builtin_1.BuiltIn.filename, basic_1.VoidType.get("
|
|
30689
|
+
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(new tokens_1.Identifier(new position_1.Position(1, 1), "super"), _builtin_1.BuiltIn.filename, basic_1.VoidType.get("noSuperClass")));
|
|
30686
30690
|
}
|
|
30687
30691
|
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(new tokens_1.Identifier(new position_1.Position(1, 1), "me"), _builtin_1.BuiltIn.filename, new basic_1.ObjectReferenceType(classDefinition)));
|
|
30688
30692
|
helper.addAliasedAttributes(classDefinition); // todo, this is not correct, take care of instance vs static
|
|
@@ -41586,7 +41590,7 @@ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node
|
|
|
41586
41590
|
class CDSFunctionInput extends combi_1.Expression {
|
|
41587
41591
|
getRunnable() {
|
|
41588
41592
|
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))));
|
|
41589
|
-
const input = (0, combi_1.altPrio)(_1.
|
|
41593
|
+
const input = (0, combi_1.altPrio)(_1.CDSArithmetics, _1.CDSCast, _1.CDSFunction, _1.CDSCase, _1.CDSString, qualified, _1.CDSInteger);
|
|
41590
41594
|
return input;
|
|
41591
41595
|
}
|
|
41592
41596
|
}
|
|
@@ -54549,7 +54553,7 @@ class Registry {
|
|
|
54549
54553
|
}
|
|
54550
54554
|
static abaplintVersion() {
|
|
54551
54555
|
// magic, see build script "version.sh"
|
|
54552
|
-
return "2.113.
|
|
54556
|
+
return "2.113.220";
|
|
54553
54557
|
}
|
|
54554
54558
|
getDDICReferences() {
|
|
54555
54559
|
return this.ddicReferences;
|
|
@@ -55856,6 +55860,7 @@ ENDINTERFACE.`,
|
|
|
55856
55860
|
}
|
|
55857
55861
|
issues.push(...this.checkTypes(stru, file));
|
|
55858
55862
|
issues.push(...this.checkMethods(stru, file));
|
|
55863
|
+
issues.push(...this.checkEvents(stru, file));
|
|
55859
55864
|
return issues;
|
|
55860
55865
|
}
|
|
55861
55866
|
check(fields, column, file) {
|
|
@@ -55915,6 +55920,26 @@ ENDINTERFACE.`,
|
|
|
55915
55920
|
}
|
|
55916
55921
|
return issues;
|
|
55917
55922
|
}
|
|
55923
|
+
checkEvents(stru, file) {
|
|
55924
|
+
const issues = [];
|
|
55925
|
+
const events = stru.findAllStatements(Statements.Events);
|
|
55926
|
+
for (const e of events) {
|
|
55927
|
+
const fields = [];
|
|
55928
|
+
const params = e.findAllExpressions(Expressions.MethodParam);
|
|
55929
|
+
let column = 0;
|
|
55930
|
+
for (const p of params) {
|
|
55931
|
+
const children = p.getChildren();
|
|
55932
|
+
const name = children[children.length - 2];
|
|
55933
|
+
fields.push({
|
|
55934
|
+
nameEnd: name.getLastToken().getEnd(),
|
|
55935
|
+
after: p.findFirstExpression(Expressions.TypeParam).getFirstToken().getStart()
|
|
55936
|
+
});
|
|
55937
|
+
column = Math.max(column, name.getFirstToken().getEnd().getCol() + 1);
|
|
55938
|
+
}
|
|
55939
|
+
issues.push(...this.check(fields, column, file));
|
|
55940
|
+
}
|
|
55941
|
+
return issues;
|
|
55942
|
+
}
|
|
55918
55943
|
checkTypes(stru, file) {
|
|
55919
55944
|
const issues = [];
|
|
55920
55945
|
const types = stru.findAllStructuresRecursive(Structures.Types);
|
|
@@ -64689,20 +64714,51 @@ WRITE 'world'.`,
|
|
|
64689
64714
|
////////////////
|
|
64690
64715
|
analyzeIf(file, node) {
|
|
64691
64716
|
var _a;
|
|
64692
|
-
|
|
64717
|
+
const ifBody = node.findDirectStructure(Structures.Body);
|
|
64718
|
+
const elseIfBodies = node.findDirectStructures(Structures.ElseIf) || [];
|
|
64719
|
+
const elseBody = (_a = node.findDirectStructure(Structures.Else)) === null || _a === void 0 ? void 0 : _a.findDirectStructure(Structures.Body);
|
|
64720
|
+
if (elseBody === undefined) {
|
|
64693
64721
|
return [];
|
|
64694
64722
|
}
|
|
64695
|
-
const
|
|
64696
|
-
|
|
64723
|
+
const ifFirst = ifBody === null || ifBody === void 0 ? void 0 : ifBody.getFirstChild();
|
|
64724
|
+
const elseFirst = elseBody === null || elseBody === void 0 ? void 0 : elseBody.getFirstChild();
|
|
64725
|
+
const ifLast = ifBody === null || ifBody === void 0 ? void 0 : ifBody.getLastChild();
|
|
64726
|
+
const elseLast = elseBody === null || elseBody === void 0 ? void 0 : elseBody.getLastChild();
|
|
64727
|
+
if (elseIfBodies.length > 0) {
|
|
64728
|
+
let firstMatch = true;
|
|
64729
|
+
let lastMatch = true;
|
|
64730
|
+
for (const elseif of elseIfBodies) {
|
|
64731
|
+
const elseifBody = elseif.findDirectStructure(Structures.Body);
|
|
64732
|
+
const elseifFirst = elseifBody === null || elseifBody === void 0 ? void 0 : elseifBody.getFirstChild();
|
|
64733
|
+
const elseifLast = elseifBody === null || elseifBody === void 0 ? void 0 : elseifBody.getLastChild();
|
|
64734
|
+
if (ifFirst === undefined
|
|
64735
|
+
|| ifLast === undefined
|
|
64736
|
+
|| elseLast === undefined
|
|
64737
|
+
|| elseFirst === undefined) {
|
|
64738
|
+
return [];
|
|
64739
|
+
}
|
|
64740
|
+
if (elseifFirst === undefined
|
|
64741
|
+
|| ifFirst.concatTokens() !== elseifFirst.concatTokens()
|
|
64742
|
+
|| elseFirst.concatTokens() !== elseifFirst.concatTokens()) {
|
|
64743
|
+
firstMatch = false;
|
|
64744
|
+
}
|
|
64745
|
+
if (elseifLast === undefined
|
|
64746
|
+
|| ifLast.concatTokens() !== elseifLast.concatTokens()
|
|
64747
|
+
|| elseLast.concatTokens() !== elseifLast.concatTokens()) {
|
|
64748
|
+
lastMatch = false;
|
|
64749
|
+
}
|
|
64750
|
+
}
|
|
64751
|
+
if (firstMatch === true || lastMatch === true) {
|
|
64752
|
+
const message = "Identical contents";
|
|
64753
|
+
const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);
|
|
64754
|
+
return [issue];
|
|
64755
|
+
}
|
|
64697
64756
|
return [];
|
|
64698
64757
|
}
|
|
64699
|
-
|
|
64700
|
-
if (elseBody === undefined || ifBody === undefined) {
|
|
64758
|
+
else if (elseBody === undefined || ifBody === undefined) {
|
|
64701
64759
|
return [];
|
|
64702
64760
|
}
|
|
64703
64761
|
{
|
|
64704
|
-
const ifFirst = ifBody.getFirstChild();
|
|
64705
|
-
const elseFirst = elseBody.getFirstChild();
|
|
64706
64762
|
if (ifFirst === undefined || elseFirst === undefined || this.isChained(ifFirst)) {
|
|
64707
64763
|
return [];
|
|
64708
64764
|
}
|
|
@@ -64713,8 +64769,6 @@ WRITE 'world'.`,
|
|
|
64713
64769
|
}
|
|
64714
64770
|
}
|
|
64715
64771
|
{
|
|
64716
|
-
const ifLast = ifBody.getLastChild();
|
|
64717
|
-
const elseLast = elseBody.getLastChild();
|
|
64718
64772
|
if (ifLast === undefined || elseLast === undefined || this.isChained(ifLast)) {
|
|
64719
64773
|
return [];
|
|
64720
64774
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.220",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://abaplint.org",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@abaplint/core": "^2.113.
|
|
41
|
+
"@abaplint/core": "^2.113.220",
|
|
42
42
|
"@types/chai": "^4.3.20",
|
|
43
43
|
"@types/minimist": "^1.2.5",
|
|
44
44
|
"@types/mocha": "^10.0.10",
|