@abaplint/core 2.101.4 → 2.101.5
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.
|
@@ -7,7 +7,6 @@ const source_1 = require("./source");
|
|
|
7
7
|
const _type_utils_1 = require("../_type_utils");
|
|
8
8
|
class StringTemplate {
|
|
9
9
|
runSyntax(node, scope, filename) {
|
|
10
|
-
var _a;
|
|
11
10
|
const typeUtils = new _type_utils_1.TypeUtils(scope);
|
|
12
11
|
for (const templateSource of node.findAllExpressions(Expressions.StringTemplateSource)) {
|
|
13
12
|
const s = templateSource.findDirectExpression(Expressions.Source);
|
|
@@ -18,9 +17,22 @@ class StringTemplate {
|
|
|
18
17
|
else if (typeUtils.isCharLike(type) === false && typeUtils.isHexLike(type) === false) {
|
|
19
18
|
throw new Error("Not character like, " + type.constructor.name);
|
|
20
19
|
}
|
|
21
|
-
|
|
20
|
+
const format = templateSource.findDirectExpression(Expressions.StringTemplateFormatting);
|
|
21
|
+
const formatConcat = format === null || format === void 0 ? void 0 : format.concatTokens();
|
|
22
|
+
for (const formatSource of (format === null || format === void 0 ? void 0 : format.findAllExpressions(Expressions.Source)) || []) {
|
|
22
23
|
new source_1.Source().runSyntax(formatSource, scope, filename);
|
|
23
24
|
}
|
|
25
|
+
if ((formatConcat === null || formatConcat === void 0 ? void 0 : formatConcat.includes("ALPHA = "))
|
|
26
|
+
&& !(type instanceof basic_1.UnknownType)
|
|
27
|
+
&& !(type instanceof basic_1.VoidType)
|
|
28
|
+
&& !(type instanceof basic_1.StringType)
|
|
29
|
+
&& !(type instanceof basic_1.CLikeType)
|
|
30
|
+
&& !(type instanceof basic_1.CharacterType)
|
|
31
|
+
&& !(type instanceof basic_1.NumericGenericType)
|
|
32
|
+
&& !(type instanceof basic_1.NumericType)
|
|
33
|
+
&& !(type instanceof basic_1.AnyType)) {
|
|
34
|
+
throw new Error("Cannot apply ALPHA to this type");
|
|
35
|
+
}
|
|
24
36
|
}
|
|
25
37
|
return new basic_1.StringType({ qualifiedName: "STRING" });
|
|
26
38
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -71,14 +71,18 @@ class ModifyOnlyOwnDBTables {
|
|
|
71
71
|
}
|
|
72
72
|
const concat = databaseTable.concatTokens().toUpperCase();
|
|
73
73
|
if (regExp.test(concat) === false) {
|
|
74
|
-
// must contain a ReferenceType.TableVoidReference
|
|
74
|
+
// must contain a ReferenceType.TableVoidReference or a ReferenceType.TableReference if its a dependency
|
|
75
75
|
if (spaghetti === undefined) {
|
|
76
76
|
spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;
|
|
77
77
|
}
|
|
78
78
|
const start = databaseTable.getFirstToken().getStart();
|
|
79
79
|
const scope = spaghetti.lookupPosition(start, file.getFilename());
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
80
|
+
const found1 = scope === null || scope === void 0 ? void 0 : scope.findTableVoidReference(start);
|
|
81
|
+
if (found1) {
|
|
82
|
+
output.push(issue_1.Issue.atStatement(file, s, this.getMetadata().title, this.getMetadata().key, this.getConfig().severity));
|
|
83
|
+
}
|
|
84
|
+
const found2 = scope === null || scope === void 0 ? void 0 : scope.findTableReference(start);
|
|
85
|
+
if (found2) {
|
|
82
86
|
output.push(issue_1.Issue.atStatement(file, s, this.getMetadata().title, this.getMetadata().key, this.getConfig().severity));
|
|
83
87
|
}
|
|
84
88
|
}
|