@abaplint/cli 2.113.168 → 2.113.170
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 +29 -15
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -7061,7 +7061,7 @@ class NewObject extends combi_1.Expression {
|
|
|
7061
7061
|
const lines = (0, combi_1.plus)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), _1.Source, (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
7062
7062
|
const linesFields = (0, combi_1.plus)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.plus)(field_assignment_1.FieldAssignment), (0, combi_1.tok)(tokens_1.WParenRightW)));
|
|
7063
7063
|
const neww = (0, combi_1.seq)("NEW", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), (0, combi_1.optPrio)((0, combi_1.alt)(_1.Source, _1.ParameterListS, lines, linesFields)), ")");
|
|
7064
|
-
return (0, combi_1.ver)(version_1.Version.v740sp02, neww);
|
|
7064
|
+
return (0, combi_1.ver)(version_1.Version.v740sp02, neww, version_1.Version.OpenABAP);
|
|
7065
7065
|
}
|
|
7066
7066
|
}
|
|
7067
7067
|
exports.NewObject = NewObject;
|
|
@@ -7890,7 +7890,7 @@ class Source extends combi_1.Expression {
|
|
|
7890
7890
|
// paren used for eg. "( 2 + 1 ) * 4"
|
|
7891
7891
|
const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), Source, rparen);
|
|
7892
7892
|
const after = (0, combi_1.seq)((0, combi_1.altPrio)("&", "&&", _1.ArithOperator), Source);
|
|
7893
|
-
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, ")");
|
|
7893
|
+
const bool = (0, combi_1.seq)((0, combi_1.altPrio)((0, combi_1.ver)(version_1.Version.v702, (0, combi_1.regex)(/^BOOLC$/i), version_1.Version.OpenABAP), (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.regex)(/^XSDBOOL$/i)), version_1.Version.OpenABAP), (0, combi_1.tok)(tokens_1.ParenLeftW), _1.Cond, ")");
|
|
7894
7894
|
const prefix = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WPlus), "BIT-NOT");
|
|
7895
7895
|
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, deref), paren), (0, combi_1.optPrio)(after));
|
|
7896
7896
|
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)));
|
|
@@ -21043,7 +21043,7 @@ class BuiltIn {
|
|
|
21043
21043
|
constructor() {
|
|
21044
21044
|
this.row = 1;
|
|
21045
21045
|
}
|
|
21046
|
-
buildDefinition(method, name) {
|
|
21046
|
+
static buildDefinition(method, name) {
|
|
21047
21047
|
if (method.cache) {
|
|
21048
21048
|
return method.cache;
|
|
21049
21049
|
}
|
|
@@ -21052,7 +21052,7 @@ class BuiltIn {
|
|
|
21052
21052
|
method.cache = result;
|
|
21053
21053
|
return result;
|
|
21054
21054
|
}
|
|
21055
|
-
searchBuiltin(name) {
|
|
21055
|
+
static searchBuiltin(name) {
|
|
21056
21056
|
if (name === undefined) {
|
|
21057
21057
|
return undefined;
|
|
21058
21058
|
}
|
|
@@ -21062,7 +21062,7 @@ class BuiltIn {
|
|
|
21062
21062
|
}
|
|
21063
21063
|
return this.buildDefinition(def, name);
|
|
21064
21064
|
}
|
|
21065
|
-
isPredicate(name) {
|
|
21065
|
+
static isPredicate(name) {
|
|
21066
21066
|
if (name === undefined) {
|
|
21067
21067
|
return undefined;
|
|
21068
21068
|
}
|
|
@@ -26688,7 +26688,7 @@ class MethodCallChain {
|
|
|
26688
26688
|
// eslint-disable-next-line prefer-const
|
|
26689
26689
|
let { method, def: foundDef } = helper.searchMethodName(def, methodName);
|
|
26690
26690
|
if (method === undefined && current === first) {
|
|
26691
|
-
method =
|
|
26691
|
+
method = _builtin_1.BuiltIn.searchBuiltin(methodName === null || methodName === void 0 ? void 0 : methodName.toUpperCase());
|
|
26692
26692
|
if (method) {
|
|
26693
26693
|
input.scope.addReference(methodToken, method, _reference_1.ReferenceType.BuiltinMethodReference, input.filename);
|
|
26694
26694
|
}
|
|
@@ -27449,11 +27449,15 @@ const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/
|
|
|
27449
27449
|
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
|
|
27450
27450
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
27451
27451
|
const assert_error_1 = __webpack_require__(/*! ../assert_error */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/assert_error.js");
|
|
27452
|
+
const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
|
|
27452
27453
|
class NewObject {
|
|
27453
27454
|
static runSyntax(node, input, targetType) {
|
|
27454
27455
|
let ret = undefined;
|
|
27455
27456
|
const typeExpr = node.findDirectExpression(Expressions.TypeNameOrInfer);
|
|
27456
27457
|
const typeToken = typeExpr === null || typeExpr === void 0 ? void 0 : typeExpr.getFirstToken();
|
|
27458
|
+
if (typeToken === undefined) {
|
|
27459
|
+
throw new Error("NewObject, child TypeNameOrInfer not found");
|
|
27460
|
+
}
|
|
27457
27461
|
const typeName = typeExpr === null || typeExpr === void 0 ? void 0 : typeExpr.concatTokens();
|
|
27458
27462
|
if (typeName === undefined) {
|
|
27459
27463
|
throw new assert_error_1.AssertError("NewObject, child TypeNameOrInfer not found");
|
|
@@ -27461,7 +27465,8 @@ class NewObject {
|
|
|
27461
27465
|
else if (typeName === "#" && targetType && targetType instanceof basic_1.ObjectReferenceType) {
|
|
27462
27466
|
const clas = input.scope.findClassDefinition(targetType.getIdentifierName());
|
|
27463
27467
|
if (clas) {
|
|
27464
|
-
|
|
27468
|
+
const tid = new _typed_identifier_1.TypedIdentifier(typeToken, input.filename, targetType);
|
|
27469
|
+
input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename);
|
|
27465
27470
|
input.scope.addReference(typeToken, clas, _reference_1.ReferenceType.ConstructorReference, input.filename, { ooName: clas.getName() });
|
|
27466
27471
|
}
|
|
27467
27472
|
else {
|
|
@@ -28097,14 +28102,14 @@ class Source {
|
|
|
28097
28102
|
break;
|
|
28098
28103
|
case "BOOLC":
|
|
28099
28104
|
{
|
|
28100
|
-
const method =
|
|
28105
|
+
const method = _builtin_1.BuiltIn.searchBuiltin(tok);
|
|
28101
28106
|
input.scope.addReference(token, method, _reference_1.ReferenceType.BuiltinMethodReference, input.filename);
|
|
28102
28107
|
cond_1.Cond.runSyntax(node.findDirectExpression(Expressions.Cond), input);
|
|
28103
28108
|
return basic_1.StringType.get();
|
|
28104
28109
|
}
|
|
28105
28110
|
case "XSDBOOL":
|
|
28106
28111
|
{
|
|
28107
|
-
const method =
|
|
28112
|
+
const method = _builtin_1.BuiltIn.searchBuiltin(tok);
|
|
28108
28113
|
input.scope.addReference(token, method, _reference_1.ReferenceType.BuiltinMethodReference, input.filename);
|
|
28109
28114
|
cond_1.Cond.runSyntax(node.findDirectExpression(Expressions.Cond), input);
|
|
28110
28115
|
return new basic_1.CharacterType(1, { qualifiedName: "ABAP_BOOL", ddicName: "ABAP_BOOL" });
|
|
@@ -28349,7 +28354,8 @@ class Source {
|
|
|
28349
28354
|
if (typeName === "#" && inferredType && typeToken) {
|
|
28350
28355
|
const found = basic.lookupQualifiedName(inferredType.getQualifiedName());
|
|
28351
28356
|
if (found) {
|
|
28352
|
-
|
|
28357
|
+
const tid = new _typed_identifier_1.TypedIdentifier(typeToken, input.filename, inferredType);
|
|
28358
|
+
input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename, { foundQualified: true });
|
|
28353
28359
|
}
|
|
28354
28360
|
else if (inferredType instanceof basic_1.ObjectReferenceType) {
|
|
28355
28361
|
const def = input.scope.findObjectDefinition(inferredType.getQualifiedName());
|
|
@@ -44219,7 +44225,7 @@ class LSPLookup {
|
|
|
44219
44225
|
ret += "\n\n" + this.dumpType(ref.resolved);
|
|
44220
44226
|
}
|
|
44221
44227
|
else if (ref.referenceType === _reference_1.ReferenceType.BuiltinMethodReference) {
|
|
44222
|
-
const builtinDef =
|
|
44228
|
+
const builtinDef = _builtin_1.BuiltIn.searchBuiltin((_e = (_d = ref.resolved) === null || _d === void 0 ? void 0 : _d.getName()) === null || _e === void 0 ? void 0 : _e.toUpperCase());
|
|
44223
44229
|
if (builtinDef === undefined) {
|
|
44224
44230
|
return "Error: builtin method signature not found";
|
|
44225
44231
|
}
|
|
@@ -54816,7 +54822,7 @@ class Registry {
|
|
|
54816
54822
|
}
|
|
54817
54823
|
static abaplintVersion() {
|
|
54818
54824
|
// magic, see build script "version.sh"
|
|
54819
|
-
return "2.113.
|
|
54825
|
+
return "2.113.170";
|
|
54820
54826
|
}
|
|
54821
54827
|
getDDICReferences() {
|
|
54822
54828
|
return this.ddicReferences;
|
|
@@ -62682,7 +62688,7 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
62682
62688
|
const spag = highSyntax.spaghetti.lookupPosition(high.getFirstToken().getStart(), lowFile.getFilename());
|
|
62683
62689
|
for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {
|
|
62684
62690
|
if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference &&
|
|
62685
|
-
|
|
62691
|
+
_builtin_1.BuiltIn.isPredicate(chain.getFirstToken().getStr().toUpperCase())) {
|
|
62686
62692
|
predicate = true;
|
|
62687
62693
|
break;
|
|
62688
62694
|
}
|
|
@@ -62895,6 +62901,15 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
62895
62901
|
cdef = r.resolved;
|
|
62896
62902
|
}
|
|
62897
62903
|
}
|
|
62904
|
+
if (cdef instanceof _typed_identifier_1.TypedIdentifier) {
|
|
62905
|
+
const foo = cdef.getType();
|
|
62906
|
+
if (foo instanceof basic_1.ObjectReferenceType) {
|
|
62907
|
+
cdef = foo.getIdentifier();
|
|
62908
|
+
}
|
|
62909
|
+
else {
|
|
62910
|
+
throw new Error("newParameters, downport, unexpected");
|
|
62911
|
+
}
|
|
62912
|
+
}
|
|
62898
62913
|
if (cdef && cdef.getMethodDefinitions === undefined) {
|
|
62899
62914
|
return undefined; // something wrong
|
|
62900
62915
|
}
|
|
@@ -68456,9 +68471,8 @@ ENDCLASS.`,
|
|
|
68456
68471
|
for (const classDef of file.getInfo().listClassDefinitions()) {
|
|
68457
68472
|
methods = methods.concat(classDef.methods);
|
|
68458
68473
|
}
|
|
68459
|
-
const builtIn = new _builtin_1.BuiltIn();
|
|
68460
68474
|
for (const method of methods) {
|
|
68461
|
-
if (
|
|
68475
|
+
if (_builtin_1.BuiltIn.searchBuiltin(method.name.toUpperCase())) {
|
|
68462
68476
|
const message = `Method name "${method.name}" overwrites built-in SAP function name`;
|
|
68463
68477
|
issues.push(issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key));
|
|
68464
68478
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.170",
|
|
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.170",
|
|
42
42
|
"@types/chai": "^4.3.20",
|
|
43
43
|
"@types/minimist": "^1.2.5",
|
|
44
44
|
"@types/mocha": "^10.0.10",
|