@abaplint/cli 2.113.135 → 2.113.137

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 +54 -9
  2. package/package.json +3 -3
package/build/cli.js CHANGED
@@ -6460,7 +6460,7 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
6460
6460
  class MessageClass extends combi_1.Expression {
6461
6461
  getRunnable() {
6462
6462
  // "&1" can be used for almost anything(field names, method names etc.) in macros
6463
- return (0, combi_1.seq)((0, combi_1.regex)(/^>?[\w\/]+#?@?\/?!?&?>?\$?\??<?$/), (0, combi_1.starPrio)((0, combi_1.tok)(tokens_1.Plus)), (0, combi_1.starPrio)((0, combi_1.tok)(tokens_1.PlusW)), (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.optPrio)((0, combi_1.regex)(/^\w+$/)))), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.DashW)));
6463
+ return (0, combi_1.seq)((0, combi_1.regex)(/^>?[\w\/]+#?@?\/?!?&?>?\$?\??<?§?~?$/), (0, combi_1.starPrio)((0, combi_1.tok)(tokens_1.Plus)), (0, combi_1.starPrio)((0, combi_1.tok)(tokens_1.PlusW)), (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.optPrio)((0, combi_1.regex)(/^\w+$/)))), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.DashW)));
6464
6464
  }
6465
6465
  }
6466
6466
  exports.MessageClass = MessageClass;
@@ -16101,7 +16101,7 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
16101
16101
  const transporting_fields_1 = __webpack_require__(/*! ../expressions/transporting_fields */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/transporting_fields.js");
16102
16102
  class ReadTable {
16103
16103
  getMatcher() {
16104
- const comparing = (0, combi_1.seq)("COMPARING", (0, combi_1.alt)((0, combi_1.plus)(expressions_1.FieldSub), expressions_1.Dynamic));
16104
+ const comparing = (0, combi_1.seq)("COMPARING", (0, combi_1.alt)((0, combi_1.plus)(expressions_1.FieldSub), (0, combi_1.plus)(expressions_1.Dynamic)));
16105
16105
  const index = (0, combi_1.seq)("INDEX", expressions_1.Source);
16106
16106
  const components = (0, combi_1.seq)((0, combi_1.alt)(expressions_1.Field, expressions_1.Dynamic), "COMPONENTS", expressions_1.ComponentCompareSimple);
16107
16107
  const key = (0, combi_1.seq)((0, combi_1.altPrio)("WITH KEY", "WITH TABLE KEY"), (0, combi_1.alt)(expressions_1.ComponentCompareSimple, components, (0, combi_1.seq)((0, combi_1.optPrio)("="), expressions_1.Source)));
@@ -23426,6 +23426,13 @@ class TypeUtils {
23426
23426
  }
23427
23427
  return ret;
23428
23428
  }
23429
+ isConvable(source, target) {
23430
+ if (source instanceof basic_1.TableType && target instanceof basic_1.TableType) {
23431
+ // table key conversion, eg DEFAULT to EMPTY
23432
+ return this.isAssignable(source.getRowType(), target.getRowType());
23433
+ }
23434
+ return this.isAssignable(source, target);
23435
+ }
23429
23436
  isCastable(_source, _target) {
23430
23437
  // todo
23431
23438
  return true;
@@ -28051,7 +28058,7 @@ class Source {
28051
28058
  {
28052
28059
  const foundType = this.determineType(node, input, targetType);
28053
28060
  const bodyType = conv_body_1.ConvBody.runSyntax(node.findDirectExpression(Expressions.ConvBody), input);
28054
- if (new _type_utils_1.TypeUtils(input.scope).isAssignable(foundType, bodyType) === false) {
28061
+ if (new _type_utils_1.TypeUtils(input.scope).isConvable(foundType, bodyType) === false) {
28055
28062
  const message = `CONV: Types not compatible, ${foundType === null || foundType === void 0 ? void 0 : foundType.constructor.name}, ${bodyType === null || bodyType === void 0 ? void 0 : bodyType.constructor.name}`;
28056
28063
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
28057
28064
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
@@ -54559,14 +54566,14 @@ class Registry {
54559
54566
  this.objects = {};
54560
54567
  this.objectsByType = {};
54561
54568
  this.dependencies = {};
54562
- this.conf = conf ? conf : config_1.Config.getDefault();
54569
+ this.setConfig(conf ? conf : config_1.Config.getDefault());
54563
54570
  this.ddicReferences = new ddic_references_1.DDICReferences();
54564
54571
  this.msagReferences = new msag_references_1.MSAGReferences();
54565
54572
  this.macroReferences = new macro_references_1.MacroReferences();
54566
54573
  }
54567
54574
  static abaplintVersion() {
54568
54575
  // magic, see build script "version.sh"
54569
- return "2.113.135";
54576
+ return "2.113.137";
54570
54577
  }
54571
54578
  getDDICReferences() {
54572
54579
  return this.ddicReferences;
@@ -54644,12 +54651,11 @@ class Registry {
54644
54651
  obj.setDirty();
54645
54652
  }
54646
54653
  this.conf = conf;
54654
+ this.errorNamespace = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, "i");
54647
54655
  return this;
54648
54656
  }
54649
54657
  inErrorNamespace(name) {
54650
- // todo: performance? cache regexp?
54651
- const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, "i");
54652
- return reg.test(name);
54658
+ return this.errorNamespace.test(name);
54653
54659
  }
54654
54660
  addFile(file) {
54655
54661
  return this.addFiles([file]);
@@ -77339,9 +77345,35 @@ const artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ "./node_m
77339
77345
  const _abap_object_1 = __webpack_require__(/*! ./objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
77340
77346
  const skip_logic_1 = __webpack_require__(/*! ./skip_logic */ "./node_modules/@abaplint/core/build/src/skip_logic.js");
77341
77347
  const excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ "./node_modules/@abaplint/core/build/src/utils/excludeHelper.js");
77348
+ class SyntaxPerformance {
77349
+ constructor() {
77350
+ this.results = [];
77351
+ }
77352
+ push(obj, runtime) {
77353
+ if (runtime < 100) {
77354
+ return;
77355
+ }
77356
+ this.results.push({
77357
+ runtime: runtime,
77358
+ name: obj.getType() + " " + obj.getName(),
77359
+ });
77360
+ }
77361
+ output() {
77362
+ const MAX = 10;
77363
+ this.results.sort((a, b) => { return b.runtime - a.runtime; });
77364
+ for (let i = 0; i < MAX; i++) {
77365
+ const row = this.results[i];
77366
+ if (row === undefined) {
77367
+ break;
77368
+ }
77369
+ process.stderr.write(`\t${row.runtime}ms\t${row.name}\n`);
77370
+ }
77371
+ }
77372
+ }
77342
77373
  class RulesRunner {
77343
77374
  constructor(reg) {
77344
77375
  this.reg = reg;
77376
+ this.syntaxPerformance = new SyntaxPerformance();
77345
77377
  }
77346
77378
  objectsToCheck(objects) {
77347
77379
  const check = [];
@@ -77366,12 +77398,25 @@ class RulesRunner {
77366
77398
  for (const obj of check) {
77367
77399
  (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick("Run Syntax - " + obj.getName());
77368
77400
  if (obj instanceof _abap_object_1.ABAPObject) {
77401
+ const start = Date.now();
77369
77402
  new syntax_1.SyntaxLogic(this.reg, obj).run();
77403
+ if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {
77404
+ this.syntaxPerformance.push(obj, Date.now() - start);
77405
+ }
77370
77406
  }
77371
77407
  }
77408
+ if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {
77409
+ process.stderr.write("Syntax Performance:\n");
77410
+ this.syntaxPerformance.output();
77411
+ }
77372
77412
  (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, "Initialize Rules");
77373
77413
  for (const rule of rules) {
77374
- (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick("Initialize Rules - " + rule.getMetadata().key);
77414
+ if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {
77415
+ process.stderr.write("Initializing rule " + rule.getMetadata().key + "\n");
77416
+ }
77417
+ else {
77418
+ (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick("Initialize Rules - " + rule.getMetadata().key);
77419
+ }
77375
77420
  if (rule.initialize === undefined) {
77376
77421
  throw new Error(rule.getMetadata().key + " missing initialize method");
77377
77422
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.135",
3
+ "version": "2.113.137",
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.135",
41
+ "@abaplint/core": "^2.113.137",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",
@@ -47,7 +47,7 @@
47
47
  "chai": "^4.5.0",
48
48
  "p-limit": "^3.1.0",
49
49
  "chalk": "^5.4.1",
50
- "eslint": "^9.30.0",
50
+ "eslint": "^9.30.1",
51
51
  "glob": "^11.0.3",
52
52
  "json5": "^2.2.3",
53
53
  "memfs": "^4.17.2",