@abaplint/cli 2.113.223 → 2.113.225

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.
Files changed (2) hide show
  1. package/build/cli.js +72 -24
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -6032,6 +6032,7 @@ __exportStar(__webpack_require__(/*! ./sql_arithmetic_operator */ "./node_module
6032
6032
  __exportStar(__webpack_require__(/*! ./sql_arithmetics */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetics.js"), exports);
6033
6033
  __exportStar(__webpack_require__(/*! ./sql_as_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_as_name.js"), exports);
6034
6034
  __exportStar(__webpack_require__(/*! ./sql_case */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_case.js"), exports);
6035
+ __exportStar(__webpack_require__(/*! ./sql_cast */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cast.js"), exports);
6035
6036
  __exportStar(__webpack_require__(/*! ./sql_cds_parameters */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cds_parameters.js"), exports);
6036
6037
  __exportStar(__webpack_require__(/*! ./sql_client */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_client.js"), exports);
6037
6038
  __exportStar(__webpack_require__(/*! ./sql_compare_operator */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_compare_operator.js"), exports);
@@ -8013,7 +8014,7 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src
8013
8014
  class SourceFieldSymbolChain extends combi_1.Expression {
8014
8015
  getRunnable() {
8015
8016
  const chain = (0, combi_1.seq)(new _1.ArrowOrDash(), _1.ComponentName);
8016
- return (0, combi_1.seq)(_1.FieldSymbol, (0, combi_1.starPrio)(chain));
8017
+ return (0, combi_1.seq)(_1.FieldSymbol, (0, combi_1.starPrio)(chain), (0, combi_1.optPrio)(_1.TableBody));
8017
8018
  }
8018
8019
  }
8019
8020
  exports.SourceFieldSymbolChain = SourceFieldSymbolChain;
@@ -8169,7 +8170,7 @@ class SQLCase extends combi_1.Expression {
8169
8170
  const abap = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2);
8170
8171
  const field = (0, combi_1.altPrio)(_1.SQLAggregation, SQLCase, _1.SQLFunction, _1.SQLPath, sql_field_name_1.SQLFieldName, constant_1.Constant);
8171
8172
  const sub = (0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), field, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
8172
- const sourc = (0, combi_1.altPrio)(SQLCase, _1.SQLAggregation, _1.SQLFunction, sql_source_1.SQLSource, constant_1.Constant);
8173
+ const sourc = (0, combi_1.altPrio)(SQLCase, _1.SQLAggregation, _1.SQLFunction, sql_field_name_1.SQLFieldName, sql_source_1.SQLSource, constant_1.Constant);
8173
8174
  const val = (0, combi_1.altPrio)(sql_cond_1.SQLCond, constant_1.Constant, abap);
8174
8175
  const when = (0, combi_1.seq)("WHEN", val, "THEN", sourc, (0, combi_1.starPrio)(sub));
8175
8176
  const els = (0, combi_1.seq)("ELSE", sourc);
@@ -8181,6 +8182,33 @@ exports.SQLCase = SQLCase;
8181
8182
 
8182
8183
  /***/ }),
8183
8184
 
8185
+ /***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cast.js":
8186
+ /*!*****************************************************************************************!*\
8187
+ !*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cast.js ***!
8188
+ \*****************************************************************************************/
8189
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8190
+
8191
+ "use strict";
8192
+
8193
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
8194
+ exports.SQLCast = void 0;
8195
+ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
8196
+ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
8197
+ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
8198
+ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
8199
+ const sql_field_name_1 = __webpack_require__(/*! ./sql_field_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_name.js");
8200
+ class SQLCast extends combi_1.Expression {
8201
+ getRunnable() {
8202
+ const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2), version_1.Version.OpenABAP);
8203
+ // todo: from version something
8204
+ return (0, combi_1.seq)("CAST", "(", (0, combi_1.opt)((0, combi_1.altPrio)(sql_field_name_1.SQLFieldName, abap)), "AS", sql_field_name_1.SQLFieldName, ")");
8205
+ }
8206
+ }
8207
+ exports.SQLCast = SQLCast;
8208
+ //# sourceMappingURL=sql_cast.js.map
8209
+
8210
+ /***/ }),
8211
+
8184
8212
  /***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cds_parameters.js":
8185
8213
  /*!***************************************************************************************************!*\
8186
8214
  !*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cds_parameters.js ***!
@@ -8335,7 +8363,8 @@ class SQLField extends combi_1.Expression {
8335
8363
  getRunnable() {
8336
8364
  const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2), version_1.Version.OpenABAP);
8337
8365
  const as = (0, combi_1.seq)("AS", _1.SQLAsName);
8338
- const field = (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLCase, sql_function_1.SQLFunction, sql_path_1.SQLPath, _1.SQLFieldName, abap, _1.Constant);
8366
+ const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFieldName, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.WParenRight)));
8367
+ const field = (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLCase, _1.SQLCast, sql_function_1.SQLFunction, sql_path_1.SQLPath, _1.SQLFieldName, abap, _1.Constant, paren);
8339
8368
  const sub = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), field, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW))));
8340
8369
  const arith = (0, combi_1.ver)(version_1.Version.v740sp05, sub);
8341
8370
  return (0, combi_1.seq)(field, (0, combi_1.optPrio)(arith), (0, combi_1.optPrio)(as));
@@ -8386,13 +8415,11 @@ exports.SQLFieldList = void 0;
8386
8415
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
8387
8416
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
8388
8417
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
8389
- const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
8390
8418
  class SQLFieldList extends combi_1.Expression {
8391
8419
  getRunnable() {
8392
- const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFieldName, (0, combi_1.tok)(tokens_1.WParenRightW));
8393
8420
  const nev = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.SQLField)), version_1.Version.OpenABAP);
8394
8421
  const old = (0, combi_1.starPrio)(_1.SQLField);
8395
- return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)), paren);
8422
+ return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)));
8396
8423
  }
8397
8424
  }
8398
8425
  exports.SQLFieldList = SQLFieldList;
@@ -13325,7 +13352,10 @@ class Field {
13325
13352
  const module = (0, combi_1.seq)("MODULE", expressions_1.FormName, (0, combi_1.opt)((0, combi_1.alt)("ON INPUT", "ON REQUEST", "ON CHAIN-REQUEST")));
13326
13353
  const values = (0, combi_1.seq)("VALUES", (0, combi_1.tok)(tokens_1.WParenLeft), "BETWEEN", expressions_1.Constant, "AND", expressions_1.Constant, (0, combi_1.tok)(tokens_1.ParenRightW));
13327
13354
  const wit = (0, combi_1.seq)("WITH", expressions_1.FieldChain);
13328
- const ret = (0, combi_1.seq)("FIELD", expressions_1.FieldChain, (0, combi_1.opt)((0, combi_1.altPrio)(module, values, wit)));
13355
+ const cond = (0, combi_1.seq)(expressions_1.FieldChain, "=", expressions_1.FieldChain);
13356
+ const where = (0, combi_1.seq)(cond, (0, combi_1.starPrio)((0, combi_1.seq)("AND", cond)));
13357
+ const select = (0, combi_1.seq)("SELECT * FROM", expressions_1.FieldChain, "WHERE", where, "INTO RESULT WHENEVER NOT FOUND SEND ERRORMESSAGE");
13358
+ const ret = (0, combi_1.seq)("FIELD", expressions_1.FieldChain, (0, combi_1.opt)((0, combi_1.altPrio)(module, values, wit, select)));
13329
13359
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
13330
13360
  }
13331
13361
  }
@@ -24486,10 +24516,10 @@ class BasicTypes {
24486
24516
  sub = node.findFirstExpression(Expressions.TypeParam);
24487
24517
  }
24488
24518
  if (sub === undefined) {
24489
- sub = node.findFirstExpression(Expressions.FieldChain);
24519
+ sub = node.findFirstExpression(Expressions.TypeName);
24490
24520
  }
24491
24521
  if (sub === undefined) {
24492
- sub = node.findFirstExpression(Expressions.TypeName);
24522
+ sub = node.findFirstExpression(Expressions.FieldChain);
24493
24523
  }
24494
24524
  found = this.resolveLikeName(sub);
24495
24525
  if (found && this.isOccurs(node)) {
@@ -29381,14 +29411,17 @@ class ValueBody {
29381
29411
  const fields = new Set();
29382
29412
  for (const s of node.findDirectExpressions(Expressions.FieldAssignment)) {
29383
29413
  field_assignment_1.FieldAssignment.runSyntax(s, input, targetType);
29384
- const fieldname = (_a = s.findDirectExpression(Expressions.FieldSub)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
29385
- if (fieldname) {
29386
- if (fields.has(fieldname)) {
29387
- const message = "Duplicate field assignment";
29388
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
29389
- return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
29414
+ if (node.findDirectExpression(Expressions.ValueBodyLine) === undefined) {
29415
+ // todo: refine, still needs to be checked when there are table lines
29416
+ const fieldname = (_a = s.findDirectExpression(Expressions.FieldSub)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
29417
+ if (fieldname) {
29418
+ if (fields.has(fieldname)) {
29419
+ const message = "Duplicate field assignment";
29420
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
29421
+ return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
29422
+ }
29423
+ fields.add(fieldname);
29390
29424
  }
29391
- fields.add(fieldname);
29392
29425
  }
29393
29426
  }
29394
29427
  let type = undefined; // todo, this is only correct if there is a single source in the body
@@ -33448,7 +33481,7 @@ class Parameter {
33448
33481
  }
33449
33482
  const magicName = "%_" + nameToken.getStr() + "_%_app_%";
33450
33483
  const magicToken = new tokens_1.Identifier(nameToken.getStart(), magicName);
33451
- input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, basic_1.VoidType.get("PARAMETER magic")));
33484
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, basic_1.VoidType.get("PARAMETER-MAGIC")));
33452
33485
  }
33453
33486
  }
33454
33487
  exports.Parameter = Parameter;
@@ -35408,6 +35441,8 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
35408
35441
  const Statements = __webpack_require__(/*! ../../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
35409
35442
  const Structures = __webpack_require__(/*! ../../3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
35410
35443
  const include_type_1 = __webpack_require__(/*! ../statements/include_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/include_type.js");
35444
+ const constant_1 = __webpack_require__(/*! ../statements/constant */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/constant.js");
35445
+ const constants_1 = __webpack_require__(/*! ./constants */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/constants.js");
35411
35446
  class Data {
35412
35447
  static runSyntax(node, input) {
35413
35448
  var _a;
@@ -35535,6 +35570,18 @@ class Data {
35535
35570
  input.scope.addType(found);
35536
35571
  }
35537
35572
  }
35573
+ else if (c instanceof nodes_1.StatementNode && ctyp instanceof Statements.Constant) {
35574
+ const found = new constant_1.Constant().runSyntax(c, input);
35575
+ if (found) {
35576
+ input.scope.addIdentifier(found);
35577
+ }
35578
+ }
35579
+ else if (c instanceof nodes_1.StructureNode && ctyp instanceof Structures.Constants) {
35580
+ const { type: found, values: _ } = new constants_1.Constants().runSyntax(c, input);
35581
+ if (found) {
35582
+ input.scope.addIdentifier(found);
35583
+ }
35584
+ }
35538
35585
  }
35539
35586
  }
35540
35587
  }
@@ -54559,7 +54606,7 @@ class Registry {
54559
54606
  }
54560
54607
  static abaplintVersion() {
54561
54608
  // magic, see build script "version.sh"
54562
- return "2.113.223";
54609
+ return "2.113.225";
54563
54610
  }
54564
54611
  getDDICReferences() {
54565
54612
  return this.ddicReferences;
@@ -57462,6 +57509,7 @@ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./
57462
57509
  const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
57463
57510
  const include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ "./node_modules/@abaplint/core/build/src/utils/include_graph.js");
57464
57511
  const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
57512
+ const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
57465
57513
  class CheckIncludeConf extends _basic_rule_config_1.BasicRuleConfig {
57466
57514
  }
57467
57515
  exports.CheckIncludeConf = CheckIncludeConf;
@@ -57477,7 +57525,8 @@ class CheckInclude {
57477
57525
  extendedInformation: `
57478
57526
  * Reports unused includes
57479
57527
  * Errors if the includes are not found
57480
- * Error if including a main program`,
57528
+ * Error if including a main program
57529
+ * Skips ZX* includes`,
57481
57530
  tags: [_irule_1.RuleTag.Syntax],
57482
57531
  };
57483
57532
  }
@@ -57496,6 +57545,9 @@ class CheckInclude {
57496
57545
  if (!(obj instanceof _abap_object_1.ABAPObject)) {
57497
57546
  return [];
57498
57547
  }
57548
+ if (obj instanceof objects_1.Program && obj.isInclude() === true && obj.getName().startsWith("ZX")) {
57549
+ return [];
57550
+ }
57499
57551
  let ret = [];
57500
57552
  for (const file of obj.getABAPFiles()) {
57501
57553
  ret = ret.concat(this.graph.getIssuesFile(file));
@@ -77840,11 +77892,7 @@ class SkipLogic {
77840
77892
  var _a;
77841
77893
  if (this.tobj === undefined) {
77842
77894
  this.tobj = {};
77843
- for (const obj of this.reg.getObjects()) {
77844
- if (obj.getType() !== "TOBJ") {
77845
- continue;
77846
- }
77847
- const tobj = obj;
77895
+ for (const tobj of this.reg.getObjectsByType("TOBJ")) {
77848
77896
  const area = (_a = tobj.getArea()) === null || _a === void 0 ? void 0 : _a.toUpperCase();
77849
77897
  if (area) {
77850
77898
  this.tobj[area] = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.223",
3
+ "version": "2.113.225",
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.223",
41
+ "@abaplint/core": "^2.113.225",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",