@abaplint/core 2.113.139 → 2.113.141
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/src/abap/2_statements/expressions/select_loop.js +1 -1
- package/build/src/abap/2_statements/expressions/sql_field.js +1 -2
- package/build/src/abap/2_statements/expressions/sql_field_list_loop.js +1 -1
- package/build/src/abap/2_statements/statements/ranges.js +1 -1
- package/build/src/abap/5_syntax/statements/ranges.js +1 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules_runner.js +5 -1
- package/build/src/utils/include_graph.js +11 -18
- package/package.json +2 -2
|
@@ -20,7 +20,7 @@ class SelectLoop extends combi_1.Expression {
|
|
|
20
20
|
const tab = (0, combi_1.seq)(_1.SQLIntoTable, (0, combi_1.alt)(pack, (0, combi_1.seq)(_1.SQLFrom, pack), (0, combi_1.seq)(pack, _1.SQLFrom)));
|
|
21
21
|
const packTab = (0, combi_1.seq)(pack, _1.SQLIntoTable);
|
|
22
22
|
const into = (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList);
|
|
23
|
-
const perm = (0, combi_1.per)(_1.SQLFrom, where, sql_up_to_1.SQLUpTo, sql_order_by_1.SQLOrderBy, sql_having_1.SQLHaving, _1.SQLClient, bypass, _1.SQLGroupBy, _1.SQLForAllEntries, (0, combi_1.alt)(tab,
|
|
23
|
+
const perm = (0, combi_1.per)(_1.SQLFrom, where, sql_up_to_1.SQLUpTo, sql_order_by_1.SQLOrderBy, sql_having_1.SQLHaving, _1.SQLClient, bypass, _1.SQLGroupBy, _1.SQLForAllEntries, (0, combi_1.alt)(tab, sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList, packTab));
|
|
24
24
|
const strict = (0, combi_1.seq)(_1.SQLFrom, (0, combi_1.ver)(version_1.Version.v750, sql_fields_loop_1.SQLFieldsLoop), (0, combi_1.optPrio)(_1.SQLForAllEntries), (0, combi_1.optPrio)((0, combi_1.seq)(where, (0, combi_1.optPrio)(sql_order_by_1.SQLOrderBy), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo))));
|
|
25
25
|
const aggr = (0, combi_1.seq)(_1.SQLAggregation, into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), _1.SQLFrom, where, _1.SQLGroupBy);
|
|
26
26
|
const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), sql_field_list_loop_1.SQLFieldListLoop, perm), strict, aggr), (0, combi_1.optPrio)(sql_hints_1.SQLHints));
|
|
@@ -6,11 +6,10 @@ const _1 = require(".");
|
|
|
6
6
|
const version_1 = require("../../../version");
|
|
7
7
|
const tokens_1 = require("../../1_lexer/tokens");
|
|
8
8
|
const sql_function_1 = require("./sql_function");
|
|
9
|
-
const simple_field_chain_1 = require("./simple_field_chain");
|
|
10
9
|
const sql_path_1 = require("./sql_path");
|
|
11
10
|
class SQLField extends combi_1.Expression {
|
|
12
11
|
getRunnable() {
|
|
13
|
-
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt),
|
|
12
|
+
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2));
|
|
14
13
|
const as = (0, combi_1.seq)("AS", _1.SQLAsName);
|
|
15
14
|
const field = (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLCase, sql_function_1.SQLFunction, sql_path_1.SQLPath, _1.SQLFieldName, abap, _1.Constant);
|
|
16
15
|
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))));
|
|
@@ -12,7 +12,7 @@ class SQLFieldListLoop extends combi_1.Expression {
|
|
|
12
12
|
const comma = (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp05, ","));
|
|
13
13
|
const as = (0, combi_1.seq)("AS", _1.SQLAsName);
|
|
14
14
|
const someField = (0, combi_1.seq)(_1.SQLField, comma);
|
|
15
|
-
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.
|
|
15
|
+
const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2));
|
|
16
16
|
const fieldList = (0, combi_1.seq)((0, combi_1.star)(someField), (0, combi_1.alt)(_1.SQLFieldName, abap, sql_path_1.SQLPath, _1.Constant), (0, combi_1.optPrio)(as), comma, (0, combi_1.star)(someField));
|
|
17
17
|
const fields = (0, combi_1.alt)("*", _1.Dynamic, fieldList);
|
|
18
18
|
return fields;
|
|
@@ -7,7 +7,7 @@ const version_1 = require("../../../version");
|
|
|
7
7
|
class Ranges {
|
|
8
8
|
getMatcher() {
|
|
9
9
|
const occurs = (0, combi_1.seq)("OCCURS", expressions_1.Source);
|
|
10
|
-
const ret = (0, combi_1.seq)("RANGES", expressions_1.
|
|
10
|
+
const ret = (0, combi_1.seq)("RANGES", expressions_1.DefinitionName, "FOR", expressions_1.SimpleFieldChain2, (0, combi_1.optPrio)(occurs), (0, combi_1.optPrio)(expressions_1.FieldLength));
|
|
11
11
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -9,7 +9,7 @@ const assert_error_1 = require("../assert_error");
|
|
|
9
9
|
class Ranges {
|
|
10
10
|
runSyntax(node, input) {
|
|
11
11
|
var _a;
|
|
12
|
-
const nameToken = (_a = node.findFirstExpression(Expressions.
|
|
12
|
+
const nameToken = (_a = node.findFirstExpression(Expressions.DefinitionName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
13
13
|
const typeExpression = node.findFirstExpression(Expressions.SimpleFieldChain2);
|
|
14
14
|
if (typeExpression === undefined) {
|
|
15
15
|
throw new assert_error_1.AssertError("Ranges, unexpected node");
|
package/build/src/registry.js
CHANGED
|
@@ -72,8 +72,9 @@ class RulesRunner {
|
|
|
72
72
|
}
|
|
73
73
|
(_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, "Initialize Rules");
|
|
74
74
|
for (const rule of rules) {
|
|
75
|
+
const start = Date.now();
|
|
75
76
|
if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {
|
|
76
|
-
process.stderr.write("Initializing rule " + rule.getMetadata().key
|
|
77
|
+
process.stderr.write("Initializing rule " + rule.getMetadata().key);
|
|
77
78
|
}
|
|
78
79
|
else {
|
|
79
80
|
(_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick("Initialize Rules - " + rule.getMetadata().key);
|
|
@@ -82,6 +83,9 @@ class RulesRunner {
|
|
|
82
83
|
throw new Error(rule.getMetadata().key + " missing initialize method");
|
|
83
84
|
}
|
|
84
85
|
rule.initialize(this.reg);
|
|
86
|
+
if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {
|
|
87
|
+
process.stderr.write(", " + (Date.now() - start) + "ms\n");
|
|
88
|
+
}
|
|
85
89
|
rulePerformance[rule.getMetadata().key] = 0;
|
|
86
90
|
}
|
|
87
91
|
(_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, "Finding Issues");
|
|
@@ -66,9 +66,6 @@ class IncludeGraph {
|
|
|
66
66
|
this.graph = new Graph();
|
|
67
67
|
this.build();
|
|
68
68
|
}
|
|
69
|
-
getIssues() {
|
|
70
|
-
return this.issues;
|
|
71
|
-
}
|
|
72
69
|
listMainForInclude(filename) {
|
|
73
70
|
const ret = [];
|
|
74
71
|
if (filename === undefined) {
|
|
@@ -88,6 +85,17 @@ class IncludeGraph {
|
|
|
88
85
|
ret.push(i);
|
|
89
86
|
}
|
|
90
87
|
}
|
|
88
|
+
const v = this.graph.findVertexByFilename(file.getFilename());
|
|
89
|
+
if (v !== undefined
|
|
90
|
+
&& v.include === true
|
|
91
|
+
&& this.listMainForInclude(v.filename).length === 0) {
|
|
92
|
+
const f = this.reg.getFileByName(v.filename);
|
|
93
|
+
if (f === undefined) {
|
|
94
|
+
throw new Error("findUnusedIncludes internal error");
|
|
95
|
+
}
|
|
96
|
+
const issue = issue_1.Issue.atPosition(f, new position_1.Position(1, 1), "INCLUDE not used anywhere", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);
|
|
97
|
+
ret.push(issue);
|
|
98
|
+
}
|
|
91
99
|
return ret;
|
|
92
100
|
}
|
|
93
101
|
///////////////////////////////
|
|
@@ -128,21 +136,6 @@ class IncludeGraph {
|
|
|
128
136
|
}
|
|
129
137
|
}
|
|
130
138
|
}
|
|
131
|
-
this.findUnusedIncludes();
|
|
132
|
-
}
|
|
133
|
-
findUnusedIncludes() {
|
|
134
|
-
for (const v of Object.values(this.graph.verticesFilenameIndex)) {
|
|
135
|
-
if (v.include === true) {
|
|
136
|
-
if (this.listMainForInclude(v.filename).length === 0) {
|
|
137
|
-
const f = this.reg.getFileByName(v.filename);
|
|
138
|
-
if (f === undefined) {
|
|
139
|
-
throw new Error("findUnusedIncludes internal error");
|
|
140
|
-
}
|
|
141
|
-
const issue = issue_1.Issue.atPosition(f, new position_1.Position(1, 1), "INCLUDE not used anywhere", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);
|
|
142
|
-
this.issues.push(issue);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
139
|
}
|
|
147
140
|
addVertices() {
|
|
148
141
|
for (const o of getABAPObjects(this.reg)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.113.
|
|
3
|
+
"version": "2.113.141",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@microsoft/api-extractor": "^7.52.8",
|
|
54
54
|
"@types/chai": "^4.3.20",
|
|
55
55
|
"@types/mocha": "^10.0.10",
|
|
56
|
-
"@types/node": "^24.0.
|
|
56
|
+
"@types/node": "^24.0.12",
|
|
57
57
|
"chai": "^4.5.0",
|
|
58
58
|
"eslint": "^9.30.1",
|
|
59
59
|
"mocha": "^11.7.1",
|