@abaplint/cli 2.113.136 → 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 +46 -8
  2. package/package.json +2 -2
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)));
@@ -54566,14 +54566,14 @@ class Registry {
54566
54566
  this.objects = {};
54567
54567
  this.objectsByType = {};
54568
54568
  this.dependencies = {};
54569
- this.conf = conf ? conf : config_1.Config.getDefault();
54569
+ this.setConfig(conf ? conf : config_1.Config.getDefault());
54570
54570
  this.ddicReferences = new ddic_references_1.DDICReferences();
54571
54571
  this.msagReferences = new msag_references_1.MSAGReferences();
54572
54572
  this.macroReferences = new macro_references_1.MacroReferences();
54573
54573
  }
54574
54574
  static abaplintVersion() {
54575
54575
  // magic, see build script "version.sh"
54576
- return "2.113.136";
54576
+ return "2.113.137";
54577
54577
  }
54578
54578
  getDDICReferences() {
54579
54579
  return this.ddicReferences;
@@ -54651,12 +54651,11 @@ class Registry {
54651
54651
  obj.setDirty();
54652
54652
  }
54653
54653
  this.conf = conf;
54654
+ this.errorNamespace = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, "i");
54654
54655
  return this;
54655
54656
  }
54656
54657
  inErrorNamespace(name) {
54657
- // todo: performance? cache regexp?
54658
- const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, "i");
54659
- return reg.test(name);
54658
+ return this.errorNamespace.test(name);
54660
54659
  }
54661
54660
  addFile(file) {
54662
54661
  return this.addFiles([file]);
@@ -77346,9 +77345,35 @@ const artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ "./node_m
77346
77345
  const _abap_object_1 = __webpack_require__(/*! ./objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
77347
77346
  const skip_logic_1 = __webpack_require__(/*! ./skip_logic */ "./node_modules/@abaplint/core/build/src/skip_logic.js");
77348
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
+ }
77349
77373
  class RulesRunner {
77350
77374
  constructor(reg) {
77351
77375
  this.reg = reg;
77376
+ this.syntaxPerformance = new SyntaxPerformance();
77352
77377
  }
77353
77378
  objectsToCheck(objects) {
77354
77379
  const check = [];
@@ -77373,12 +77398,25 @@ class RulesRunner {
77373
77398
  for (const obj of check) {
77374
77399
  (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick("Run Syntax - " + obj.getName());
77375
77400
  if (obj instanceof _abap_object_1.ABAPObject) {
77401
+ const start = Date.now();
77376
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
+ }
77377
77406
  }
77378
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
+ }
77379
77412
  (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, "Initialize Rules");
77380
77413
  for (const rule of rules) {
77381
- (_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
+ }
77382
77420
  if (rule.initialize === undefined) {
77383
77421
  throw new Error(rule.getMetadata().key + " missing initialize method");
77384
77422
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.136",
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.136",
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",