@abaplint/cli 2.115.3 → 2.115.4
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 +47 -13
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -11974,7 +11974,7 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
|
|
|
11974
11974
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
11975
11975
|
class DataBegin {
|
|
11976
11976
|
getMatcher() {
|
|
11977
|
-
const occurs = (0, combi_1.seq)("OCCURS", expressions_1.Integer);
|
|
11977
|
+
const occurs = (0, combi_1.seq)("OCCURS", (0, combi_1.altPrio)(expressions_1.Integer, expressions_1.FieldChain));
|
|
11978
11978
|
const common = (0, combi_1.seq)("COMMON PART", (0, combi_1.optPrio)(expressions_1.DefinitionName));
|
|
11979
11979
|
const structure = (0, combi_1.seq)("BEGIN OF", (0, combi_1.altPrio)(common, (0, combi_1.seq)(expressions_1.DefinitionName, (0, combi_1.optPrio)("READ-ONLY"), (0, combi_1.optPrio)(occurs))));
|
|
11980
11980
|
return (0, combi_1.seq)("DATA", structure);
|
|
@@ -18678,7 +18678,8 @@ class Write {
|
|
|
18678
18678
|
const as = (0, combi_1.seq)("AS", (0, combi_1.altPrio)("LINE", "ICON", "CHECKBOX", "SYMBOL"));
|
|
18679
18679
|
const to = (0, combi_1.seq)("TO", expressions_1.Target);
|
|
18680
18680
|
const options = (0, combi_1.per)(mask, to, (0, combi_1.seq)("EXPONENT", expressions_1.Source), "NO-GROUPING", "NO-ZERO", "CENTERED", (0, combi_1.seq)("INPUT", (0, combi_1.opt)(onOff)), "NO-GAP", "LEFT-JUSTIFIED", as, (0, combi_1.seq)("FRAMES", onOff), (0, combi_1.seq)("HOTSPOT", (0, combi_1.opt)(onOff)), "RIGHT-JUSTIFIED", (0, combi_1.seq)("TIME ZONE", expressions_1.Source), (0, combi_1.seq)("UNDER", expressions_1.Source), (0, combi_1.seq)("STYLE", expressions_1.Source), (0, combi_1.seq)("ROUND", expressions_1.Source), (0, combi_1.seq)("QUICKINFO", expressions_1.Source), "ENVIRONMENT TIME FORMAT", dateFormat, (0, combi_1.seq)("UNIT", expressions_1.Source), (0, combi_1.seq)("INTENSIFIED", (0, combi_1.opt)(onOff)), (0, combi_1.seq)("INDEX", expressions_1.Source), (0, combi_1.seq)("DECIMALS", expressions_1.Source), (0, combi_1.seq)("INVERSE", (0, combi_1.opt)(onOff)), expressions_1.Color, (0, combi_1.seq)("CURRENCY", expressions_1.Source), "RESET", "NO-SIGN");
|
|
18681
|
-
|
|
18681
|
+
// Need to refactor all this sometime,
|
|
18682
|
+
const ret = (0, combi_1.seq)("WRITE", (0, combi_1.alt)((0, combi_1.seq)("AT /", (0, combi_1.opt)(expressions_1.Source), (0, combi_1.opt)("NO-GAP")), (0, combi_1.seq)((0, combi_1.opt)(expressions_1.WriteOffsetLength), (0, combi_1.alt)(expressions_1.Source, expressions_1.Dynamic, "/"), (0, combi_1.opt)(options))));
|
|
18682
18683
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
18683
18684
|
}
|
|
18684
18685
|
}
|
|
@@ -42633,8 +42634,22 @@ class DDIC {
|
|
|
42633
42634
|
case "XSTRING":
|
|
42634
42635
|
return Types.XStringType.get({ qualifiedName: qualifiedName || name });
|
|
42635
42636
|
case "D":
|
|
42637
|
+
/*
|
|
42638
|
+
if (length && length > 0) {
|
|
42639
|
+
throw new Error("Length for type D not possible");
|
|
42640
|
+
} else if (decimals && decimals > 0) {
|
|
42641
|
+
throw new Error("Decimals for type D not possible");
|
|
42642
|
+
}
|
|
42643
|
+
*/
|
|
42636
42644
|
return new Types.DateType({ qualifiedName: qualifiedName || name });
|
|
42637
42645
|
case "T":
|
|
42646
|
+
/*
|
|
42647
|
+
if (length && length > 0) {
|
|
42648
|
+
throw new Error("Length for type T not possible");
|
|
42649
|
+
} else if (decimals && decimals > 0) {
|
|
42650
|
+
throw new Error("Decimals for type T not possible");
|
|
42651
|
+
}
|
|
42652
|
+
*/
|
|
42638
42653
|
return new Types.TimeType({ qualifiedName: qualifiedName || name });
|
|
42639
42654
|
case "XSEQUENCE":
|
|
42640
42655
|
return new Types.XSequenceType({ qualifiedName: qualifiedName });
|
|
@@ -42667,6 +42682,13 @@ class DDIC {
|
|
|
42667
42682
|
case "INT8": // todo, take version into account
|
|
42668
42683
|
return new Types.Integer8Type({ qualifiedName: qualifiedName || name });
|
|
42669
42684
|
case "F":
|
|
42685
|
+
/*
|
|
42686
|
+
if (length && length > 0) {
|
|
42687
|
+
throw new Error("Length for type F not possible");
|
|
42688
|
+
} else if (decimals && decimals > 0) {
|
|
42689
|
+
throw new Error("Decimals for type F not possible");
|
|
42690
|
+
}
|
|
42691
|
+
*/
|
|
42670
42692
|
return new Types.FloatType({ qualifiedName: qualifiedName || name });
|
|
42671
42693
|
case "P":
|
|
42672
42694
|
if (length && decimals) {
|
|
@@ -55215,7 +55237,7 @@ class Registry {
|
|
|
55215
55237
|
}
|
|
55216
55238
|
static abaplintVersion() {
|
|
55217
55239
|
// magic, see build script "version.sh"
|
|
55218
|
-
return "2.115.
|
|
55240
|
+
return "2.115.4";
|
|
55219
55241
|
}
|
|
55220
55242
|
getDDICReferences() {
|
|
55221
55243
|
return this.ddicReferences;
|
|
@@ -68448,7 +68470,7 @@ ENDIF.
|
|
|
68448
68470
|
return [];
|
|
68449
68471
|
}
|
|
68450
68472
|
for (const cond of structure.findAllExpressionsMulti([Expressions.Cond, Expressions.ComponentCond])) {
|
|
68451
|
-
issues.push(...this.
|
|
68473
|
+
issues.push(...this.analyzeCondition(file, cond));
|
|
68452
68474
|
}
|
|
68453
68475
|
for (const sub of structure.findAllExpressionsMulti([Expressions.CondSub, Expressions.ComponentCondSub])) {
|
|
68454
68476
|
let cond = [];
|
|
@@ -68502,18 +68524,20 @@ ENDIF.
|
|
|
68502
68524
|
}
|
|
68503
68525
|
analyzeMove(file, m) {
|
|
68504
68526
|
const issues = [];
|
|
68505
|
-
const
|
|
68506
|
-
|
|
68507
|
-
|
|
68508
|
-
|
|
68509
|
-
|
|
68510
|
-
|
|
68511
|
-
|
|
68512
|
-
|
|
68527
|
+
for (const source of m.findAllExpressionsRecursive(Expressions.Source)) {
|
|
68528
|
+
const lastChildren = source.getChildren();
|
|
68529
|
+
if (lastChildren.length === 3
|
|
68530
|
+
&& lastChildren[0].getFirstToken().getStr() === "("
|
|
68531
|
+
&& lastChildren[1].getChildren().length === 1
|
|
68532
|
+
&& lastChildren[1].getFirstToken().getStr().startsWith("-") === false
|
|
68533
|
+
&& lastChildren[2].getFirstToken().getStr() === ")") {
|
|
68534
|
+
const issue = issue_1.Issue.atToken(file, lastChildren[0].getFirstToken(), "Too many parentheses", this.getMetadata().key, this.conf.severity);
|
|
68535
|
+
issues.push(issue);
|
|
68536
|
+
}
|
|
68513
68537
|
}
|
|
68514
68538
|
return issues;
|
|
68515
68539
|
}
|
|
68516
|
-
|
|
68540
|
+
analyzeCondition(file, cond) {
|
|
68517
68541
|
var _a, _b;
|
|
68518
68542
|
const issues = [];
|
|
68519
68543
|
let comparator = "";
|
|
@@ -70970,6 +70994,8 @@ class ObsoleteStatementConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
70970
70994
|
this.fieldGroups = true;
|
|
70971
70995
|
/** Check for REPLACE INTO */
|
|
70972
70996
|
this.replaceInto = true;
|
|
70997
|
+
this.loopExtract = true;
|
|
70998
|
+
this.sortExtract = true;
|
|
70973
70999
|
}
|
|
70974
71000
|
}
|
|
70975
71001
|
exports.ObsoleteStatementConf = ObsoleteStatementConf;
|
|
@@ -71223,6 +71249,14 @@ ENDIF.`,
|
|
|
71223
71249
|
issues.push(issue);
|
|
71224
71250
|
}
|
|
71225
71251
|
}
|
|
71252
|
+
if (this.conf.loopExtract && sta instanceof Statements.LoopExtract) {
|
|
71253
|
+
const issue = issue_1.Issue.atStatement(file, staNode, "LOOP extract", this.getMetadata().key, this.conf.severity);
|
|
71254
|
+
issues.push(issue);
|
|
71255
|
+
}
|
|
71256
|
+
if (this.conf.sortExtract && sta instanceof Statements.SortDataset && staNode.getChildren().length === 2) {
|
|
71257
|
+
const issue = issue_1.Issue.atStatement(file, staNode, "SORT extract", this.getMetadata().key, this.conf.severity);
|
|
71258
|
+
issues.push(issue);
|
|
71259
|
+
}
|
|
71226
71260
|
if (configVersion >= version_1.Version.v754 && this.conf.clientSpecified
|
|
71227
71261
|
&& (sta instanceof Statements.Select
|
|
71228
71262
|
|| sta instanceof Statements.SelectLoop
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.115.
|
|
3
|
+
"version": "2.115.4",
|
|
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.115.
|
|
41
|
+
"@abaplint/core": "^2.115.4",
|
|
42
42
|
"@types/chai": "^4.3.20",
|
|
43
43
|
"@types/minimist": "^1.2.5",
|
|
44
44
|
"@types/mocha": "^10.0.10",
|