@abaplint/core 2.106.6 → 2.106.8
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.
|
@@ -11,9 +11,8 @@ class Target extends combi_1.Expression {
|
|
|
11
11
|
const attr = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.InstanceArrow), attribute_name_1.AttributeName);
|
|
12
12
|
const comp = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), _1.ComponentName);
|
|
13
13
|
const something = (0, combi_1.starPrio)((0, combi_1.altPrio)(dereference_1.Dereference, attr, comp, _1.TableExpression));
|
|
14
|
-
const cast = (0, combi_1.seq)((0, combi_1.altPrio)(_1.Cast, _1.NewObject), _1.Arrow, _1.FieldAll);
|
|
15
14
|
const clas = (0, combi_1.seq)(_1.ClassName, (0, combi_1.tok)(tokens_1.StaticArrow), attribute_name_1.AttributeName);
|
|
16
|
-
const start = (0, combi_1.altPrio)(
|
|
15
|
+
const start = (0, combi_1.altPrio)(_1.Cast, _1.NewObject, clas, _1.TargetField, _1.TargetFieldSymbol);
|
|
17
16
|
const fields = (0, combi_1.seq)((0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength));
|
|
18
17
|
const optional = (0, combi_1.altPrio)(_1.TableBody, fields);
|
|
19
18
|
return (0, combi_1.altPrio)(_1.InlineData, _1.InlineFS, (0, combi_1.seq)(start, something, optional));
|
|
@@ -13,6 +13,7 @@ const _reference_1 = require("../_reference");
|
|
|
13
13
|
const table_expression_1 = require("./table_expression");
|
|
14
14
|
const expressions_1 = require("../../2_statements/expressions");
|
|
15
15
|
const field_length_1 = require("./field_length");
|
|
16
|
+
const cast_1 = require("./cast");
|
|
16
17
|
class Target {
|
|
17
18
|
runSyntax(node, scope, filename) {
|
|
18
19
|
const concat = node.concatTokens();
|
|
@@ -144,6 +145,13 @@ class Target {
|
|
|
144
145
|
return new unknown_type_1.UnknownType(name + " unknown, Target");
|
|
145
146
|
}
|
|
146
147
|
}
|
|
148
|
+
else if (node.get() instanceof Expressions.Cast && node instanceof nodes_1.ExpressionNode) {
|
|
149
|
+
const ret = new cast_1.Cast().runSyntax(node, scope, undefined, filename);
|
|
150
|
+
if (ret instanceof unknown_type_1.UnknownType) {
|
|
151
|
+
throw new Error("CAST, uknown type");
|
|
152
|
+
}
|
|
153
|
+
return ret;
|
|
154
|
+
}
|
|
147
155
|
return new unknown_type_1.UnknownType("unknown target type");
|
|
148
156
|
}
|
|
149
157
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -70,6 +70,7 @@ Skips:
|
|
|
70
70
|
`,
|
|
71
71
|
tags: [],
|
|
72
72
|
pragma: "##CALLED",
|
|
73
|
+
pseudoComment: "EC CALLED",
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
76
|
getConfig() {
|
|
@@ -146,11 +147,32 @@ Skips:
|
|
|
146
147
|
if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {
|
|
147
148
|
continue;
|
|
148
149
|
}
|
|
150
|
+
else if (this.suppressedbyPseudo(statement, file)) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
149
153
|
const message = "Method \"" + i.identifier.getName() + "\" not used";
|
|
150
154
|
issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity));
|
|
151
155
|
}
|
|
152
156
|
return issues;
|
|
153
157
|
}
|
|
158
|
+
suppressedbyPseudo(statement, file) {
|
|
159
|
+
if (statement === undefined) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
if (file === undefined) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
let next = false;
|
|
166
|
+
for (const s of file.getStatements()) {
|
|
167
|
+
if (next === true && s.get() instanceof _statement_1.Comment) {
|
|
168
|
+
return s.concatTokens().includes(this.getMetadata().pseudoComment + "");
|
|
169
|
+
}
|
|
170
|
+
if (s === statement) {
|
|
171
|
+
next = true;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
154
176
|
searchGlobalSubclasses(obj) {
|
|
155
177
|
var _a, _b;
|
|
156
178
|
if (this.wa.getLength() === 0
|
|
@@ -59,6 +59,7 @@ class UnusedTypes {
|
|
|
59
59
|
extendedInformation: `Unused types are not reported if the object contains parser or syntax errors.`,
|
|
60
60
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
61
61
|
pragma: "##NEEDED",
|
|
62
|
+
pseudoComment: "EC NEEDED",
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
65
|
getConfig() {
|
|
@@ -126,11 +127,32 @@ class UnusedTypes {
|
|
|
126
127
|
if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {
|
|
127
128
|
continue;
|
|
128
129
|
}
|
|
130
|
+
else if (this.suppressedbyPseudo(statement, file)) {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
129
133
|
const fix = this.buildFix(file, statement);
|
|
130
134
|
ret.push(issue_1.Issue.atIdentifier(t, message, this.getMetadata().key, this.conf.severity, fix));
|
|
131
135
|
}
|
|
132
136
|
return ret;
|
|
133
137
|
}
|
|
138
|
+
suppressedbyPseudo(statement, file) {
|
|
139
|
+
if (statement === undefined) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
if (file === undefined) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
let next = false;
|
|
146
|
+
for (const s of file.getStatements()) {
|
|
147
|
+
if (next === true && s.get() instanceof _statement_1.Comment) {
|
|
148
|
+
return s.concatTokens().includes(this.getMetadata().pseudoComment + "");
|
|
149
|
+
}
|
|
150
|
+
if (s === statement) {
|
|
151
|
+
next = true;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
134
156
|
////////////////////////////
|
|
135
157
|
traverse(node, obj, add) {
|
|
136
158
|
if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {
|