@abaplint/core 2.119.66 → 2.119.67
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.
|
@@ -43,6 +43,7 @@ const source_1 = require("./source");
|
|
|
43
43
|
const _type_utils_1 = require("../_type_utils");
|
|
44
44
|
const _syntax_input_1 = require("../_syntax_input");
|
|
45
45
|
const constant_1 = require("./constant");
|
|
46
|
+
const _builtin_1 = require("../_builtin");
|
|
46
47
|
class MethodCallParam {
|
|
47
48
|
static runSyntax(node, input, method) {
|
|
48
49
|
if (!(node.get() instanceof Expressions.MethodCallParam)) {
|
|
@@ -103,6 +104,19 @@ class MethodCallParam {
|
|
|
103
104
|
let sourceType = undefined;
|
|
104
105
|
if (child.get() instanceof Expressions.Source) {
|
|
105
106
|
sourceType = source_1.Source.runSyntax(child, input, targetType);
|
|
107
|
+
const chain = child.findDirectExpression(Expressions.FieldChain);
|
|
108
|
+
const isCalculated = child.findDirectExpression(Expressions.Source) !== undefined;
|
|
109
|
+
const hasOffsetOrLength = chain !== undefined
|
|
110
|
+
&& isCalculated === false
|
|
111
|
+
&& (chain.findDirectExpression(Expressions.FieldOffset) !== undefined
|
|
112
|
+
|| chain.findDirectExpression(Expressions.FieldLength) !== undefined);
|
|
113
|
+
if (hasOffsetOrLength
|
|
114
|
+
&& !(method instanceof _builtin_1.BuiltInMethod)
|
|
115
|
+
&& (sourceType instanceof basic_1.StringType || sourceType instanceof basic_1.XStringType)) {
|
|
116
|
+
const message = `Offsets or lengths cannot be specified for fields of type "STRING" or "XSTRING" in the current statement`;
|
|
117
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, child.getFirstToken(), message));
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
106
120
|
}
|
|
107
121
|
else if (child.get() instanceof Expressions.ConstantString) {
|
|
108
122
|
sourceType = constant_1.Constant.runSyntax(child);
|
package/build/src/registry.js
CHANGED