@abaplint/cli 2.115.15 → 2.115.17
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 +102 -38
- package/package.json +4 -4
package/build/cli.js
CHANGED
|
@@ -23761,6 +23761,22 @@ class TypeUtils {
|
|
|
23761
23761
|
// todo
|
|
23762
23762
|
return true;
|
|
23763
23763
|
}
|
|
23764
|
+
isCompareable(source1, source2, node1, node2) {
|
|
23765
|
+
/*
|
|
23766
|
+
console.dir(source1);
|
|
23767
|
+
console.dir(source2);
|
|
23768
|
+
*/
|
|
23769
|
+
if (source1 === undefined || source2 === undefined) {
|
|
23770
|
+
return true;
|
|
23771
|
+
}
|
|
23772
|
+
if (source1 instanceof basic_1.HexType && this.isCalculated(node1) && source2 instanceof basic_1.IntegerType) {
|
|
23773
|
+
return false;
|
|
23774
|
+
}
|
|
23775
|
+
if (source2 instanceof basic_1.HexType && this.isCalculated(node2) && source1 instanceof basic_1.IntegerType) {
|
|
23776
|
+
return false;
|
|
23777
|
+
}
|
|
23778
|
+
return true;
|
|
23779
|
+
}
|
|
23764
23780
|
structureContainsString(structure) {
|
|
23765
23781
|
for (const c of structure.getComponents()) {
|
|
23766
23782
|
if (c.type instanceof basic_1.StringType) {
|
|
@@ -23790,6 +23806,13 @@ class TypeUtils {
|
|
|
23790
23806
|
|| node.findFirstExpression(Expressions.ArithOperator) !== undefined;
|
|
23791
23807
|
return calculated;
|
|
23792
23808
|
}
|
|
23809
|
+
isAssignableNew(source, target, node) {
|
|
23810
|
+
const calculated = (node === null || node === void 0 ? void 0 : node.findFirstExpression(Expressions.ArithOperator)) !== undefined;
|
|
23811
|
+
if (calculated && source instanceof basic_1.HexType && target instanceof basic_1.IntegerType) {
|
|
23812
|
+
return false;
|
|
23813
|
+
}
|
|
23814
|
+
return this.isAssignable(source, target);
|
|
23815
|
+
}
|
|
23793
23816
|
isAssignableStrict(source, target, node) {
|
|
23794
23817
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
23795
23818
|
const calculated = node ? this.isCalculated(node) : false;
|
|
@@ -25389,10 +25412,14 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
|
|
|
25389
25412
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
25390
25413
|
const method_call_chain_1 = __webpack_require__(/*! ./method_call_chain */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_chain.js");
|
|
25391
25414
|
const source_field_symbol_1 = __webpack_require__(/*! ./source_field_symbol */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source_field_symbol.js");
|
|
25415
|
+
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
25416
|
+
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
|
|
25392
25417
|
class Compare {
|
|
25393
25418
|
static runSyntax(node, input) {
|
|
25394
|
-
|
|
25395
|
-
|
|
25419
|
+
const sourceTypes = [];
|
|
25420
|
+
const sources = node.findDirectExpressions(Expressions.Source);
|
|
25421
|
+
for (const t of sources) {
|
|
25422
|
+
sourceTypes.push(source_1.Source.runSyntax(t, input));
|
|
25396
25423
|
}
|
|
25397
25424
|
for (const t of node.findDirectExpressions(Expressions.SourceFieldSymbolChain)) {
|
|
25398
25425
|
source_field_symbol_1.SourceFieldSymbol.runSyntax(t, input);
|
|
@@ -25400,6 +25427,12 @@ class Compare {
|
|
|
25400
25427
|
for (const t of node.findDirectExpressions(Expressions.MethodCallChain)) {
|
|
25401
25428
|
method_call_chain_1.MethodCallChain.runSyntax(t, input);
|
|
25402
25429
|
}
|
|
25430
|
+
if (node.findDirectExpression(Expressions.CompareOperator)
|
|
25431
|
+
&& new _type_utils_1.TypeUtils(input.scope).isCompareable(sourceTypes[0], sourceTypes[1], sources[0], sources[1]) === false
|
|
25432
|
+
&& sourceTypes.length === 2) {
|
|
25433
|
+
const message = "Incompatible types for comparison";
|
|
25434
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
25435
|
+
}
|
|
25403
25436
|
}
|
|
25404
25437
|
}
|
|
25405
25438
|
exports.Compare = Compare;
|
|
@@ -29182,53 +29215,84 @@ exports.SQLSource = SQLSource;
|
|
|
29182
29215
|
|
|
29183
29216
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
29184
29217
|
exports.StringTemplate = void 0;
|
|
29218
|
+
const nodes_1 = __webpack_require__(/*! ../../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
29185
29219
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
29186
29220
|
const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
29187
29221
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
29188
29222
|
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
|
|
29189
29223
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
29224
|
+
const Tokens = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
29190
29225
|
class StringTemplate {
|
|
29191
29226
|
static runSyntax(node, input) {
|
|
29192
29227
|
const typeUtils = new _type_utils_1.TypeUtils(input.scope);
|
|
29193
29228
|
const ret = basic_1.StringType.get();
|
|
29194
|
-
for (const
|
|
29195
|
-
|
|
29196
|
-
|
|
29197
|
-
|
|
29198
|
-
|
|
29199
|
-
|
|
29200
|
-
|
|
29201
|
-
|
|
29202
|
-
|
|
29203
|
-
|
|
29204
|
-
|
|
29205
|
-
|
|
29206
|
-
|
|
29207
|
-
|
|
29208
|
-
|
|
29229
|
+
for (const child of node.getChildren()) {
|
|
29230
|
+
if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.StringTemplateSource) {
|
|
29231
|
+
const s = child.findDirectExpression(Expressions.Source);
|
|
29232
|
+
const type = source_1.Source.runSyntax(s, input, ret);
|
|
29233
|
+
if (type === undefined) {
|
|
29234
|
+
const message = "No target type determined";
|
|
29235
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
29236
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
29237
|
+
}
|
|
29238
|
+
else if ((typeUtils.isCharLike(type) === false
|
|
29239
|
+
&& typeUtils.isHexLike(type) === false
|
|
29240
|
+
&& !(type instanceof basic_1.UTCLongType))
|
|
29241
|
+
|| type instanceof basic_1.StructureType) {
|
|
29242
|
+
const message = "String template, not character like, " + type.constructor.name;
|
|
29243
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
29244
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
29245
|
+
}
|
|
29246
|
+
const format = child.findDirectExpression(Expressions.StringTemplateFormatting);
|
|
29247
|
+
const formatConcat = format === null || format === void 0 ? void 0 : format.concatTokens();
|
|
29248
|
+
for (const formatSource of (format === null || format === void 0 ? void 0 : format.findAllExpressions(Expressions.Source)) || []) {
|
|
29249
|
+
source_1.Source.runSyntax(formatSource, input);
|
|
29250
|
+
}
|
|
29251
|
+
if (format
|
|
29252
|
+
&& (formatConcat === null || formatConcat === void 0 ? void 0 : formatConcat.includes("ALPHA = "))
|
|
29253
|
+
&& !(type instanceof basic_1.UnknownType)
|
|
29254
|
+
&& !(type instanceof basic_1.VoidType)
|
|
29255
|
+
&& !(type instanceof basic_1.StringType)
|
|
29256
|
+
&& !(type instanceof basic_1.CLikeType)
|
|
29257
|
+
&& !(type instanceof basic_1.CharacterType)
|
|
29258
|
+
&& !(type instanceof basic_1.NumericGenericType)
|
|
29259
|
+
&& !(type instanceof basic_1.NumericType)
|
|
29260
|
+
&& !(type instanceof basic_1.AnyType)) {
|
|
29261
|
+
const message = `Cannot apply ALPHA to this type (${type.constructor.name})`;
|
|
29262
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, format.getFirstToken(), message));
|
|
29263
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
29264
|
+
}
|
|
29209
29265
|
}
|
|
29210
|
-
|
|
29211
|
-
|
|
29212
|
-
|
|
29213
|
-
|
|
29214
|
-
|
|
29215
|
-
|
|
29216
|
-
|
|
29217
|
-
|
|
29218
|
-
|
|
29219
|
-
|
|
29220
|
-
|
|
29221
|
-
|
|
29222
|
-
&& !(type instanceof basic_1.NumericGenericType)
|
|
29223
|
-
&& !(type instanceof basic_1.NumericType)
|
|
29224
|
-
&& !(type instanceof basic_1.AnyType)) {
|
|
29225
|
-
const message = `Cannot apply ALPHA to this type (${type.constructor.name})`;
|
|
29226
|
-
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, format.getFirstToken(), message));
|
|
29227
|
-
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
29266
|
+
else if (child instanceof nodes_1.TokenNode) {
|
|
29267
|
+
const token = child.get();
|
|
29268
|
+
if (token instanceof Tokens.StringTemplate
|
|
29269
|
+
|| token instanceof Tokens.StringTemplateBegin
|
|
29270
|
+
|| token instanceof Tokens.StringTemplateMiddle
|
|
29271
|
+
|| token instanceof Tokens.StringTemplateEnd) {
|
|
29272
|
+
const issue = this.validateEscapeSequences(token.getStr(), input, child);
|
|
29273
|
+
if (issue) {
|
|
29274
|
+
input.issues.push(issue);
|
|
29275
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
29276
|
+
}
|
|
29277
|
+
}
|
|
29228
29278
|
}
|
|
29229
29279
|
}
|
|
29230
29280
|
return ret;
|
|
29231
29281
|
}
|
|
29282
|
+
static validateEscapeSequences(str, input, node) {
|
|
29283
|
+
// Valid escape sequences in ABAP string templates: \|, \{, \}, \\, \n, \r, \t
|
|
29284
|
+
const validEscapes = new Set(["\\|", "\\{", "\\}", "\\\\", "\\n", "\\r", "\\t"]);
|
|
29285
|
+
for (let i = 0; i < str.length; i++) {
|
|
29286
|
+
if (str[i] === "\\") {
|
|
29287
|
+
const escape = str.substring(i, i + 2);
|
|
29288
|
+
if (!validEscapes.has(escape)) {
|
|
29289
|
+
return (0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), `Invalid escape sequence "${escape}" in string template`);
|
|
29290
|
+
}
|
|
29291
|
+
i++; // skip the next character as it's part of the escape sequence
|
|
29292
|
+
}
|
|
29293
|
+
}
|
|
29294
|
+
return undefined;
|
|
29295
|
+
}
|
|
29232
29296
|
}
|
|
29233
29297
|
exports.StringTemplate = StringTemplate;
|
|
29234
29298
|
//# sourceMappingURL=string_template.js.map
|
|
@@ -33606,7 +33670,7 @@ class Move {
|
|
|
33606
33670
|
return;
|
|
33607
33671
|
}
|
|
33608
33672
|
}
|
|
33609
|
-
else if (new _type_utils_1.TypeUtils(input.scope).
|
|
33673
|
+
else if (new _type_utils_1.TypeUtils(input.scope).isAssignableNew(sourceType, targetType, source) === false) {
|
|
33610
33674
|
const message = "Incompatible types";
|
|
33611
33675
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
33612
33676
|
return;
|
|
@@ -55374,7 +55438,7 @@ class Registry {
|
|
|
55374
55438
|
}
|
|
55375
55439
|
static abaplintVersion() {
|
|
55376
55440
|
// magic, see build script "version.sh"
|
|
55377
|
-
return "2.115.
|
|
55441
|
+
return "2.115.17";
|
|
55378
55442
|
}
|
|
55379
55443
|
getDDICReferences() {
|
|
55380
55444
|
return this.ddicReferences;
|
|
@@ -55588,7 +55652,7 @@ class Registry {
|
|
|
55588
55652
|
return this;
|
|
55589
55653
|
}
|
|
55590
55654
|
ParsingPerformance.clear();
|
|
55591
|
-
(_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount().
|
|
55655
|
+
(_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount().total, "Lexing and parsing");
|
|
55592
55656
|
for (const o of this.getObjects()) {
|
|
55593
55657
|
await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick("Lexing and parsing(" + this.conf.getVersion() + ") - " + o.getType() + " " + o.getName()));
|
|
55594
55658
|
this.parsePrivate(o);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.115.
|
|
3
|
+
"version": "2.115.17",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://abaplint.org",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@abaplint/core": "^2.115.
|
|
41
|
+
"@abaplint/core": "^2.115.17",
|
|
42
42
|
"@types/chai": "^4.3.20",
|
|
43
43
|
"@types/minimist": "^1.2.5",
|
|
44
44
|
"@types/mocha": "^10.0.10",
|
|
45
|
-
"@types/node": "^24.10.
|
|
45
|
+
"@types/node": "^24.10.9",
|
|
46
46
|
"@types/progress": "^2.0.7",
|
|
47
47
|
"chai": "^4.5.0",
|
|
48
48
|
"p-limit": "^3.1.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"eslint": "^9.39.2",
|
|
51
51
|
"glob": "^11.0.3",
|
|
52
52
|
"json5": "^2.2.3",
|
|
53
|
-
"memfs": "^4.
|
|
53
|
+
"memfs": "^4.56.10",
|
|
54
54
|
"minimist": "^1.2.8",
|
|
55
55
|
"mocha": "^11.7.5",
|
|
56
56
|
"progress": "^2.0.3",
|