@abaplint/cli 2.120.66 → 2.120.68
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 +176 -46
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -16912,7 +16912,9 @@ class ModifyLine {
|
|
|
16912
16912
|
const ocp = (0, combi_1.str)("OF CURRENT PAGE");
|
|
16913
16913
|
const intensified = (0, combi_1.seq)("INTENSIFIED", onOff);
|
|
16914
16914
|
const intensifiedOpt = (0, combi_1.seq)("INTENSIFIED", (0, combi_1.opt)(onOff));
|
|
16915
|
-
const
|
|
16915
|
+
const inputOpt = (0, combi_1.seq)("INPUT", (0, combi_1.opt)((0, combi_1.alt)(eq, onOff)));
|
|
16916
|
+
const inverseOpt = (0, combi_1.seq)("INVERSE", (0, combi_1.opt)((0, combi_1.alt)(eq, onOff)));
|
|
16917
|
+
const lineFormat = (0, combi_1.seq)("LINE FORMAT", (0, combi_1.per)(inputOpt, inverseOpt, "RESET", intensifiedOpt, expressions_1.Color));
|
|
16916
16918
|
const options = (0, combi_1.per)(index, value, format, page, lineFormat, lineValue, ocp, intensified, expressions_1.Color);
|
|
16917
16919
|
const ret = (0, combi_1.seq)("MODIFY", (0, combi_1.altPrio)("CURRENT LINE", (0, combi_1.seq)("LINE", expressions_1.Source)), (0, combi_1.opt)(options));
|
|
16918
16920
|
return (0, combi_1.verNotLang)(version_1.LanguageVersion.Cloud, ret);
|
|
@@ -26471,6 +26473,7 @@ class CurrentScope {
|
|
|
26471
26473
|
if (name === undefined) {
|
|
26472
26474
|
return undefined;
|
|
26473
26475
|
}
|
|
26476
|
+
name = name.replace(/^!/, "");
|
|
26474
26477
|
const found = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findVariable(name);
|
|
26475
26478
|
if (found) {
|
|
26476
26479
|
return found;
|
|
@@ -26576,6 +26579,17 @@ class CurrentScope {
|
|
|
26576
26579
|
var _a;
|
|
26577
26580
|
return ((_a = this.localFriends.get(className.toUpperCase())) === null || _a === void 0 ? void 0 : _a.includes(friendName.toUpperCase())) === true;
|
|
26578
26581
|
}
|
|
26582
|
+
getEnclosingMethodName() {
|
|
26583
|
+
let curr = this.current;
|
|
26584
|
+
while (curr !== undefined) {
|
|
26585
|
+
const stype = curr.getIdentifier().stype;
|
|
26586
|
+
if (stype === _scope_type_1.ScopeType.Method || stype === _scope_type_1.ScopeType.MethodInstance) {
|
|
26587
|
+
return curr.getIdentifier().sname;
|
|
26588
|
+
}
|
|
26589
|
+
curr = curr.getParent();
|
|
26590
|
+
}
|
|
26591
|
+
return undefined;
|
|
26592
|
+
}
|
|
26579
26593
|
getEnclosingClassName() {
|
|
26580
26594
|
let curr = this.current;
|
|
26581
26595
|
while (curr !== undefined) {
|
|
@@ -26800,6 +26814,97 @@ class ObjectOriented {
|
|
|
26800
26814
|
}
|
|
26801
26815
|
// does the supplied class have friendship with "friendName"?
|
|
26802
26816
|
// note that interfaces of the friend, and subclasses of the friend also have friendship
|
|
26817
|
+
// returns the visibility as text if a member declared in foundDef, reached via def, cannot be accessed from enclosing
|
|
26818
|
+
memberNotVisible(visibility, def, foundDef, enclosing) {
|
|
26819
|
+
var _a, _b;
|
|
26820
|
+
if (visibility === visibility_1.Visibility.Public || foundDef === undefined) {
|
|
26821
|
+
return undefined;
|
|
26822
|
+
}
|
|
26823
|
+
else if (!(foundDef instanceof types_1.ClassDefinition)) {
|
|
26824
|
+
// interface members are always public
|
|
26825
|
+
return undefined;
|
|
26826
|
+
}
|
|
26827
|
+
const name = foundDef.getName().toUpperCase();
|
|
26828
|
+
enclosing = enclosing === null || enclosing === void 0 ? void 0 : enclosing.toUpperCase();
|
|
26829
|
+
if (enclosing === undefined || enclosing === name) {
|
|
26830
|
+
return undefined;
|
|
26831
|
+
}
|
|
26832
|
+
// friendship with the class used at the call site also gives access to inherited members
|
|
26833
|
+
const visited = [];
|
|
26834
|
+
let current = def instanceof types_1.ClassDefinition ? def : foundDef;
|
|
26835
|
+
while (current !== undefined && visited.includes(current.getName().toUpperCase()) === false) {
|
|
26836
|
+
visited.push(current.getName().toUpperCase());
|
|
26837
|
+
if (this.hasFriendship(current, enclosing)) {
|
|
26838
|
+
return undefined;
|
|
26839
|
+
}
|
|
26840
|
+
const sup = current.getSuperClass();
|
|
26841
|
+
current = sup === undefined ? undefined : this.scope.findClassDefinition(sup);
|
|
26842
|
+
}
|
|
26843
|
+
if (visibility === visibility_1.Visibility.Protected) {
|
|
26844
|
+
// subclasses can access protected members
|
|
26845
|
+
let sup = (_a = this.scope.findClassDefinition(enclosing)) === null || _a === void 0 ? void 0 : _a.getSuperClass();
|
|
26846
|
+
while (sup !== undefined) {
|
|
26847
|
+
if (sup.toUpperCase() === name) {
|
|
26848
|
+
return undefined;
|
|
26849
|
+
}
|
|
26850
|
+
sup = (_b = this.scope.findClassDefinition(sup)) === null || _b === void 0 ? void 0 : _b.getSuperClass();
|
|
26851
|
+
}
|
|
26852
|
+
return "protected";
|
|
26853
|
+
}
|
|
26854
|
+
return "private";
|
|
26855
|
+
}
|
|
26856
|
+
// the fixture methods of a test class are called by ABAP Unit only, returns the message otherwise
|
|
26857
|
+
checkSpecialTestMethodCall(method, foundDef) {
|
|
26858
|
+
if (method === undefined
|
|
26859
|
+
|| !(foundDef instanceof types_1.ClassDefinition)
|
|
26860
|
+
|| foundDef.isForTesting() === false) {
|
|
26861
|
+
return undefined;
|
|
26862
|
+
}
|
|
26863
|
+
const name = method.getName().toUpperCase();
|
|
26864
|
+
if (["SETUP", "TEARDOWN", "CLASS_SETUP", "CLASS_TEARDOWN"].includes(name) === false) {
|
|
26865
|
+
return undefined;
|
|
26866
|
+
}
|
|
26867
|
+
return `The special method "${name}" cannot be called directly`;
|
|
26868
|
+
}
|
|
26869
|
+
// SUPER-> can only call the previous implementation of the method it is used in, returns the message otherwise
|
|
26870
|
+
// both names are resolved in the super class, so an alias and the method it stands for are the same
|
|
26871
|
+
checkSuperCall(superDef, methodName) {
|
|
26872
|
+
const enclosing = this.scope.getEnclosingMethodName();
|
|
26873
|
+
if (methodName === undefined
|
|
26874
|
+
|| enclosing === undefined
|
|
26875
|
+
|| methodName.toUpperCase() === enclosing.toUpperCase()) {
|
|
26876
|
+
return undefined;
|
|
26877
|
+
}
|
|
26878
|
+
const message = "SUPER-> can only be used to call the previous implementation of the same method";
|
|
26879
|
+
// a method that is not a redefinition has no previous implementation
|
|
26880
|
+
const enclosingClass = this.scope.findClassDefinition(this.scope.getEnclosingClassName());
|
|
26881
|
+
const ownDefinition = enclosingClass === null || enclosingClass === void 0 ? void 0 : enclosingClass.getMethodDefinitions().getByName(enclosing);
|
|
26882
|
+
if (ownDefinition !== undefined && ownDefinition.isRedefinition() === false) {
|
|
26883
|
+
return message;
|
|
26884
|
+
}
|
|
26885
|
+
const called = this.searchMethodName(superDef, methodName).method;
|
|
26886
|
+
const own = this.searchMethodName(superDef, enclosing).method;
|
|
26887
|
+
if (called === undefined || own === undefined || called === own) {
|
|
26888
|
+
return undefined;
|
|
26889
|
+
}
|
|
26890
|
+
return message;
|
|
26891
|
+
}
|
|
26892
|
+
// the class declaring the attribute or constant, searched from def up through the super classes
|
|
26893
|
+
findAttributeOwner(def, found) {
|
|
26894
|
+
const visited = [];
|
|
26895
|
+
let current = def;
|
|
26896
|
+
while (current instanceof types_1.ClassDefinition && visited.includes(current.getName().toUpperCase()) === false) {
|
|
26897
|
+
visited.push(current.getName().toUpperCase());
|
|
26898
|
+
const attributes = current.getAttributes();
|
|
26899
|
+
if (attributes.getAll().includes(found)
|
|
26900
|
+
|| attributes.getConstants().includes(found)) {
|
|
26901
|
+
return current;
|
|
26902
|
+
}
|
|
26903
|
+
const sup = current.getSuperClass();
|
|
26904
|
+
current = sup === undefined ? undefined : this.findSuperDefinition(sup);
|
|
26905
|
+
}
|
|
26906
|
+
return undefined;
|
|
26907
|
+
}
|
|
26803
26908
|
hasFriendship(cd, friendName) {
|
|
26804
26909
|
var _a;
|
|
26805
26910
|
const friends = cd.getFriends().map(f => f.toUpperCase());
|
|
@@ -29776,6 +29881,8 @@ const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "../co
|
|
|
29776
29881
|
const data_reference_type_1 = __webpack_require__(/*! ../../types/basic/data_reference_type */ "../core/build/src/abap/types/basic/data_reference_type.js");
|
|
29777
29882
|
const _reference_1 = __webpack_require__(/*! ../_reference */ "../core/build/src/abap/5_syntax/_reference.js");
|
|
29778
29883
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/abap/types/basic/index.js");
|
|
29884
|
+
const class_attribute_1 = __webpack_require__(/*! ../../types/class_attribute */ "../core/build/src/abap/types/class_attribute.js");
|
|
29885
|
+
const class_constant_1 = __webpack_require__(/*! ../../types/class_constant */ "../core/build/src/abap/types/class_constant.js");
|
|
29779
29886
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
29780
29887
|
class AttributeName {
|
|
29781
29888
|
static runSyntax(context, node, input, type, error = true) {
|
|
@@ -29804,6 +29911,15 @@ class AttributeName {
|
|
|
29804
29911
|
}
|
|
29805
29912
|
return void_type_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
29806
29913
|
}
|
|
29914
|
+
if (found instanceof class_attribute_1.ClassAttribute || found instanceof class_constant_1.ClassConstant) {
|
|
29915
|
+
const owner = helper.findAttributeOwner(def, found);
|
|
29916
|
+
const notVisible = helper.memberNotVisible(found.getVisibility(), def, owner, input.scope.getEnclosingClassName());
|
|
29917
|
+
if (notVisible !== undefined) {
|
|
29918
|
+
const message = `Attribute "${name}" is ${notVisible} and cannot be accessed`;
|
|
29919
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, message));
|
|
29920
|
+
return void_type_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
29921
|
+
}
|
|
29922
|
+
}
|
|
29807
29923
|
if (type) {
|
|
29808
29924
|
input.scope.addReference(token, found, type, input.filename);
|
|
29809
29925
|
}
|
|
@@ -32742,8 +32858,6 @@ const _reference_1 = __webpack_require__(/*! ../_reference */ "../core/build/src
|
|
|
32742
32858
|
const component_name_1 = __webpack_require__(/*! ./component_name */ "../core/build/src/abap/5_syntax/expressions/component_name.js");
|
|
32743
32859
|
const attribute_name_1 = __webpack_require__(/*! ./attribute_name */ "../core/build/src/abap/5_syntax/expressions/attribute_name.js");
|
|
32744
32860
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
32745
|
-
const visibility_1 = __webpack_require__(/*! ../../4_file_information/visibility */ "../core/build/src/abap/4_file_information/visibility.js");
|
|
32746
|
-
const class_definition_1 = __webpack_require__(/*! ../../types/class_definition */ "../core/build/src/abap/types/class_definition.js");
|
|
32747
32861
|
class MethodCallChain {
|
|
32748
32862
|
static runSyntax(node, input, targetType) {
|
|
32749
32863
|
var _a, _b;
|
|
@@ -32773,6 +32887,14 @@ class MethodCallChain {
|
|
|
32773
32887
|
const methodToken = (_a = current.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
32774
32888
|
const methodName = methodToken === null || methodToken === void 0 ? void 0 : methodToken.getStr();
|
|
32775
32889
|
const def = input.scope.findObjectDefinition(className);
|
|
32890
|
+
const isSuper = current === children[2]
|
|
32891
|
+
&& first.get() instanceof Expressions.FieldChain
|
|
32892
|
+
&& first.concatTokens().toUpperCase() === "SUPER";
|
|
32893
|
+
const superMessage = isSuper ? helper.checkSuperCall(def, methodName) : undefined;
|
|
32894
|
+
if (superMessage !== undefined) {
|
|
32895
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, methodToken, superMessage));
|
|
32896
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
32897
|
+
}
|
|
32776
32898
|
// eslint-disable-next-line prefer-const
|
|
32777
32899
|
let { method, def: foundDef } = helper.searchMethodName(def, methodName);
|
|
32778
32900
|
if (method === undefined && current === first) {
|
|
@@ -32792,12 +32914,19 @@ class MethodCallChain {
|
|
|
32792
32914
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, methodToken, message));
|
|
32793
32915
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
32794
32916
|
}
|
|
32795
|
-
const notVisible = method
|
|
32917
|
+
const notVisible = method
|
|
32918
|
+
? helper.memberNotVisible(method.getVisibility(), def, foundDef, input.scope.getEnclosingClassName())
|
|
32919
|
+
: undefined;
|
|
32796
32920
|
if (notVisible !== undefined) {
|
|
32797
32921
|
const message = `Method "${methodName}" is ${notVisible} and cannot be accessed`;
|
|
32798
32922
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, methodToken, message));
|
|
32799
32923
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
32800
32924
|
}
|
|
32925
|
+
const specialMessage = isSuper ? undefined : helper.checkSpecialTestMethodCall(method, foundDef);
|
|
32926
|
+
if (specialMessage !== undefined) {
|
|
32927
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, methodToken, specialMessage));
|
|
32928
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
32929
|
+
}
|
|
32801
32930
|
const voidedName = context instanceof basic_1.VoidType ? context.getVoided() : undefined;
|
|
32802
32931
|
const extra = helper.methodReferenceExtras(foundDef, className || voidedName);
|
|
32803
32932
|
input.scope.addReference(methodToken, method, _reference_1.ReferenceType.MethodReference, input.filename, extra);
|
|
@@ -32840,47 +32969,6 @@ class MethodCallChain {
|
|
|
32840
32969
|
return context;
|
|
32841
32970
|
}
|
|
32842
32971
|
//////////////////////////////////////
|
|
32843
|
-
// returns the visibility as text if the method cannot be accessed from the current scope
|
|
32844
|
-
static checkVisibility(method, def, foundDef, input) {
|
|
32845
|
-
var _a, _b, _c;
|
|
32846
|
-
const visibility = method.getVisibility();
|
|
32847
|
-
if (visibility === visibility_1.Visibility.Public || foundDef === undefined) {
|
|
32848
|
-
return undefined;
|
|
32849
|
-
}
|
|
32850
|
-
else if (!(foundDef instanceof class_definition_1.ClassDefinition)) {
|
|
32851
|
-
// interface members are always public
|
|
32852
|
-
return undefined;
|
|
32853
|
-
}
|
|
32854
|
-
const name = foundDef.getName().toUpperCase();
|
|
32855
|
-
const enclosing = (_a = input.scope.getEnclosingClassName()) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
|
32856
|
-
if (enclosing === undefined || enclosing === name) {
|
|
32857
|
-
return undefined;
|
|
32858
|
-
}
|
|
32859
|
-
// friendship with the class used at the call site also gives access to inherited members
|
|
32860
|
-
const helper = new _object_oriented_1.ObjectOriented(input.scope);
|
|
32861
|
-
const visited = [];
|
|
32862
|
-
let current = def instanceof class_definition_1.ClassDefinition ? def : foundDef;
|
|
32863
|
-
while (current !== undefined && visited.includes(current.getName().toUpperCase()) === false) {
|
|
32864
|
-
visited.push(current.getName().toUpperCase());
|
|
32865
|
-
if (helper.hasFriendship(current, enclosing)) {
|
|
32866
|
-
return undefined;
|
|
32867
|
-
}
|
|
32868
|
-
const sup = current.getSuperClass();
|
|
32869
|
-
current = sup === undefined ? undefined : input.scope.findClassDefinition(sup);
|
|
32870
|
-
}
|
|
32871
|
-
if (visibility === visibility_1.Visibility.Protected) {
|
|
32872
|
-
// subclasses can access protected members
|
|
32873
|
-
let sup = (_b = input.scope.findClassDefinition(enclosing)) === null || _b === void 0 ? void 0 : _b.getSuperClass();
|
|
32874
|
-
while (sup !== undefined) {
|
|
32875
|
-
if (sup.toUpperCase() === name) {
|
|
32876
|
-
return undefined;
|
|
32877
|
-
}
|
|
32878
|
-
sup = (_c = input.scope.findClassDefinition(sup)) === null || _c === void 0 ? void 0 : _c.getSuperClass();
|
|
32879
|
-
}
|
|
32880
|
-
return "protected";
|
|
32881
|
-
}
|
|
32882
|
-
return "private";
|
|
32883
|
-
}
|
|
32884
32972
|
static findTop(first, input, targetType) {
|
|
32885
32973
|
var _a;
|
|
32886
32974
|
if (first.get() instanceof Expressions.ClassName) {
|
|
@@ -33702,6 +33790,14 @@ class MethodSource {
|
|
|
33702
33790
|
const methodToken = current.getFirstToken();
|
|
33703
33791
|
const methodName = methodToken === null || methodToken === void 0 ? void 0 : methodToken.getStr();
|
|
33704
33792
|
const def = input.scope.findObjectDefinition(className);
|
|
33793
|
+
const isSuper = implicitMe === false
|
|
33794
|
+
&& first.get() instanceof Expressions.SourceField
|
|
33795
|
+
&& first.concatTokens().toUpperCase() === "SUPER";
|
|
33796
|
+
const superMessage = isSuper ? helper.checkSuperCall(def, methodName) : undefined;
|
|
33797
|
+
if (superMessage !== undefined) {
|
|
33798
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, methodToken, superMessage));
|
|
33799
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
33800
|
+
}
|
|
33705
33801
|
// eslint-disable-next-line prefer-const
|
|
33706
33802
|
let { method, def: foundDef } = helper.searchMethodName(def, methodName);
|
|
33707
33803
|
if (implicitMe && current === first && (method === null || method === void 0 ? void 0 : method.isStatic()) === false && input.scope.isInStaticMethod() === true) {
|
|
@@ -33718,6 +33814,11 @@ class MethodSource {
|
|
|
33718
33814
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
33719
33815
|
}
|
|
33720
33816
|
else if (method) {
|
|
33817
|
+
const specialMessage = isSuper ? undefined : helper.checkSpecialTestMethodCall(method, foundDef);
|
|
33818
|
+
if (specialMessage !== undefined) {
|
|
33819
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, methodToken, specialMessage));
|
|
33820
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
33821
|
+
}
|
|
33721
33822
|
const extra = helper.methodReferenceExtras(foundDef, className);
|
|
33722
33823
|
input.scope.addReference(methodToken, method, _reference_1.ReferenceType.MethodReference, input.filename, extra);
|
|
33723
33824
|
context = method;
|
|
@@ -34816,6 +34917,7 @@ const corresponding_body_1 = __webpack_require__(/*! ./corresponding_body */ "..
|
|
|
34816
34917
|
const _builtin_1 = __webpack_require__(/*! ../_builtin */ "../core/build/src/abap/5_syntax/_builtin.js");
|
|
34817
34918
|
const attribute_chain_1 = __webpack_require__(/*! ./attribute_chain */ "../core/build/src/abap/5_syntax/expressions/attribute_chain.js");
|
|
34818
34919
|
const dereference_1 = __webpack_require__(/*! ./dereference */ "../core/build/src/abap/5_syntax/expressions/dereference.js");
|
|
34920
|
+
const cast_1 = __webpack_require__(/*! ./cast */ "../core/build/src/abap/5_syntax/expressions/cast.js");
|
|
34819
34921
|
const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "../core/build/src/abap/types/_typed_identifier.js");
|
|
34820
34922
|
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "../core/build/src/abap/5_syntax/_type_utils.js");
|
|
34821
34923
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
@@ -35039,6 +35141,10 @@ class Source {
|
|
|
35039
35141
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
35040
35142
|
}
|
|
35041
35143
|
}
|
|
35144
|
+
else if (get instanceof Expressions.Cast) {
|
|
35145
|
+
const found = cast_1.Cast.runSyntax(first, input, targetType);
|
|
35146
|
+
context = arithmetic === true ? this.infer(context, found, true) : found;
|
|
35147
|
+
}
|
|
35042
35148
|
else if (get instanceof Expressions.FieldChain) {
|
|
35043
35149
|
const found = field_chain_1.FieldChain.runSyntax(first, input, type, allowGenericDeference);
|
|
35044
35150
|
context = arithmetic === true ? this.infer(context, found, true) : found;
|
|
@@ -35055,6 +35161,11 @@ class Source {
|
|
|
35055
35161
|
context = this.infer(context, found, arithmetic);
|
|
35056
35162
|
}
|
|
35057
35163
|
else if (get instanceof Expressions.Dereference) {
|
|
35164
|
+
if (this.isNewObjectDereference(node, first)) {
|
|
35165
|
+
const message = "NEW cannot be dereferenced directly";
|
|
35166
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, first.getFirstToken(), message));
|
|
35167
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
35168
|
+
}
|
|
35058
35169
|
context = dereference_1.Dereference.runSyntax(first, context, input);
|
|
35059
35170
|
}
|
|
35060
35171
|
else if (get instanceof Expressions.ComponentChain) {
|
|
@@ -35242,6 +35353,16 @@ class Source {
|
|
|
35242
35353
|
}
|
|
35243
35354
|
return targetType;
|
|
35244
35355
|
}
|
|
35356
|
+
// "NEW ty( )->*" is a syntax error, also in releases where a method call can be dereferenced
|
|
35357
|
+
static isNewObjectDereference(node, deref) {
|
|
35358
|
+
var _a;
|
|
35359
|
+
const children = node.getChildren();
|
|
35360
|
+
const before = children[children.indexOf(deref) - 1];
|
|
35361
|
+
return before instanceof nodes_1.ExpressionNode
|
|
35362
|
+
&& before.get() instanceof Expressions.MethodCallChain
|
|
35363
|
+
&& before.getChildren().length === 1
|
|
35364
|
+
&& ((_a = before.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.NewObject;
|
|
35365
|
+
}
|
|
35245
35366
|
}
|
|
35246
35367
|
exports.Source = Source;
|
|
35247
35368
|
//# sourceMappingURL=source.js.map
|
|
@@ -36209,6 +36330,7 @@ const expressions_1 = __webpack_require__(/*! ../../2_statements/expressions */
|
|
|
36209
36330
|
const field_length_1 = __webpack_require__(/*! ./field_length */ "../core/build/src/abap/5_syntax/expressions/field_length.js");
|
|
36210
36331
|
const cast_1 = __webpack_require__(/*! ./cast */ "../core/build/src/abap/5_syntax/expressions/cast.js");
|
|
36211
36332
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
36333
|
+
const version_1 = __webpack_require__(/*! ../../../version */ "../core/build/src/version.js");
|
|
36212
36334
|
class Target {
|
|
36213
36335
|
static runSyntax(node, input) {
|
|
36214
36336
|
const concat = node.concatTokens();
|
|
@@ -36274,6 +36396,12 @@ class Target {
|
|
|
36274
36396
|
if (!(context instanceof basic_1.VoidType)) {
|
|
36275
36397
|
context = context.getType();
|
|
36276
36398
|
}
|
|
36399
|
+
if ((context === null || context === void 0 ? void 0 : context.isGeneric()) === true
|
|
36400
|
+
&& !(0, version_1.releaseAtLeast)(input.scope.getRelease(), version_1.Release.v756)
|
|
36401
|
+
&& input.scope.getLanguageVersion() !== version_1.LanguageVersion.Cloud
|
|
36402
|
+
&& !input.scope.getOpenABAP()) {
|
|
36403
|
+
throw new Error("A generic reference cannot be dereferenced");
|
|
36404
|
+
}
|
|
36277
36405
|
}
|
|
36278
36406
|
else if (current.get() instanceof Expressions.ComponentName) {
|
|
36279
36407
|
context = component_name_1.ComponentName.runSyntax(context, current, input);
|
|
@@ -70063,6 +70191,7 @@ class Indent {
|
|
|
70063
70191
|
|| type instanceof Statements.ProcessBeforeOutput
|
|
70064
70192
|
|| type instanceof Statements.ProcessOnValueRequest
|
|
70065
70193
|
|| type instanceof Statements.TopOfPage
|
|
70194
|
+
|| type instanceof Statements.EndOfPage
|
|
70066
70195
|
|| type instanceof Statements.Get
|
|
70067
70196
|
|| type instanceof Statements.EndOfSelection
|
|
70068
70197
|
|| type instanceof Statements.LoadOfProgram) {
|
|
@@ -70158,6 +70287,7 @@ class Indent {
|
|
|
70158
70287
|
|| type instanceof Statements.Initialization
|
|
70159
70288
|
|| type instanceof Statements.AtUserCommand
|
|
70160
70289
|
|| type instanceof Statements.TopOfPage
|
|
70290
|
+
|| type instanceof Statements.EndOfPage
|
|
70161
70291
|
|| type instanceof Statements.EndOfSelection
|
|
70162
70292
|
|| type instanceof Statements.Public
|
|
70163
70293
|
|| type instanceof Statements.Protected
|
|
@@ -70355,7 +70485,7 @@ class Registry {
|
|
|
70355
70485
|
}
|
|
70356
70486
|
static abaplintVersion() {
|
|
70357
70487
|
// magic, see build script "version.js"
|
|
70358
|
-
return "2.120.
|
|
70488
|
+
return "2.120.68";
|
|
70359
70489
|
}
|
|
70360
70490
|
getDDICReferences() {
|
|
70361
70491
|
return this.ddicReferences;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.120.
|
|
3
|
+
"version": "2.120.68",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://abaplint.org",
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@abaplint/core": "^2.120.
|
|
42
|
+
"@abaplint/core": "^2.120.68",
|
|
43
43
|
"@types/chai": "^4.3.20",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|
|
45
45
|
"@types/mocha": "^10.0.10",
|