@abaplint/cli 2.120.59 → 2.120.60
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 +32 -9
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -6355,7 +6355,9 @@ const combi_1 = __webpack_require__(/*! ../combi */ "../core/build/src/abap/2_st
|
|
|
6355
6355
|
const _1 = __webpack_require__(/*! . */ "../core/build/src/abap/2_statements/expressions/index.js");
|
|
6356
6356
|
class MethodDefExceptions extends combi_1.Expression {
|
|
6357
6357
|
getRunnable() {
|
|
6358
|
-
|
|
6358
|
+
// parameter section keywords cannot be exception names
|
|
6359
|
+
const name = (0, combi_1.seq)((0, combi_1.stopBefore1)("IMPORTING", "EXPORTING", "CHANGING", "RETURNING", "RAISING", "EXCEPTIONS"), _1.NamespaceSimpleName);
|
|
6360
|
+
const exceptions = (0, combi_1.seq)("EXCEPTIONS", (0, combi_1.plusPrio)(name));
|
|
6359
6361
|
return exceptions;
|
|
6360
6362
|
}
|
|
6361
6363
|
}
|
|
@@ -6427,7 +6429,9 @@ const class_name_1 = __webpack_require__(/*! ./class_name */ "../core/build/src/
|
|
|
6427
6429
|
class MethodDefRaising extends combi_1.Expression {
|
|
6428
6430
|
getRunnable() {
|
|
6429
6431
|
const resumable = (0, combi_1.seq)("RESUMABLE", (0, combi_1.tok)(tokens_1.ParenLeft), class_name_1.ClassName, (0, combi_1.tok)(tokens_1.ParenRightW));
|
|
6430
|
-
|
|
6432
|
+
// parameter section keywords cannot be exception names
|
|
6433
|
+
const name = (0, combi_1.seq)((0, combi_1.stopBefore1)("IMPORTING", "EXPORTING", "CHANGING", "RETURNING", "RAISING", "EXCEPTIONS"), class_name_1.ClassName);
|
|
6434
|
+
const raising = (0, combi_1.seq)("RAISING", (0, combi_1.plus)((0, combi_1.altPrio)(resumable, name)));
|
|
6431
6435
|
return raising;
|
|
6432
6436
|
}
|
|
6433
6437
|
}
|
|
@@ -16731,7 +16735,7 @@ class MethodDef {
|
|
|
16731
16735
|
(0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY", (0, combi_1.opt)("IMPORTING"), (0, combi_1.plus)((0, combi_1.seq)(expressions_1.MethodParamName, modify))), (0, combi_1.seq)("PRECHECK IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("DETERMINATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("VALIDATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("NUMBERING IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, (0, combi_1.altPrio)(forRead, forfunction)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("GLOBAL FEATURES IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.seq)((0, combi_1.opt)("INSTANCE"), "AUTHORIZATION IMPORTING"), expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
|
|
16732
16736
|
// todo, this is only from version something
|
|
16733
16737
|
// AMDP OPTIONS clause blocked in KeyUser
|
|
16734
|
-
const amdp = (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("AMDP OPTIONS", (0, combi_1.
|
|
16738
|
+
const amdp = (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("AMDP OPTIONS", (0, combi_1.per)("READ-ONLY", (0, combi_1.seq)("CDS SESSION CLIENT", (0, combi_1.alt)("CURRENT", "DEPENDENT"))), (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising)));
|
|
16735
16739
|
// FOR DDL OBJECT / FOR TABLE FUNCTION / FOR SCALAR FUNCTION blocked in KeyUser
|
|
16736
16740
|
const regular = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), (0, combi_1.optPrio)(def), expressions_1.EventHandler), parameters, testing, (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("FOR", behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
|
|
16737
16741
|
// RAP event handlers are instance methods; CLASS-METHODS is not allowed.
|
|
@@ -16762,7 +16766,8 @@ class MethodImplementation {
|
|
|
16762
16766
|
const name = (0, combi_1.regex)(/[\w~]+/);
|
|
16763
16767
|
const kernel = (0, combi_1.seq)("KERNEL MODULE", (0, combi_1.plus)(name), (0, combi_1.optPrio)((0, combi_1.altPrio)("FAIL", "IGNORE")));
|
|
16764
16768
|
const using = (0, combi_1.seq)("USING", (0, combi_1.plus)(expressions_1.SimpleFieldChain));
|
|
16765
|
-
const
|
|
16769
|
+
const options = (0, combi_1.seq)("OPTIONS", (0, combi_1.per)("READ-ONLY", "SUPPRESS SYNTAX ERRORS", "DETERMINISTIC"));
|
|
16770
|
+
const database = (0, combi_1.seq)("DATABASE", (0, combi_1.alt)("PROCEDURE", "FUNCTION", "GRAPH WORKSPACE"), "FOR HDB", expressions_1.Language, (0, combi_1.opt)(options), (0, combi_1.opt)(using));
|
|
16766
16771
|
// BY DATABASE and BY KERNEL both blocked in KeyUser
|
|
16767
16772
|
const by = (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("BY", (0, combi_1.alt)(kernel, database)));
|
|
16768
16773
|
return (0, combi_1.seq)("METHOD", expressions_1.MethodName, (0, combi_1.optPrio)(by));
|
|
@@ -39453,10 +39458,22 @@ const basic_types_1 = __webpack_require__(/*! ../basic_types */ "../core/build/s
|
|
|
39453
39458
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/abap/types/basic/index.js");
|
|
39454
39459
|
const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "../core/build/src/abap/types/_typed_identifier.js");
|
|
39455
39460
|
const _reference_1 = __webpack_require__(/*! ../_reference */ "../core/build/src/abap/5_syntax/_reference.js");
|
|
39461
|
+
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
39456
39462
|
class CreateData {
|
|
39457
39463
|
runSyntax(node, input) {
|
|
39464
|
+
const likeLineOf = node.concatTokens().toUpperCase().includes(" LIKE LINE OF ");
|
|
39458
39465
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
39459
|
-
source_1.Source.runSyntax(s, input);
|
|
39466
|
+
const sourceType = source_1.Source.runSyntax(s, input);
|
|
39467
|
+
if (likeLineOf === true
|
|
39468
|
+
&& sourceType !== undefined
|
|
39469
|
+
&& !(sourceType instanceof basic_1.TableType)
|
|
39470
|
+
&& !(sourceType instanceof basic_1.VoidType)
|
|
39471
|
+
&& !(sourceType instanceof basic_1.UnknownType)
|
|
39472
|
+
&& !(sourceType instanceof basic_1.AnyType)) {
|
|
39473
|
+
const message = `"${s.concatTokens()}" is not an internal table`;
|
|
39474
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
39475
|
+
return;
|
|
39476
|
+
}
|
|
39460
39477
|
}
|
|
39461
39478
|
for (const t of node.findDirectExpressions(Expressions.Target)) {
|
|
39462
39479
|
target_1.Target.runSyntax(t, input);
|
|
@@ -39641,6 +39658,11 @@ class CreateObject {
|
|
|
39641
39658
|
ooName = found.getVoided();
|
|
39642
39659
|
}
|
|
39643
39660
|
input.scope.addReference(t === null || t === void 0 ? void 0 : t.getFirstToken(), cdef, _reference_1.ReferenceType.ConstructorReference, input.filename, { ooName: ooName });
|
|
39661
|
+
if (type && type.get() instanceof Expressions.Dynamic) {
|
|
39662
|
+
// the class is only known at runtime, cdef is the static type of the target
|
|
39663
|
+
this.validateParameters(undefined, node, input);
|
|
39664
|
+
return;
|
|
39665
|
+
}
|
|
39644
39666
|
if (cdef !== undefined) {
|
|
39645
39667
|
const err = CreateObject.checkInstantiationAllowed(cdef, input);
|
|
39646
39668
|
if (err) {
|
|
@@ -70690,7 +70712,7 @@ class Registry {
|
|
|
70690
70712
|
}
|
|
70691
70713
|
static abaplintVersion() {
|
|
70692
70714
|
// magic, see build script "version.js"
|
|
70693
|
-
return "2.120.
|
|
70715
|
+
return "2.120.60";
|
|
70694
70716
|
}
|
|
70695
70717
|
getDDICReferences() {
|
|
70696
70718
|
return this.ddicReferences;
|
|
@@ -71323,12 +71345,13 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
|
|
|
71323
71345
|
return issues;
|
|
71324
71346
|
}
|
|
71325
71347
|
getAbapdoc(rows, pos) {
|
|
71348
|
+
var _a, _b, _c;
|
|
71326
71349
|
let previousRow = pos.getRow() - 2;
|
|
71327
|
-
let rowText = rows[previousRow].trim().toUpperCase();
|
|
71350
|
+
let rowText = ((_a = rows[previousRow]) !== null && _a !== void 0 ? _a : "").trim().toUpperCase();
|
|
71328
71351
|
const text = [];
|
|
71329
71352
|
if (rowText === "METHODS" || rowText === "CLASS-METHODS") {
|
|
71330
71353
|
previousRow--;
|
|
71331
|
-
rowText = rows[previousRow].trim().toUpperCase();
|
|
71354
|
+
rowText = ((_b = rows[previousRow]) !== null && _b !== void 0 ? _b : "").trim().toUpperCase();
|
|
71332
71355
|
}
|
|
71333
71356
|
text.push(rowText);
|
|
71334
71357
|
//we need to push the first row despite if it is actually an abapdoc or not
|
|
@@ -71336,7 +71359,7 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
|
|
|
71336
71359
|
if (rowText.trim().substring(0, 2) === "\"!") {
|
|
71337
71360
|
while (previousRow >= 0) {
|
|
71338
71361
|
previousRow--;
|
|
71339
|
-
rowText = rows[previousRow].trim().toUpperCase();
|
|
71362
|
+
rowText = ((_c = rows[previousRow]) !== null && _c !== void 0 ? _c : "").trim().toUpperCase();
|
|
71340
71363
|
if (rowText.trim().substring(0, 2) !== "\"!") {
|
|
71341
71364
|
break;
|
|
71342
71365
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.120.
|
|
3
|
+
"version": "2.120.60",
|
|
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.60",
|
|
43
43
|
"@types/chai": "^4.3.20",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|
|
45
45
|
"@types/mocha": "^10.0.10",
|