@abaplint/cli 2.120.29 → 2.120.31
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 +105 -14
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -3781,10 +3781,10 @@ exports.ClassName = ClassName;
|
|
|
3781
3781
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3782
3782
|
exports.Color = void 0;
|
|
3783
3783
|
const combi_1 = __webpack_require__(/*! ../combi */ "../core/build/src/abap/2_statements/combi.js");
|
|
3784
|
-
const
|
|
3784
|
+
const simple_source3_1 = __webpack_require__(/*! ./simple_source3 */ "../core/build/src/abap/2_statements/expressions/simple_source3.js");
|
|
3785
3785
|
class Color extends combi_1.Expression {
|
|
3786
3786
|
getRunnable() {
|
|
3787
|
-
const eq = (0, combi_1.seq)("=",
|
|
3787
|
+
const eq = (0, combi_1.seq)("=", simple_source3_1.SimpleSource3);
|
|
3788
3788
|
const integers = (0, combi_1.altPrio)("1", "2", "3", "4", "5", "6", "7");
|
|
3789
3789
|
const texts = (0, combi_1.altPrio)("COL_BACKGROUND", "COL_HEADING", "COL_NORMAL", "COL_TOTAL", "COL_KEY", "COL_POSITIVE", "COL_NEGATIVE", "COL_GROUP");
|
|
3790
3790
|
const value = (0, combi_1.alt)(eq, (0, combi_1.altPrio)("ON", "OFF", "COLOR OFF", (0, combi_1.altPrio)(integers, texts)));
|
|
@@ -28153,6 +28153,7 @@ const types_1 = __webpack_require__(/*! ../types */ "../core/build/src/abap/type
|
|
|
28153
28153
|
const expressions_1 = __webpack_require__(/*! ../2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js");
|
|
28154
28154
|
const _builtin_1 = __webpack_require__(/*! ./_builtin */ "../core/build/src/abap/5_syntax/_builtin.js");
|
|
28155
28155
|
const position_1 = __webpack_require__(/*! ../../position */ "../core/build/src/position.js");
|
|
28156
|
+
const _syntax_input_1 = __webpack_require__(/*! ./_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
28156
28157
|
class BasicTypes {
|
|
28157
28158
|
constructor(input) {
|
|
28158
28159
|
this.input = input;
|
|
@@ -29093,6 +29094,13 @@ class BasicTypes {
|
|
|
29093
29094
|
}
|
|
29094
29095
|
const chain = val.findFirstExpression(Expressions.SimpleFieldChain);
|
|
29095
29096
|
if (chain) {
|
|
29097
|
+
// todo, hardcoded for now, should be a generic check that the chain is a constant
|
|
29098
|
+
const concat = chain.concatTokens().toUpperCase();
|
|
29099
|
+
if (concat === "SY-DATUM" || concat === "SY-UZEIT") {
|
|
29100
|
+
const message = "VALUE, " + concat.toLowerCase() + " is not a constant";
|
|
29101
|
+
this.input.issues.push((0, _syntax_input_1.syntaxIssue)(this.input, chain.getFirstToken(), message));
|
|
29102
|
+
return undefined;
|
|
29103
|
+
}
|
|
29096
29104
|
return this.resolveConstantValue(chain);
|
|
29097
29105
|
}
|
|
29098
29106
|
throw new Error("findValue, unexpected");
|
|
@@ -31470,11 +31478,20 @@ class FormParam {
|
|
|
31470
31478
|
return new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, basic_1.AnyType.get(), ["form_parameter" /* IdentifierMeta.FormParameter */]);
|
|
31471
31479
|
}
|
|
31472
31480
|
let bfound = new basic_types_1.BasicTypes(input).parseType(node);
|
|
31473
|
-
const
|
|
31481
|
+
const typeName = (_c = node.findFirstExpression(expressions_1.TypeName)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();
|
|
31474
31482
|
const hasExplicitLength = node.findFirstExpression(expressions_1.Length) !== undefined
|
|
31475
31483
|
|| node.findFirstExpression(expressions_1.ConstantFieldLength) !== undefined;
|
|
31476
|
-
|
|
31477
|
-
|
|
31484
|
+
// the length cannot be specified for FORM parameters, so these types are generic
|
|
31485
|
+
if (hasExplicitLength === false) {
|
|
31486
|
+
if (typeName === "C" && bfound instanceof basic_1.CharacterType) {
|
|
31487
|
+
bfound = basic_1.CGenericType.get();
|
|
31488
|
+
}
|
|
31489
|
+
else if (typeName === "X" && bfound instanceof basic_1.HexType) {
|
|
31490
|
+
bfound = basic_1.XGenericType.get();
|
|
31491
|
+
}
|
|
31492
|
+
else if (typeName === "P" && bfound instanceof basic_1.PackedType) {
|
|
31493
|
+
bfound = basic_1.PGenericType.get();
|
|
31494
|
+
}
|
|
31478
31495
|
}
|
|
31479
31496
|
if (nameToken && bfound) {
|
|
31480
31497
|
return new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, bfound, ["form_parameter" /* IdentifierMeta.FormParameter */]);
|
|
@@ -40606,13 +40623,17 @@ const expressions_1 = __webpack_require__(/*! ../../2_statements/expressions */
|
|
|
40606
40623
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
40607
40624
|
class Form {
|
|
40608
40625
|
runSyntax(node, input) {
|
|
40609
|
-
|
|
40610
|
-
const name =
|
|
40611
|
-
if (name === undefined) {
|
|
40626
|
+
const nameExpression = node.findDirectExpression(expressions_1.FormName);
|
|
40627
|
+
const name = nameExpression === null || nameExpression === void 0 ? void 0 : nameExpression.concatTokens();
|
|
40628
|
+
if (nameExpression === undefined || name === undefined) {
|
|
40612
40629
|
const message = "Form, could not find name";
|
|
40613
40630
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
40614
40631
|
return;
|
|
40615
40632
|
}
|
|
40633
|
+
if (name.length > 30) {
|
|
40634
|
+
const message = "FORM name longer than 30 characters";
|
|
40635
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameExpression.getFirstToken(), message));
|
|
40636
|
+
}
|
|
40616
40637
|
input.scope.push(_scope_type_1.ScopeType.Form, name, node.getFirstToken().getStart(), input.filename);
|
|
40617
40638
|
const form = new form_definition_1.FormDefinition(node, input);
|
|
40618
40639
|
input.scope.addList(form.getUsingParameters());
|
|
@@ -40672,7 +40693,7 @@ const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expr
|
|
|
40672
40693
|
const source_1 = __webpack_require__(/*! ../expressions/source */ "../core/build/src/abap/5_syntax/expressions/source.js");
|
|
40673
40694
|
class Format {
|
|
40674
40695
|
runSyntax(node, input) {
|
|
40675
|
-
for (const s of node.
|
|
40696
|
+
for (const s of node.findAllExpressionsMulti([Expressions.Source, Expressions.SimpleSource3])) {
|
|
40676
40697
|
source_1.Source.runSyntax(s, input);
|
|
40677
40698
|
}
|
|
40678
40699
|
}
|
|
@@ -43497,6 +43518,16 @@ class Parameter {
|
|
|
43497
43518
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
43498
43519
|
return;
|
|
43499
43520
|
}
|
|
43521
|
+
const radioGroup = node.findFirstExpression(Expressions.RadioGroupName);
|
|
43522
|
+
if (radioGroup && radioGroup.concatTokens().length > 4) {
|
|
43523
|
+
const message = "Radio button group name too long, " + radioGroup.concatTokens();
|
|
43524
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, radioGroup.getFirstToken(), message));
|
|
43525
|
+
}
|
|
43526
|
+
if (this.hasUserCommand(node) && this.hasLength(node)) {
|
|
43527
|
+
const message = "USER-COMMAND and LENGTH not possible together";
|
|
43528
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
43529
|
+
return;
|
|
43530
|
+
}
|
|
43500
43531
|
const bfound = new basic_types_1.BasicTypes(input).parseType(node);
|
|
43501
43532
|
if (bfound) {
|
|
43502
43533
|
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, bfound));
|
|
@@ -43508,6 +43539,30 @@ class Parameter {
|
|
|
43508
43539
|
const magicToken = new tokens_1.Identifier(nameToken.getStart(), magicName);
|
|
43509
43540
|
input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, basic_1.VoidType.get("PARAMETER-MAGIC")));
|
|
43510
43541
|
}
|
|
43542
|
+
// "USER-COMMAND" is lexed as three tokens
|
|
43543
|
+
hasUserCommand(node) {
|
|
43544
|
+
const tokens = node.getTokens();
|
|
43545
|
+
for (let i = 0; i < tokens.length - 2; i++) {
|
|
43546
|
+
if (tokens[i].getStr().toUpperCase() === "USER"
|
|
43547
|
+
&& tokens[i + 1].getStr() === "-"
|
|
43548
|
+
&& tokens[i + 2].getStr().toUpperCase() === "COMMAND") {
|
|
43549
|
+
return true;
|
|
43550
|
+
}
|
|
43551
|
+
}
|
|
43552
|
+
return false;
|
|
43553
|
+
}
|
|
43554
|
+
// "VISIBLE LENGTH" is not the same as "LENGTH"
|
|
43555
|
+
hasLength(node) {
|
|
43556
|
+
var _a;
|
|
43557
|
+
const tokens = node.getTokens();
|
|
43558
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
43559
|
+
if (tokens[i].getStr().toUpperCase() === "LENGTH"
|
|
43560
|
+
&& ((_a = tokens[i - 1]) === null || _a === void 0 ? void 0 : _a.getStr().toUpperCase()) !== "VISIBLE") {
|
|
43561
|
+
return true;
|
|
43562
|
+
}
|
|
43563
|
+
}
|
|
43564
|
+
return false;
|
|
43565
|
+
}
|
|
43511
43566
|
}
|
|
43512
43567
|
exports.Parameter = Parameter;
|
|
43513
43568
|
//# sourceMappingURL=parameter.js.map
|
|
@@ -43565,6 +43620,7 @@ const target_1 = __webpack_require__(/*! ../expressions/target */ "../core/build
|
|
|
43565
43620
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
|
|
43566
43621
|
const assert_error_1 = __webpack_require__(/*! ../assert_error */ "../core/build/src/abap/5_syntax/assert_error.js");
|
|
43567
43622
|
const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "../core/build/src/abap/5_syntax/expressions/dynamic.js");
|
|
43623
|
+
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "../core/build/src/abap/5_syntax/_type_utils.js");
|
|
43568
43624
|
class Perform {
|
|
43569
43625
|
runSyntax(node, input) {
|
|
43570
43626
|
if (!(node.get() instanceof Statements.Perform)) {
|
|
@@ -43572,19 +43628,22 @@ class Perform {
|
|
|
43572
43628
|
}
|
|
43573
43629
|
////////////////////////////
|
|
43574
43630
|
// check parameters are defined
|
|
43631
|
+
const changing = [];
|
|
43575
43632
|
for (const c of node.findDirectExpressions(Expressions.PerformChanging)) {
|
|
43576
43633
|
for (const s of c.findDirectExpressions(Expressions.Target)) {
|
|
43577
|
-
target_1.Target.runSyntax(s, input);
|
|
43634
|
+
changing.push({ node: s, type: target_1.Target.runSyntax(s, input) });
|
|
43578
43635
|
}
|
|
43579
43636
|
}
|
|
43637
|
+
const tables = [];
|
|
43580
43638
|
for (const t of node.findDirectExpressions(Expressions.PerformTables)) {
|
|
43581
43639
|
for (const s of t.findDirectExpressions(Expressions.Source)) {
|
|
43582
|
-
source_1.Source.runSyntax(s, input);
|
|
43640
|
+
tables.push({ node: s, type: source_1.Source.runSyntax(s, input) });
|
|
43583
43641
|
}
|
|
43584
43642
|
}
|
|
43643
|
+
const using = [];
|
|
43585
43644
|
for (const u of node.findDirectExpressions(Expressions.PerformUsing)) {
|
|
43586
43645
|
for (const s of u.findDirectExpressions(Expressions.SimpleSource3)) {
|
|
43587
|
-
source_1.Source.runSyntax(s, input);
|
|
43646
|
+
using.push({ node: s, type: source_1.Source.runSyntax(s, input) });
|
|
43588
43647
|
}
|
|
43589
43648
|
}
|
|
43590
43649
|
////////////////////////////
|
|
@@ -43609,7 +43668,36 @@ class Perform {
|
|
|
43609
43668
|
return;
|
|
43610
43669
|
}
|
|
43611
43670
|
input.scope.addReference(expr.getFirstToken(), found, _reference_1.ReferenceType.FormReference, input.filename);
|
|
43612
|
-
|
|
43671
|
+
////////////////////////////
|
|
43672
|
+
// check parameters match
|
|
43673
|
+
// USING and CHANGING are interchangeable, the actual parameters form a single positional list
|
|
43674
|
+
if (this.checkParameters(node, tables, found.getTablesParameters(), "TABLES", input) === false) {
|
|
43675
|
+
return;
|
|
43676
|
+
}
|
|
43677
|
+
const formal = found.getUsingParameters().concat(found.getChangingParameters());
|
|
43678
|
+
this.checkParameters(node, using.concat(changing), formal, "USING/CHANGING", input);
|
|
43679
|
+
}
|
|
43680
|
+
// returns false if an issue was reported
|
|
43681
|
+
checkParameters(node, actual, formal, kind, input) {
|
|
43682
|
+
if (actual.length !== formal.length) {
|
|
43683
|
+
const message = `PERFORM, expected ${formal.length} ${kind} parameters, found ${actual.length}`;
|
|
43684
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
43685
|
+
return false;
|
|
43686
|
+
}
|
|
43687
|
+
const typeUtils = new _type_utils_1.TypeUtils(input.scope);
|
|
43688
|
+
for (let i = 0; i < actual.length; i++) {
|
|
43689
|
+
const { node: source, type } = actual[i];
|
|
43690
|
+
if (type === undefined) {
|
|
43691
|
+
continue;
|
|
43692
|
+
}
|
|
43693
|
+
const parameter = formal[i];
|
|
43694
|
+
if (typeUtils.isAssignableStrict(type, parameter.getType(), source) === false) {
|
|
43695
|
+
const message = `PERFORM parameter type not compatible, ${parameter.getName()}`;
|
|
43696
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, source.getFirstToken(), message));
|
|
43697
|
+
return false;
|
|
43698
|
+
}
|
|
43699
|
+
}
|
|
43700
|
+
return true;
|
|
43613
43701
|
}
|
|
43614
43702
|
}
|
|
43615
43703
|
exports.Perform = Perform;
|
|
@@ -69962,7 +70050,7 @@ class Registry {
|
|
|
69962
70050
|
}
|
|
69963
70051
|
static abaplintVersion() {
|
|
69964
70052
|
// magic, see build script "version.js"
|
|
69965
|
-
return "2.120.
|
|
70053
|
+
return "2.120.31";
|
|
69966
70054
|
}
|
|
69967
70055
|
getDDICReferences() {
|
|
69968
70056
|
return this.ddicReferences;
|
|
@@ -75401,6 +75489,7 @@ class CloudTypes {
|
|
|
75401
75489
|
|| obj instanceof Objects.BehaviorDefinition
|
|
75402
75490
|
|| obj instanceof Objects.BusinessCatalog
|
|
75403
75491
|
|| obj instanceof Objects.BusinessCatalogAppAssignment
|
|
75492
|
+
|| obj instanceof Objects.BusinessConfigurationMaintenanceObject
|
|
75404
75493
|
|| obj instanceof Objects.CDSMetadataExtension
|
|
75405
75494
|
|| obj instanceof Objects.Class
|
|
75406
75495
|
|| obj instanceof Objects.CDSType
|
|
@@ -75417,11 +75506,13 @@ class CloudTypes {
|
|
|
75417
75506
|
|| obj instanceof Objects.EventBinding
|
|
75418
75507
|
|| obj instanceof Objects.EventConsumer
|
|
75419
75508
|
|| obj instanceof Objects.FunctionGroup
|
|
75509
|
+
|| obj instanceof Objects.GatewayODataGroupAndAssignment
|
|
75420
75510
|
|| obj instanceof Objects.HttpService
|
|
75421
75511
|
|| obj instanceof Objects.IAMApp
|
|
75422
75512
|
|| obj instanceof Objects.InboundService
|
|
75423
75513
|
|| obj instanceof Objects.Interface
|
|
75424
75514
|
|| obj instanceof Objects.LockObject
|
|
75515
|
+
|| obj instanceof Objects.MaintenanceAndTransportObject
|
|
75425
75516
|
|| obj instanceof Objects.MessageClass
|
|
75426
75517
|
|| obj instanceof Objects.NumberRange
|
|
75427
75518
|
|| obj instanceof Objects.OutboundService
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.120.
|
|
3
|
+
"version": "2.120.31",
|
|
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.31",
|
|
43
43
|
"@types/chai": "^4.3.20",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|
|
45
45
|
"@types/mocha": "^10.0.10",
|