@abaplint/cli 2.101.16 → 2.101.18
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 +97 -21
- package/package.json +3 -3
package/build/cli.js
CHANGED
|
@@ -20557,12 +20557,19 @@ class CurrentScope {
|
|
|
20557
20557
|
}
|
|
20558
20558
|
}
|
|
20559
20559
|
addReference(usage, referencing, type, filename, extra) {
|
|
20560
|
-
var _a;
|
|
20560
|
+
var _a, _b;
|
|
20561
20561
|
if (usage === undefined || type === undefined) {
|
|
20562
20562
|
return;
|
|
20563
20563
|
}
|
|
20564
20564
|
const position = new _identifier_1.Identifier(usage, filename);
|
|
20565
|
-
|
|
20565
|
+
if (Array.isArray(type)) {
|
|
20566
|
+
for (const t of type) {
|
|
20567
|
+
(_a = this.current) === null || _a === void 0 ? void 0 : _a.getData().references.push({ position, resolved: referencing, referenceType: t, extra });
|
|
20568
|
+
}
|
|
20569
|
+
}
|
|
20570
|
+
else {
|
|
20571
|
+
(_b = this.current) === null || _b === void 0 ? void 0 : _b.getData().references.push({ position, resolved: referencing, referenceType: type, extra });
|
|
20572
|
+
}
|
|
20566
20573
|
}
|
|
20567
20574
|
addSQLConversion(fieldName, message, token) {
|
|
20568
20575
|
var _a;
|
|
@@ -21625,12 +21632,15 @@ class TypeUtils {
|
|
|
21625
21632
|
}
|
|
21626
21633
|
return false;
|
|
21627
21634
|
}
|
|
21628
|
-
isAssignableStrict(source, target) {
|
|
21635
|
+
isAssignableStrict(source, target, containsMethodCall = false) {
|
|
21629
21636
|
var _a, _b, _c, _d, _e, _f;
|
|
21630
21637
|
/*
|
|
21631
21638
|
console.dir(source);
|
|
21632
21639
|
console.dir(target);
|
|
21633
21640
|
*/
|
|
21641
|
+
if (containsMethodCall) {
|
|
21642
|
+
return this.isAssignable(source, target);
|
|
21643
|
+
}
|
|
21634
21644
|
if (source instanceof basic_1.CharacterType) {
|
|
21635
21645
|
if (target instanceof basic_1.CharacterType) {
|
|
21636
21646
|
if (((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {
|
|
@@ -21669,6 +21679,9 @@ class TypeUtils {
|
|
|
21669
21679
|
if (target instanceof basic_1.StructureType && this.structureContainsString(target)) {
|
|
21670
21680
|
return false;
|
|
21671
21681
|
}
|
|
21682
|
+
else if (target instanceof basic_1.IntegerType) {
|
|
21683
|
+
return false;
|
|
21684
|
+
}
|
|
21672
21685
|
else if (target instanceof basic_1.XSequenceType || target instanceof basic_1.XStringType) {
|
|
21673
21686
|
if (((_f = source.getAbstractTypeData()) === null || _f === void 0 ? void 0 : _f.derivedFromConstant) === true) {
|
|
21674
21687
|
return true;
|
|
@@ -21695,6 +21708,11 @@ class TypeUtils {
|
|
|
21695
21708
|
return false;
|
|
21696
21709
|
}
|
|
21697
21710
|
}
|
|
21711
|
+
else if (source instanceof basic_1.FloatType) {
|
|
21712
|
+
if (target instanceof basic_1.IntegerType) {
|
|
21713
|
+
return false;
|
|
21714
|
+
}
|
|
21715
|
+
}
|
|
21698
21716
|
else if (source instanceof basic_1.XStringType) {
|
|
21699
21717
|
if (target instanceof basic_1.CLikeType) {
|
|
21700
21718
|
return false;
|
|
@@ -22801,7 +22819,9 @@ class AttributeChain {
|
|
|
22801
22819
|
if (context === undefined) {
|
|
22802
22820
|
throw new Error("Attribute or constant \"" + name + "\" not found in \"" + def.getName() + "\"");
|
|
22803
22821
|
}
|
|
22804
|
-
|
|
22822
|
+
for (const t of type) {
|
|
22823
|
+
scope.addReference(nameToken, context, t, filename);
|
|
22824
|
+
}
|
|
22805
22825
|
// todo, loop, handle ArrowOrDash, ComponentName, TableExpression
|
|
22806
22826
|
return context.getType();
|
|
22807
22827
|
}
|
|
@@ -24605,7 +24625,7 @@ class MethodCallParam {
|
|
|
24605
24625
|
if (sourceType === undefined) {
|
|
24606
24626
|
throw new Error("No source type determined, method source");
|
|
24607
24627
|
}
|
|
24608
|
-
else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType) === false) {
|
|
24628
|
+
else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType, child.findFirstExpression(Expressions.MethodCallChain) !== undefined) === false) {
|
|
24609
24629
|
throw new Error("Method parameter type not compatible");
|
|
24610
24630
|
}
|
|
24611
24631
|
}
|
|
@@ -25510,7 +25530,7 @@ const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifie
|
|
|
25510
25530
|
* DATA(bar) = VALUE #( ... ). give error, no type can be derived
|
|
25511
25531
|
*/
|
|
25512
25532
|
class Source {
|
|
25513
|
-
runSyntax(node, scope, filename, targetType) {
|
|
25533
|
+
runSyntax(node, scope, filename, targetType, writeReference = false) {
|
|
25514
25534
|
if (node === undefined) {
|
|
25515
25535
|
return undefined;
|
|
25516
25536
|
}
|
|
@@ -25637,33 +25657,41 @@ class Source {
|
|
|
25637
25657
|
return undefined;
|
|
25638
25658
|
}
|
|
25639
25659
|
let context = new unknown_type_1.UnknownType("todo, Source type");
|
|
25660
|
+
const type = [_reference_1.ReferenceType.DataReadReference];
|
|
25661
|
+
if (writeReference) {
|
|
25662
|
+
type.push(_reference_1.ReferenceType.DataWriteReference);
|
|
25663
|
+
}
|
|
25640
25664
|
while (children.length >= 0) {
|
|
25641
25665
|
if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.MethodCallChain) {
|
|
25642
25666
|
context = new method_call_chain_1.MethodCallChain().runSyntax(first, scope, filename, targetType);
|
|
25643
25667
|
}
|
|
25644
25668
|
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.FieldChain) {
|
|
25645
|
-
context = new field_chain_1.FieldChain().runSyntax(first, scope, filename,
|
|
25669
|
+
context = new field_chain_1.FieldChain().runSyntax(first, scope, filename, type);
|
|
25646
25670
|
}
|
|
25647
25671
|
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.StringTemplate) {
|
|
25648
25672
|
context = new string_template_1.StringTemplate().runSyntax(first, scope, filename);
|
|
25649
25673
|
}
|
|
25650
25674
|
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Source) {
|
|
25651
|
-
|
|
25675
|
+
const found = new Source().runSyntax(first, scope, filename);
|
|
25676
|
+
context = this.infer(context, found);
|
|
25652
25677
|
}
|
|
25653
25678
|
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Constant) {
|
|
25654
|
-
|
|
25679
|
+
const found = new constant_1.Constant().runSyntax(first);
|
|
25680
|
+
context = this.infer(context, found);
|
|
25655
25681
|
}
|
|
25656
25682
|
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.Dereference) {
|
|
25657
25683
|
context = new dereference_1.Dereference().runSyntax(context);
|
|
25658
25684
|
}
|
|
25659
|
-
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.ArrowOrDash) {
|
|
25660
|
-
// console.dir("dash");
|
|
25661
|
-
}
|
|
25662
25685
|
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.ComponentChain) {
|
|
25663
25686
|
context = new component_chain_1.ComponentChain().runSyntax(context, first, scope, filename);
|
|
25664
25687
|
}
|
|
25688
|
+
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.ArithOperator) {
|
|
25689
|
+
if (first.concatTokens() === "**") {
|
|
25690
|
+
context = new basic_1.FloatType();
|
|
25691
|
+
}
|
|
25692
|
+
}
|
|
25665
25693
|
else if (first instanceof nodes_1.ExpressionNode && first.get() instanceof Expressions.AttributeChain) {
|
|
25666
|
-
context = new attribute_chain_1.AttributeChain().runSyntax(context, first, scope, filename,
|
|
25694
|
+
context = new attribute_chain_1.AttributeChain().runSyntax(context, first, scope, filename, type);
|
|
25667
25695
|
}
|
|
25668
25696
|
first = children.shift();
|
|
25669
25697
|
if (first === undefined) {
|
|
@@ -25676,6 +25704,14 @@ class Source {
|
|
|
25676
25704
|
return context;
|
|
25677
25705
|
}
|
|
25678
25706
|
////////////////////////////////
|
|
25707
|
+
infer(context, found) {
|
|
25708
|
+
if (context instanceof basic_1.FloatType && found instanceof basic_1.IntegerType) {
|
|
25709
|
+
return context;
|
|
25710
|
+
}
|
|
25711
|
+
else {
|
|
25712
|
+
return found;
|
|
25713
|
+
}
|
|
25714
|
+
}
|
|
25679
25715
|
addIfInferred(node, scope, filename, inferredType) {
|
|
25680
25716
|
const basic = new basic_types_1.BasicTypes(filename, scope);
|
|
25681
25717
|
const typeExpression = node.findFirstExpression(Expressions.TypeNameOrInfer);
|
|
@@ -25817,6 +25853,7 @@ exports.SourceFieldSymbol = SourceFieldSymbol;
|
|
|
25817
25853
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
25818
25854
|
exports.SQLCompare = void 0;
|
|
25819
25855
|
const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
25856
|
+
const nodes_1 = __webpack_require__(/*! ../../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
25820
25857
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
25821
25858
|
const sql_source_1 = __webpack_require__(/*! ./sql_source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/sql_source.js");
|
|
25822
25859
|
class SQLCompare {
|
|
@@ -25825,7 +25862,12 @@ class SQLCompare {
|
|
|
25825
25862
|
let sourceType;
|
|
25826
25863
|
let token;
|
|
25827
25864
|
for (const s of node.findAllExpressions(Expressions.SQLSource)) {
|
|
25828
|
-
|
|
25865
|
+
for (const child of s.getChildren()) {
|
|
25866
|
+
if (child instanceof nodes_1.ExpressionNode) {
|
|
25867
|
+
token = child.getFirstToken();
|
|
25868
|
+
break;
|
|
25869
|
+
}
|
|
25870
|
+
}
|
|
25829
25871
|
sourceType = new sql_source_1.SQLSource().runSyntax(s, scope, filename);
|
|
25830
25872
|
}
|
|
25831
25873
|
const fieldName = (_a = node.findDirectExpression(Expressions.SQLFieldName)) === null || _a === void 0 ? void 0 : _a.concatTokens();
|
|
@@ -29288,19 +29330,19 @@ const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modu
|
|
|
29288
29330
|
const loop_group_by_1 = __webpack_require__(/*! ../expressions/loop_group_by */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/loop_group_by.js");
|
|
29289
29331
|
class Loop {
|
|
29290
29332
|
runSyntax(node, scope, filename) {
|
|
29291
|
-
var _a;
|
|
29292
29333
|
const loopTarget = node.findDirectExpression(Expressions.LoopTarget);
|
|
29293
29334
|
let target = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectExpression(Expressions.Target);
|
|
29294
29335
|
const targetType = target ? new target_1.Target().runSyntax(target, scope, filename) : undefined;
|
|
29295
29336
|
if (target === undefined) {
|
|
29296
29337
|
target = node.findDirectExpression(Expressions.FSTarget);
|
|
29297
29338
|
}
|
|
29339
|
+
const write = (loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.findDirectTokenByText("ASSIGNING")) !== undefined;
|
|
29298
29340
|
const sources = node.findDirectExpressions(Expressions.Source);
|
|
29299
29341
|
let firstSource = node.findDirectExpression(Expressions.SimpleSource2);
|
|
29300
29342
|
if (firstSource === undefined) {
|
|
29301
29343
|
firstSource = sources[0];
|
|
29302
29344
|
}
|
|
29303
|
-
let sourceType = firstSource ? new source_1.Source().runSyntax(firstSource, scope, filename, targetType) : undefined;
|
|
29345
|
+
let sourceType = firstSource ? new source_1.Source().runSyntax(firstSource, scope, filename, targetType, write) : undefined;
|
|
29304
29346
|
let rowType = undefined;
|
|
29305
29347
|
const concat = node.concatTokens().toUpperCase();
|
|
29306
29348
|
if (sourceType === undefined) {
|
|
@@ -29321,14 +29363,24 @@ class Loop {
|
|
|
29321
29363
|
&& concat.startsWith("LOOP AT GROUP ") === false) {
|
|
29322
29364
|
throw new Error("Loop, not a table type");
|
|
29323
29365
|
}
|
|
29366
|
+
else if (loopTarget === undefined
|
|
29367
|
+
&& sourceType instanceof basic_1.TableType
|
|
29368
|
+
&& sourceType.isWithHeader() === false) {
|
|
29369
|
+
throw new Error("Loop, no header");
|
|
29370
|
+
}
|
|
29371
|
+
const targetConcat = loopTarget === null || loopTarget === void 0 ? void 0 : loopTarget.concatTokens().toUpperCase();
|
|
29324
29372
|
if (sourceType instanceof basic_1.TableType) {
|
|
29325
|
-
const targetConcat = (_a = node.findDirectExpression(Expressions.LoopTarget)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
|
|
29326
29373
|
rowType = sourceType.getRowType();
|
|
29327
29374
|
sourceType = rowType;
|
|
29328
29375
|
if (targetConcat === null || targetConcat === void 0 ? void 0 : targetConcat.startsWith("REFERENCE INTO ")) {
|
|
29329
29376
|
sourceType = new basic_1.DataReference(sourceType);
|
|
29330
29377
|
}
|
|
29331
29378
|
}
|
|
29379
|
+
if (targetConcat
|
|
29380
|
+
&& targetConcat.startsWith("TRANSPORTING ")
|
|
29381
|
+
&& node.findDirectTokenByText("WHERE") === undefined) {
|
|
29382
|
+
throw new Error("Loop, TRANSPORTING NO FIELDS only with WHERE");
|
|
29383
|
+
}
|
|
29332
29384
|
const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);
|
|
29333
29385
|
if (inline) {
|
|
29334
29386
|
new inline_data_1.InlineData().runSyntax(inline, scope, filename, sourceType);
|
|
@@ -48396,7 +48448,7 @@ class Registry {
|
|
|
48396
48448
|
}
|
|
48397
48449
|
static abaplintVersion() {
|
|
48398
48450
|
// magic, see build script "version.sh"
|
|
48399
|
-
return "2.101.
|
|
48451
|
+
return "2.101.18";
|
|
48400
48452
|
}
|
|
48401
48453
|
getDDICReferences() {
|
|
48402
48454
|
return this.ddicReferences;
|
|
@@ -49068,7 +49120,7 @@ Does not take effect on non functional method calls, use https://rules.abaplint.
|
|
|
49068
49120
|
|
|
49069
49121
|
If parameters are on the same row, no issues are reported, see
|
|
49070
49122
|
https://rules.abaplint.org/max_one_method_parameter_per_line/ for splitting parameters to lines`,
|
|
49071
|
-
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide],
|
|
49123
|
+
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
|
|
49072
49124
|
badExample: `CALL FUNCTION 'FOOBAR'
|
|
49073
49125
|
EXPORTING
|
|
49074
49126
|
foo = 2
|
|
@@ -67040,6 +67092,12 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
|
|
|
67040
67092
|
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
67041
67093
|
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
67042
67094
|
class UnnecessaryPragmaConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
67095
|
+
constructor() {
|
|
67096
|
+
super(...arguments);
|
|
67097
|
+
/** Allow NO_TEXT in global CLAS and INTF definitions,
|
|
67098
|
+
its added automatically by SE24 in some cases where it should not */
|
|
67099
|
+
this.allowNoTextGlobal = false;
|
|
67100
|
+
}
|
|
67043
67101
|
}
|
|
67044
67102
|
exports.UnnecessaryPragmaConf = UnnecessaryPragmaConf;
|
|
67045
67103
|
class UnnecessaryPragma extends _abap_rule_1.ABAPRule {
|
|
@@ -67089,6 +67147,7 @@ ENDIF.`,
|
|
|
67089
67147
|
runParsed(file) {
|
|
67090
67148
|
const issues = [];
|
|
67091
67149
|
let noHandler = false;
|
|
67150
|
+
let globalDefinition = false;
|
|
67092
67151
|
const statements = file.getStatements();
|
|
67093
67152
|
for (let i = 0; i < statements.length; i++) {
|
|
67094
67153
|
const statement = statements[i];
|
|
@@ -67096,6 +67155,16 @@ ENDIF.`,
|
|
|
67096
67155
|
if (statement.get() instanceof Statements.EndTry) {
|
|
67097
67156
|
noHandler = false;
|
|
67098
67157
|
}
|
|
67158
|
+
else if (statement.get() instanceof Statements.ClassDefinition
|
|
67159
|
+
|| statement.get() instanceof Statements.Interface) {
|
|
67160
|
+
if (statement.findDirectExpression(Expressions.ClassGlobal)) {
|
|
67161
|
+
globalDefinition = true;
|
|
67162
|
+
}
|
|
67163
|
+
}
|
|
67164
|
+
else if (statement.get() instanceof Statements.EndClass
|
|
67165
|
+
|| statement.get() instanceof Statements.EndInterface) {
|
|
67166
|
+
globalDefinition = false;
|
|
67167
|
+
}
|
|
67099
67168
|
else if (statement.get() instanceof _statement_1.Comment) {
|
|
67100
67169
|
continue;
|
|
67101
67170
|
}
|
|
@@ -67108,9 +67177,16 @@ ENDIF.`,
|
|
|
67108
67177
|
else {
|
|
67109
67178
|
noHandler = this.containsNoHandler(statement, statements[i + 1]);
|
|
67110
67179
|
}
|
|
67111
|
-
|
|
67180
|
+
if (this.getConfig().allowNoTextGlobal === true && globalDefinition === true) {
|
|
67181
|
+
// skip
|
|
67182
|
+
}
|
|
67183
|
+
else {
|
|
67184
|
+
issues.push(...this.checkText(statement, file));
|
|
67185
|
+
}
|
|
67112
67186
|
issues.push(...this.checkNeeded(statement, file));
|
|
67113
|
-
|
|
67187
|
+
if (globalDefinition === false) {
|
|
67188
|
+
issues.push(...this.checkSubrc(statement, nextStatement, file));
|
|
67189
|
+
}
|
|
67114
67190
|
}
|
|
67115
67191
|
return issues;
|
|
67116
67192
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.101.
|
|
3
|
+
"version": "2.101.18",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://abaplint.org",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@abaplint/core": "^2.101.
|
|
41
|
+
"@abaplint/core": "^2.101.18",
|
|
42
42
|
"@types/chai": "^4.3.5",
|
|
43
43
|
"@types/glob": "^7.2.0",
|
|
44
44
|
"@types/minimist": "^1.2.2",
|
|
45
45
|
"@types/mocha": "^10.0.1",
|
|
46
|
-
"@types/node": "^20.
|
|
46
|
+
"@types/node": "^20.3.1",
|
|
47
47
|
"@types/progress": "^2.0.5",
|
|
48
48
|
"chai": "^4.3.7",
|
|
49
49
|
"chalk": "^5.2.0",
|