@abaplint/cli 2.120.100 → 2.120.101
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 +336 -5
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -27839,6 +27839,167 @@ exports.Procedural = Procedural;
|
|
|
27839
27839
|
|
|
27840
27840
|
/***/ },
|
|
27841
27841
|
|
|
27842
|
+
/***/ "../core/build/src/abap/5_syntax/_raise_message.js"
|
|
27843
|
+
/*!*********************************************************!*\
|
|
27844
|
+
!*** ../core/build/src/abap/5_syntax/_raise_message.js ***!
|
|
27845
|
+
\*********************************************************/
|
|
27846
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
27847
|
+
|
|
27848
|
+
"use strict";
|
|
27849
|
+
|
|
27850
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
27851
|
+
if (k2 === undefined) k2 = k;
|
|
27852
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
27853
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
27854
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27855
|
+
}
|
|
27856
|
+
Object.defineProperty(o, k2, desc);
|
|
27857
|
+
}) : (function(o, m, k, k2) {
|
|
27858
|
+
if (k2 === undefined) k2 = k;
|
|
27859
|
+
o[k2] = m[k];
|
|
27860
|
+
}));
|
|
27861
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27862
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27863
|
+
}) : function(o, v) {
|
|
27864
|
+
o["default"] = v;
|
|
27865
|
+
});
|
|
27866
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27867
|
+
var ownKeys = function(o) {
|
|
27868
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27869
|
+
var ar = [];
|
|
27870
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27871
|
+
return ar;
|
|
27872
|
+
};
|
|
27873
|
+
return ownKeys(o);
|
|
27874
|
+
};
|
|
27875
|
+
return function (mod) {
|
|
27876
|
+
if (mod && mod.__esModule) return mod;
|
|
27877
|
+
var result = {};
|
|
27878
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
27879
|
+
__setModuleDefault(result, mod);
|
|
27880
|
+
return result;
|
|
27881
|
+
};
|
|
27882
|
+
})();
|
|
27883
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
27884
|
+
exports.RaiseMessage = void 0;
|
|
27885
|
+
const Expressions = __importStar(__webpack_require__(/*! ../2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
|
|
27886
|
+
const nodes_1 = __webpack_require__(/*! ../nodes */ "../core/build/src/abap/nodes/index.js");
|
|
27887
|
+
const _syntax_input_1 = __webpack_require__(/*! ./_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
27888
|
+
const T100_INTERFACES = new Set(["IF_T100_MESSAGE", "IF_T100_DYN_MSG"]);
|
|
27889
|
+
// the root exception classes, they implement IF_MESSAGE and IF_SERIALIZABLE_OBJECT, but not the T100 interfaces
|
|
27890
|
+
const ROOT_EXCEPTIONS = new Set(["CX_ROOT", "CX_STATIC_CHECK", "CX_DYNAMIC_CHECK", "CX_NO_CHECK"]);
|
|
27891
|
+
/** RAISE EXCEPTION TYPE cx MESSAGE ... and THROW cx( MESSAGE ... ) require the exception class to implement
|
|
27892
|
+
* IF_T100_MESSAGE or IF_T100_DYN_MSG, and with RAISE EXCEPTION the constructor parameter TEXTID cannot be
|
|
27893
|
+
* passed in addition to MESSAGE, see the ABAP keyword documentation for RAISE EXCEPTION, MESSAGE.
|
|
27894
|
+
* The interface check only reports when the full class hierarchy is known, void classes and void interfaces
|
|
27895
|
+
* in the hierarchy are skipped, except for the root exception classes. */
|
|
27896
|
+
class RaiseMessage {
|
|
27897
|
+
static checkRaise(node, input) {
|
|
27898
|
+
var _a, _b, _c;
|
|
27899
|
+
var _d;
|
|
27900
|
+
const classTok = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
27901
|
+
if (classTok === undefined || RaiseMessage.hasMessage(node) === false) {
|
|
27902
|
+
return;
|
|
27903
|
+
}
|
|
27904
|
+
for (const p of (_d = (_b = node.findDirectExpression(Expressions.ParameterListS)) === null || _b === void 0 ? void 0 : _b.findDirectExpressions(Expressions.ParameterS)) !== null && _d !== void 0 ? _d : []) {
|
|
27905
|
+
const name = (_c = p.findDirectExpression(Expressions.ParameterName)) === null || _c === void 0 ? void 0 : _c.getFirstToken();
|
|
27906
|
+
if ((name === null || name === void 0 ? void 0 : name.getStr().toUpperCase()) === "TEXTID") {
|
|
27907
|
+
const message = "RAISE EXCEPTION with MESSAGE, TEXTID cannot be passed";
|
|
27908
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, name, message));
|
|
27909
|
+
return;
|
|
27910
|
+
}
|
|
27911
|
+
}
|
|
27912
|
+
RaiseMessage.checkClass(classTok.getStr(), input, classTok);
|
|
27913
|
+
}
|
|
27914
|
+
static checkThrow(node, input) {
|
|
27915
|
+
var _a;
|
|
27916
|
+
const classTok = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
27917
|
+
if (classTok === undefined || node.findDirectExpression(Expressions.MessageSource) === undefined) {
|
|
27918
|
+
return;
|
|
27919
|
+
}
|
|
27920
|
+
RaiseMessage.checkClass(classTok.getStr(), input, classTok);
|
|
27921
|
+
}
|
|
27922
|
+
/** MESSAGE msg or MESSAGE ID, but not USING MESSAGE */
|
|
27923
|
+
static hasMessage(node) {
|
|
27924
|
+
const children = node.getChildren();
|
|
27925
|
+
for (let i = 0; i < children.length; i++) {
|
|
27926
|
+
const c = children[i];
|
|
27927
|
+
if (c instanceof nodes_1.TokenNode && c.getFirstToken().getStr().toUpperCase() === "MESSAGE") {
|
|
27928
|
+
const previous = children[i - 1];
|
|
27929
|
+
if (previous === undefined || previous.getFirstToken().getStr().toUpperCase() !== "USING") {
|
|
27930
|
+
return true;
|
|
27931
|
+
}
|
|
27932
|
+
}
|
|
27933
|
+
}
|
|
27934
|
+
return false;
|
|
27935
|
+
}
|
|
27936
|
+
static checkClass(className, input, classTok) {
|
|
27937
|
+
const def = input.scope.findClassDefinition(className);
|
|
27938
|
+
if (def === undefined) {
|
|
27939
|
+
return;
|
|
27940
|
+
}
|
|
27941
|
+
if (RaiseMessage.isT100(def, input.scope, new Set()) === false) {
|
|
27942
|
+
const message = "Exception class " + def.getName().toUpperCase() +
|
|
27943
|
+
" must implement IF_T100_MESSAGE or IF_T100_DYN_MSG to be raised with MESSAGE";
|
|
27944
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, classTok, message));
|
|
27945
|
+
}
|
|
27946
|
+
}
|
|
27947
|
+
/** true or false when known, undefined when the hierarchy contains void parts */
|
|
27948
|
+
static isT100(def, scope, visited) {
|
|
27949
|
+
var _a;
|
|
27950
|
+
const upper = def.getName().toUpperCase();
|
|
27951
|
+
if (visited.has(upper)) {
|
|
27952
|
+
return undefined;
|
|
27953
|
+
}
|
|
27954
|
+
visited.add(upper);
|
|
27955
|
+
let unknown = false;
|
|
27956
|
+
const interfaces = def.getImplementing().map(i => i.name.toUpperCase());
|
|
27957
|
+
const seen = new Set();
|
|
27958
|
+
while (interfaces.length > 0) {
|
|
27959
|
+
const name = interfaces.pop();
|
|
27960
|
+
if (seen.has(name)) {
|
|
27961
|
+
continue;
|
|
27962
|
+
}
|
|
27963
|
+
seen.add(name);
|
|
27964
|
+
if (T100_INTERFACES.has(name)) {
|
|
27965
|
+
return true;
|
|
27966
|
+
}
|
|
27967
|
+
const idef = scope.findInterfaceDefinition(name);
|
|
27968
|
+
if (idef === undefined) {
|
|
27969
|
+
unknown = true;
|
|
27970
|
+
}
|
|
27971
|
+
else {
|
|
27972
|
+
interfaces.push(...idef.getImplementing().map(i => i.name.toUpperCase()));
|
|
27973
|
+
}
|
|
27974
|
+
}
|
|
27975
|
+
const superName = (_a = def.getSuperClass()) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
|
27976
|
+
if (superName !== undefined) {
|
|
27977
|
+
const superDef = scope.findClassDefinition(superName);
|
|
27978
|
+
if (superDef !== undefined) {
|
|
27979
|
+
const res = RaiseMessage.isT100(superDef, scope, visited);
|
|
27980
|
+
if (res === true) {
|
|
27981
|
+
return true;
|
|
27982
|
+
}
|
|
27983
|
+
else if (res === undefined) {
|
|
27984
|
+
unknown = true;
|
|
27985
|
+
}
|
|
27986
|
+
}
|
|
27987
|
+
else if (ROOT_EXCEPTIONS.has(superName) === false) {
|
|
27988
|
+
unknown = true;
|
|
27989
|
+
}
|
|
27990
|
+
}
|
|
27991
|
+
else if (ROOT_EXCEPTIONS.has(upper) === false) {
|
|
27992
|
+
// not an exception class, reported elsewhere or not at all
|
|
27993
|
+
unknown = true;
|
|
27994
|
+
}
|
|
27995
|
+
return unknown ? undefined : false;
|
|
27996
|
+
}
|
|
27997
|
+
}
|
|
27998
|
+
exports.RaiseMessage = RaiseMessage;
|
|
27999
|
+
//# sourceMappingURL=_raise_message.js.map
|
|
28000
|
+
|
|
28001
|
+
/***/ },
|
|
28002
|
+
|
|
27842
28003
|
/***/ "../core/build/src/abap/5_syntax/_reference.js"
|
|
27843
28004
|
/*!*****************************************************!*\
|
|
27844
28005
|
!*** ../core/build/src/abap/5_syntax/_reference.js ***!
|
|
@@ -30618,7 +30779,14 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/bui
|
|
|
30618
30779
|
// a syntax error. Other types, a dynamic offset or length and "*" (undefined) are left alone, as is
|
|
30619
30780
|
// length 0. The offset is applied first, so the length is compared to what remains after the offset.
|
|
30620
30781
|
// A substring of a date, time or numeric text field has type n; its bounds are not checked.
|
|
30782
|
+
// An offset or length on a numeric field (i, int8, p, f, decfloat) is a syntax error, whatever its value.
|
|
30621
30783
|
function substringType(context, offset, length, node, input) {
|
|
30784
|
+
const numericName = numericTypeName(context);
|
|
30785
|
+
if (numericName !== undefined) {
|
|
30786
|
+
const message = `Offset or length specification not possible on a field of numeric type "${numericName}"`;
|
|
30787
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
30788
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
30789
|
+
}
|
|
30622
30790
|
if (context instanceof basic_1.DateType || context instanceof basic_1.TimeType || context instanceof basic_1.NumericType) {
|
|
30623
30791
|
return numericSubstringType(context, offset, length);
|
|
30624
30792
|
}
|
|
@@ -30644,6 +30812,30 @@ function substringType(context, offset, length, node, input) {
|
|
|
30644
30812
|
}
|
|
30645
30813
|
return context;
|
|
30646
30814
|
}
|
|
30815
|
+
function numericTypeName(context) {
|
|
30816
|
+
if (context instanceof basic_1.IntegerType) {
|
|
30817
|
+
return "I";
|
|
30818
|
+
}
|
|
30819
|
+
else if (context instanceof basic_1.Integer8Type) {
|
|
30820
|
+
return "INT8";
|
|
30821
|
+
}
|
|
30822
|
+
else if (context instanceof basic_1.PackedType) {
|
|
30823
|
+
return "P";
|
|
30824
|
+
}
|
|
30825
|
+
else if (context instanceof basic_1.FloatType || context instanceof basic_1.FloatingPointType) {
|
|
30826
|
+
return "F";
|
|
30827
|
+
}
|
|
30828
|
+
else if (context instanceof basic_1.DecFloat16Type) {
|
|
30829
|
+
return "DECFLOAT16";
|
|
30830
|
+
}
|
|
30831
|
+
else if (context instanceof basic_1.DecFloat34Type) {
|
|
30832
|
+
return "DECFLOAT34";
|
|
30833
|
+
}
|
|
30834
|
+
else if (context instanceof basic_1.DecFloatType) {
|
|
30835
|
+
return "DECFLOAT";
|
|
30836
|
+
}
|
|
30837
|
+
return undefined;
|
|
30838
|
+
}
|
|
30647
30839
|
function numericSubstringType(context, offset, length) {
|
|
30648
30840
|
const hasOffset = offset !== undefined && offset > 0;
|
|
30649
30841
|
const hasLength = length !== undefined && length > 0;
|
|
@@ -31783,6 +31975,7 @@ const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expr
|
|
|
31783
31975
|
const source_1 = __webpack_require__(/*! ./source */ "../core/build/src/abap/5_syntax/expressions/source.js");
|
|
31784
31976
|
const let_1 = __webpack_require__(/*! ./let */ "../core/build/src/abap/5_syntax/expressions/let.js");
|
|
31785
31977
|
const cond_1 = __webpack_require__(/*! ./cond */ "../core/build/src/abap/5_syntax/expressions/cond.js");
|
|
31978
|
+
const _raise_message_1 = __webpack_require__(/*! ../_raise_message */ "../core/build/src/abap/5_syntax/_raise_message.js");
|
|
31786
31979
|
class CondBody {
|
|
31787
31980
|
static runSyntax(node, input, targetType) {
|
|
31788
31981
|
if (node === undefined) {
|
|
@@ -31793,6 +31986,9 @@ class CondBody {
|
|
|
31793
31986
|
if (l) {
|
|
31794
31987
|
scoped = let_1.Let.runSyntax(l, input);
|
|
31795
31988
|
}
|
|
31989
|
+
for (const t of node.findDirectExpressions(Expressions.Throw)) {
|
|
31990
|
+
_raise_message_1.RaiseMessage.checkThrow(t, input);
|
|
31991
|
+
}
|
|
31796
31992
|
for (const s of node.findDirectExpressions(Expressions.Cond)) {
|
|
31797
31993
|
cond_1.Cond.runSyntax(s, input);
|
|
31798
31994
|
}
|
|
@@ -36433,8 +36629,9 @@ class Source {
|
|
|
36433
36629
|
/** The calculation type of an arithmetic expression is the most general of the
|
|
36434
36630
|
* operand types. An operand of type c, n, d, t or string is converted into it and
|
|
36435
36631
|
* never becomes the result: "lv_f * '0.25'" is a float, not a character field of
|
|
36436
|
-
* length four.
|
|
36437
|
-
*
|
|
36632
|
+
* length four. Date and time operands count as numbers of days and seconds, type i:
|
|
36633
|
+
* "lv_end - lv_start" is a number of days, not a date. Returns undefined when neither
|
|
36634
|
+
* operand is numeric, leaving the decision to the caller. */
|
|
36438
36635
|
static calculationType(left, right) {
|
|
36439
36636
|
if (left === undefined || right === undefined) {
|
|
36440
36637
|
return undefined;
|
|
@@ -36446,12 +36643,27 @@ class Source {
|
|
|
36446
36643
|
else if (right instanceof basic_1.VoidType || right instanceof unknown_type_1.UnknownType) {
|
|
36447
36644
|
return right;
|
|
36448
36645
|
}
|
|
36646
|
+
const dateOrTime = left instanceof basic_1.DateType || left instanceof basic_1.TimeType
|
|
36647
|
+
|| right instanceof basic_1.DateType || right instanceof basic_1.TimeType;
|
|
36648
|
+
if (left instanceof basic_1.DateType || left instanceof basic_1.TimeType) {
|
|
36649
|
+
left = basic_1.IntegerType.get();
|
|
36650
|
+
}
|
|
36651
|
+
if (right instanceof basic_1.DateType || right instanceof basic_1.TimeType) {
|
|
36652
|
+
right = basic_1.IntegerType.get();
|
|
36653
|
+
}
|
|
36449
36654
|
const leftRank = this.numericRank(left);
|
|
36450
36655
|
const rightRank = this.numericRank(right);
|
|
36451
36656
|
if (leftRank === undefined && rightRank === undefined) {
|
|
36452
36657
|
return undefined;
|
|
36453
36658
|
}
|
|
36454
|
-
|
|
36659
|
+
// a character-like operand next to a date or time counts as p: "lv_date + '5'" is p
|
|
36660
|
+
if (leftRank === undefined && this.isCharacterLike(left) && dateOrTime) {
|
|
36661
|
+
return rightRank >= 3 ? right : new basic_1.PackedType(8, 0);
|
|
36662
|
+
}
|
|
36663
|
+
else if (rightRank === undefined && this.isCharacterLike(right) && dateOrTime) {
|
|
36664
|
+
return leftRank >= 3 ? left : new basic_1.PackedType(8, 0);
|
|
36665
|
+
}
|
|
36666
|
+
if (rightRank === undefined) {
|
|
36455
36667
|
return left;
|
|
36456
36668
|
}
|
|
36457
36669
|
else if (leftRank === undefined) {
|
|
@@ -36459,6 +36671,9 @@ class Source {
|
|
|
36459
36671
|
}
|
|
36460
36672
|
return leftRank >= rightRank ? left : right;
|
|
36461
36673
|
}
|
|
36674
|
+
static isCharacterLike(type) {
|
|
36675
|
+
return type instanceof basic_1.CharacterType || type instanceof basic_1.NumericType || type instanceof basic_1.StringType;
|
|
36676
|
+
}
|
|
36462
36677
|
static numericRank(type) {
|
|
36463
36678
|
if (type instanceof basic_1.DecFloat34Type) {
|
|
36464
36679
|
return 6;
|
|
@@ -37366,6 +37581,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
37366
37581
|
exports.SwitchBody = void 0;
|
|
37367
37582
|
const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
|
|
37368
37583
|
const source_1 = __webpack_require__(/*! ./source */ "../core/build/src/abap/5_syntax/expressions/source.js");
|
|
37584
|
+
const _raise_message_1 = __webpack_require__(/*! ../_raise_message */ "../core/build/src/abap/5_syntax/_raise_message.js");
|
|
37369
37585
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
37370
37586
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/abap/types/basic/index.js");
|
|
37371
37587
|
class SwitchBody {
|
|
@@ -37373,6 +37589,9 @@ class SwitchBody {
|
|
|
37373
37589
|
if (node === undefined) {
|
|
37374
37590
|
return;
|
|
37375
37591
|
}
|
|
37592
|
+
for (const t of node.findDirectExpressions(Expressions.Throw)) {
|
|
37593
|
+
_raise_message_1.RaiseMessage.checkThrow(t, input);
|
|
37594
|
+
}
|
|
37376
37595
|
const thenSource = node.findExpressionAfterToken("THEN");
|
|
37377
37596
|
if (!((thenSource === null || thenSource === void 0 ? void 0 : thenSource.get()) instanceof Expressions.Source)) {
|
|
37378
37597
|
const message = "SwitchBody, unexpected";
|
|
@@ -45832,6 +46051,7 @@ const raise_with_1 = __webpack_require__(/*! ../expressions/raise_with */ "../co
|
|
|
45832
46051
|
const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "../core/build/src/abap/5_syntax/_object_oriented.js");
|
|
45833
46052
|
const method_parameters_1 = __webpack_require__(/*! ../expressions/method_parameters */ "../core/build/src/abap/5_syntax/expressions/method_parameters.js");
|
|
45834
46053
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
46054
|
+
const _raise_message_1 = __webpack_require__(/*! ../_raise_message */ "../core/build/src/abap/5_syntax/_raise_message.js");
|
|
45835
46055
|
class Raise {
|
|
45836
46056
|
runSyntax(node, input) {
|
|
45837
46057
|
// todo
|
|
@@ -45891,6 +46111,7 @@ class Raise {
|
|
|
45891
46111
|
if (param) {
|
|
45892
46112
|
new method_parameters_1.MethodParameters().checkExporting(param, input, method, true);
|
|
45893
46113
|
}
|
|
46114
|
+
_raise_message_1.RaiseMessage.checkRaise(node, input);
|
|
45894
46115
|
for (const s of node.findDirectExpressions(Expressions.RaiseWith)) {
|
|
45895
46116
|
raise_with_1.RaiseWith.runSyntax(s, input);
|
|
45896
46117
|
}
|
|
@@ -49878,6 +50099,107 @@ exports.Statics = Statics;
|
|
|
49878
50099
|
|
|
49879
50100
|
/***/ },
|
|
49880
50101
|
|
|
50102
|
+
/***/ "../core/build/src/abap/5_syntax/structures/try.js"
|
|
50103
|
+
/*!*********************************************************!*\
|
|
50104
|
+
!*** ../core/build/src/abap/5_syntax/structures/try.js ***!
|
|
50105
|
+
\*********************************************************/
|
|
50106
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
50107
|
+
|
|
50108
|
+
"use strict";
|
|
50109
|
+
|
|
50110
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
50111
|
+
if (k2 === undefined) k2 = k;
|
|
50112
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
50113
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
50114
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
50115
|
+
}
|
|
50116
|
+
Object.defineProperty(o, k2, desc);
|
|
50117
|
+
}) : (function(o, m, k, k2) {
|
|
50118
|
+
if (k2 === undefined) k2 = k;
|
|
50119
|
+
o[k2] = m[k];
|
|
50120
|
+
}));
|
|
50121
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
50122
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
50123
|
+
}) : function(o, v) {
|
|
50124
|
+
o["default"] = v;
|
|
50125
|
+
});
|
|
50126
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
50127
|
+
var ownKeys = function(o) {
|
|
50128
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
50129
|
+
var ar = [];
|
|
50130
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
50131
|
+
return ar;
|
|
50132
|
+
};
|
|
50133
|
+
return ownKeys(o);
|
|
50134
|
+
};
|
|
50135
|
+
return function (mod) {
|
|
50136
|
+
if (mod && mod.__esModule) return mod;
|
|
50137
|
+
var result = {};
|
|
50138
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
50139
|
+
__setModuleDefault(result, mod);
|
|
50140
|
+
return result;
|
|
50141
|
+
};
|
|
50142
|
+
})();
|
|
50143
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
50144
|
+
exports.Try = void 0;
|
|
50145
|
+
const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
|
|
50146
|
+
const Statements = __importStar(__webpack_require__(/*! ../../2_statements/statements */ "../core/build/src/abap/2_statements/statements/index.js"));
|
|
50147
|
+
const Structures = __importStar(__webpack_require__(/*! ../../3_structures/structures */ "../core/build/src/abap/3_structures/structures/index.js"));
|
|
50148
|
+
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
50149
|
+
// "special exceptions must be caught before general exceptions", a CATCH of a class that inherits
|
|
50150
|
+
// from a class named in an earlier CATCH of the same TRY can never be reached, this is a syntax error
|
|
50151
|
+
// only reported when the lineage of the later class is known up to the earlier class, void classes are skipped
|
|
50152
|
+
class Try {
|
|
50153
|
+
static runSyntax(node, input) {
|
|
50154
|
+
const caught = new Set();
|
|
50155
|
+
for (const catchStructure of node.findDirectStructures(Structures.Catch)) {
|
|
50156
|
+
const statement = catchStructure.findDirectStatement(Statements.Catch);
|
|
50157
|
+
if (statement === undefined) {
|
|
50158
|
+
continue;
|
|
50159
|
+
}
|
|
50160
|
+
const names = [];
|
|
50161
|
+
for (const c of statement.findDirectExpressions(Expressions.ClassName)) {
|
|
50162
|
+
const token = c.getFirstToken();
|
|
50163
|
+
const className = token.getStr().toUpperCase();
|
|
50164
|
+
names.push(className);
|
|
50165
|
+
if (caught.size === 0) {
|
|
50166
|
+
continue;
|
|
50167
|
+
}
|
|
50168
|
+
const superclass = this.findCaughtSuperclass(className, caught, input);
|
|
50169
|
+
if (superclass !== undefined) {
|
|
50170
|
+
const message = `CATCH of ${className} after the CATCH of its superclass ${superclass}`;
|
|
50171
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, message));
|
|
50172
|
+
return;
|
|
50173
|
+
}
|
|
50174
|
+
}
|
|
50175
|
+
for (const name of names) {
|
|
50176
|
+
caught.add(name);
|
|
50177
|
+
}
|
|
50178
|
+
}
|
|
50179
|
+
}
|
|
50180
|
+
static findCaughtSuperclass(className, caught, input) {
|
|
50181
|
+
var _a;
|
|
50182
|
+
const visited = new Set([className]);
|
|
50183
|
+
let current = input.scope.findClassDefinition(className);
|
|
50184
|
+
while (current !== undefined) {
|
|
50185
|
+
const superclass = (_a = current.getSuperClass()) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
|
50186
|
+
if (superclass === undefined || visited.has(superclass)) {
|
|
50187
|
+
return undefined;
|
|
50188
|
+
}
|
|
50189
|
+
else if (caught.has(superclass)) {
|
|
50190
|
+
return superclass;
|
|
50191
|
+
}
|
|
50192
|
+
visited.add(superclass);
|
|
50193
|
+
current = input.scope.findClassDefinition(superclass);
|
|
50194
|
+
}
|
|
50195
|
+
return undefined;
|
|
50196
|
+
}
|
|
50197
|
+
}
|
|
50198
|
+
exports.Try = Try;
|
|
50199
|
+
//# sourceMappingURL=try.js.map
|
|
50200
|
+
|
|
50201
|
+
/***/ },
|
|
50202
|
+
|
|
49881
50203
|
/***/ "../core/build/src/abap/5_syntax/structures/type_enum.js"
|
|
49882
50204
|
/*!***************************************************************!*\
|
|
49883
50205
|
!*** ../core/build/src/abap/5_syntax/structures/type_enum.js ***!
|
|
@@ -50285,6 +50607,7 @@ const types_1 = __webpack_require__(/*! ./structures/types */ "../core/build/src
|
|
|
50285
50607
|
const statics_1 = __webpack_require__(/*! ./structures/statics */ "../core/build/src/abap/5_syntax/structures/statics.js");
|
|
50286
50608
|
const constants_1 = __webpack_require__(/*! ./structures/constants */ "../core/build/src/abap/5_syntax/structures/constants.js");
|
|
50287
50609
|
const cleanup_1 = __webpack_require__(/*! ./structures/cleanup */ "../core/build/src/abap/5_syntax/structures/cleanup.js");
|
|
50610
|
+
const try_1 = __webpack_require__(/*! ./structures/try */ "../core/build/src/abap/5_syntax/structures/try.js");
|
|
50288
50611
|
const class_definition_1 = __webpack_require__(/*! ../types/class_definition */ "../core/build/src/abap/types/class_definition.js");
|
|
50289
50612
|
const interface_definition_1 = __webpack_require__(/*! ../types/interface_definition */ "../core/build/src/abap/types/interface_definition.js");
|
|
50290
50613
|
const delete_memory_1 = __webpack_require__(/*! ./statements/delete_memory */ "../core/build/src/abap/5_syntax/statements/delete_memory.js");
|
|
@@ -50770,6 +51093,9 @@ class SyntaxLogic {
|
|
|
50770
51093
|
else if (stru instanceof Structures.Cleanup) {
|
|
50771
51094
|
cleanup_1.Cleanup.runSyntax(node, input);
|
|
50772
51095
|
}
|
|
51096
|
+
else if (stru instanceof Structures.Try) {
|
|
51097
|
+
try_1.Try.runSyntax(node, input);
|
|
51098
|
+
}
|
|
50773
51099
|
return false;
|
|
50774
51100
|
}
|
|
50775
51101
|
updateScopeStatement(node) {
|
|
@@ -73230,7 +73556,7 @@ class Registry {
|
|
|
73230
73556
|
}
|
|
73231
73557
|
static abaplintVersion() {
|
|
73232
73558
|
// magic, see build script "version.js"
|
|
73233
|
-
return "2.120.
|
|
73559
|
+
return "2.120.101";
|
|
73234
73560
|
}
|
|
73235
73561
|
getDDICReferences() {
|
|
73236
73562
|
return this.ddicReferences;
|
|
@@ -90858,13 +91184,18 @@ class FullyTypeConstants extends _abap_rule_1.ABAPRule {
|
|
|
90858
91184
|
if ((stat.get() instanceof Statements.Constant
|
|
90859
91185
|
|| (this.conf.checkData === true && stat.get() instanceof Statements.Data))
|
|
90860
91186
|
&& !this.isTyped(stat)) {
|
|
91187
|
+
if (stat.get() instanceof Statements.Data && stat.findDirectExpression(expressions_1.DataDefinition) === undefined) {
|
|
91188
|
+
// unnamed field, eg. "DATA (10)." inside DATA BEGIN OF, cannot be typed
|
|
91189
|
+
continue;
|
|
91190
|
+
}
|
|
90861
91191
|
const type = stat.get() instanceof Statements.Constant ? "constant definition" : "data definition";
|
|
90862
91192
|
let token = (_a = stat.findFirstExpression(expressions_1.NamespaceSimpleName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
90863
91193
|
if (token === undefined) {
|
|
90864
91194
|
token = (_b = stat.findFirstExpression(expressions_1.DefinitionName)) === null || _b === void 0 ? void 0 : _b.getFirstToken();
|
|
90865
91195
|
}
|
|
90866
91196
|
if (token === undefined) {
|
|
90867
|
-
|
|
91197
|
+
const start = stat.getFirstToken().getStart();
|
|
91198
|
+
throw new Error(`fully type constants: unexpected node, ${file.getFilename()}, row ${start.getRow()}, col ${start.getCol()}, statement "${stat.concatTokens()}"`);
|
|
90868
91199
|
}
|
|
90869
91200
|
issues.push(issue_1.Issue.atToken(file, token, this.getDescription(type), this.getMetadata().key, this.conf.severity));
|
|
90870
91201
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.120.
|
|
3
|
+
"version": "2.120.101",
|
|
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.101",
|
|
43
43
|
"@types/chai": "^4.3.20",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|
|
45
45
|
"@types/mocha": "^10.0.10",
|