@abaplint/core 2.107.4 → 2.108.0

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.
@@ -6,9 +6,9 @@ const expressions_1 = require("../expressions");
6
6
  const version_1 = require("../../../version");
7
7
  class EditorCall {
8
8
  getMatcher() {
9
- const title = (0, combi_1.seq)("TITLE", expressions_1.Source);
9
+ const title = (0, combi_1.seq)("TITLE", expressions_1.SimpleSource3);
10
10
  const options = (0, combi_1.per)("DISPLAY-MODE", title);
11
- const ret = (0, combi_1.seq)("EDITOR-CALL FOR", (0, combi_1.opt)("REPORT"), expressions_1.Source, (0, combi_1.opt)(options));
11
+ const ret = (0, combi_1.seq)("EDITOR-CALL FOR", (0, combi_1.optPrio)("REPORT"), expressions_1.Source, (0, combi_1.optPrio)(options));
12
12
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
13
13
  }
14
14
  }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EditorCall = void 0;
4
+ const Expressions = require("../../2_statements/expressions");
5
+ const source_1 = require("../expressions/source");
6
+ class EditorCall {
7
+ runSyntax(node, scope, filename) {
8
+ for (const s of node.findDirectExpressions(Expressions.Source)) {
9
+ new source_1.Source().runSyntax(s, scope, filename);
10
+ }
11
+ for (const t of node.findDirectExpressions(Expressions.SimpleSource3)) {
12
+ new source_1.Source().runSyntax(t, scope, filename);
13
+ }
14
+ }
15
+ }
16
+ exports.EditorCall = EditorCall;
17
+ //# sourceMappingURL=editor_call.js.map
@@ -93,6 +93,7 @@ const close_dataset_1 = require("./statements/close_dataset");
93
93
  const get_run_time_1 = require("./statements/get_run_time");
94
94
  const update_database_1 = require("./statements/update_database");
95
95
  const add_1 = require("./statements/add");
96
+ const editor_call_1 = require("./statements/editor_call");
96
97
  const subtract_1 = require("./statements/subtract");
97
98
  const add_corresponding_1 = require("./statements/add_corresponding");
98
99
  const subtract_corresponding_1 = require("./statements/subtract_corresponding");
@@ -268,6 +269,7 @@ if (Object.keys(map).length === 0) {
268
269
  addToMap(new translate_1.Translate());
269
270
  addToMap(new modify_internal_1.ModifyInternal());
270
271
  addToMap(new read_textpool_1.ReadTextpool());
272
+ addToMap(new editor_call_1.EditorCall());
271
273
  }
272
274
  // -----------------------------------
273
275
  class SyntaxLogic {
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.107.4";
68
+ return "2.108.0";
69
69
  }
70
70
  getDDICReferences() {
71
71
  return this.ddicReferences;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlignPseudoComments = exports.AlignPseudoCommentsConf = void 0;
4
+ const _abap_rule_1 = require("./_abap_rule");
5
+ const _basic_rule_config_1 = require("./_basic_rule_config");
6
+ const _irule_1 = require("./_irule");
7
+ const issue_1 = require("../issue");
8
+ const _statement_1 = require("../abap/2_statements/statements/_statement");
9
+ class AlignPseudoCommentsConf extends _basic_rule_config_1.BasicRuleConfig {
10
+ }
11
+ exports.AlignPseudoCommentsConf = AlignPseudoCommentsConf;
12
+ class AlignPseudoComments extends _abap_rule_1.ABAPRule {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.conf = new AlignPseudoCommentsConf();
16
+ }
17
+ getMetadata() {
18
+ return {
19
+ key: "align_pseudo_comments",
20
+ title: "Align pseudo comments",
21
+ shortDescription: `Align code inspector pseudo comments in statements`,
22
+ tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],
23
+ badExample: `WRITE 'sdf'. "#EC sdf`,
24
+ goodExample: `WRITE 'sdf'. "#EC sdf`,
25
+ };
26
+ }
27
+ getConfig() {
28
+ return this.conf;
29
+ }
30
+ setConfig(conf) {
31
+ this.conf = conf;
32
+ }
33
+ runParsed(file) {
34
+ const issues = [];
35
+ let previousEnd = undefined;
36
+ for (const statement of file.getStatements()) {
37
+ if (!(statement.get() instanceof _statement_1.Comment)) {
38
+ previousEnd = statement.getLastToken().getEnd();
39
+ continue;
40
+ }
41
+ const commentLength = statement.concatTokens().length;
42
+ const firstCommentToken = statement.getFirstToken();
43
+ if (firstCommentToken.getStr().startsWith(`"#`) === false) {
44
+ continue;
45
+ }
46
+ else if (previousEnd === undefined) {
47
+ continue;
48
+ }
49
+ else if (commentLength > 10) {
50
+ const expectedColumn = 72 - commentLength + 1;
51
+ if (previousEnd.getCol() < expectedColumn && firstCommentToken.getStart().getCol() !== expectedColumn) {
52
+ const message = "Align pseudo comment to column " + expectedColumn;
53
+ issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));
54
+ }
55
+ }
56
+ else if (previousEnd.getCol() < 62 && firstCommentToken.getStart().getCol() !== 62) {
57
+ const message = "Align pseudo comment to column 62";
58
+ issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));
59
+ }
60
+ }
61
+ return issues;
62
+ }
63
+ }
64
+ exports.AlignPseudoComments = AlignPseudoComments;
65
+ //# sourceMappingURL=align_pseudo_comments.js.map
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./7bit_ascii"), exports);
18
18
  __exportStar(require("./abapdoc"), exports);
19
19
  __exportStar(require("./align_parameters"), exports);
20
+ __exportStar(require("./align_pseudo_comments"), exports);
20
21
  __exportStar(require("./align_type_expressions"), exports);
21
22
  __exportStar(require("./allowed_object_naming"), exports);
22
23
  __exportStar(require("./allowed_object_types"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.107.4",
3
+ "version": "2.108.0",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -50,10 +50,10 @@
50
50
  },
51
51
  "homepage": "https://abaplint.org",
52
52
  "devDependencies": {
53
- "@microsoft/api-extractor": "^7.43.1",
53
+ "@microsoft/api-extractor": "^7.43.2",
54
54
  "@types/chai": "^4.3.16",
55
55
  "@types/mocha": "^10.0.6",
56
- "@types/node": "^20.12.8",
56
+ "@types/node": "^20.12.10",
57
57
  "chai": "^4.4.1",
58
58
  "eslint": "^8.57.0",
59
59
  "mocha": "^10.4.0",