@abaplint/core 2.102.29 → 2.102.31
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/statements/call_function.js +1 -1
- package/build/src/abap/5_syntax/_current_scope.js +7 -1
- package/build/src/abap/5_syntax/_type_utils.js +6 -0
- package/build/src/abap/5_syntax/statements/insert_internal.js +5 -1
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ class CallFunction {
|
|
|
10
10
|
const update = (0, combi_1.verNot)(version_1.Version.Cloud, (0, combi_1.str)("IN UPDATE TASK"));
|
|
11
11
|
const unit = (0, combi_1.seq)("UNIT", expressions_1.Source);
|
|
12
12
|
const background = (0, combi_1.verNot)(version_1.Version.Cloud, (0, combi_1.seq)("IN BACKGROUND", (0, combi_1.altPrio)("TASK", unit)));
|
|
13
|
-
const calling = (0, combi_1.seq)("CALLING", expressions_1.
|
|
13
|
+
const calling = (0, combi_1.seq)("CALLING", expressions_1.MethodSource, "ON END OF TASK");
|
|
14
14
|
const performing = (0, combi_1.seq)("PERFORMING", expressions_1.FormName, "ON END OF TASK");
|
|
15
15
|
const separate = (0, combi_1.str)("AS SEPARATE UNIT");
|
|
16
16
|
const keeping = (0, combi_1.str)("KEEPING LOGICAL UNIT OF WORK");
|
|
@@ -58,6 +58,9 @@ class CurrentScope {
|
|
|
58
58
|
if (this.current.getData().types[upper] !== undefined) {
|
|
59
59
|
throw new Error(`Type name "${name}" already defined`);
|
|
60
60
|
}
|
|
61
|
+
else if (this.isOO() && this.current.getData().vars[upper] !== undefined) {
|
|
62
|
+
throw new Error(`"${name}" already defined`);
|
|
63
|
+
}
|
|
61
64
|
this.current.getData().types[upper] = type;
|
|
62
65
|
}
|
|
63
66
|
addExtraLikeType(type) {
|
|
@@ -107,6 +110,9 @@ class CurrentScope {
|
|
|
107
110
|
if (this.current.getData().vars[upper] !== undefined) {
|
|
108
111
|
throw new Error(`Variable name "${name}" already defined`);
|
|
109
112
|
}
|
|
113
|
+
else if (this.isOO() && this.current.getData().types[upper] !== undefined) {
|
|
114
|
+
throw new Error(`"${name}" already defined`);
|
|
115
|
+
}
|
|
110
116
|
this.current.getData().vars[upper] = identifier;
|
|
111
117
|
}
|
|
112
118
|
addIdentifier(identifier) {
|
|
@@ -373,7 +379,7 @@ class CurrentScope {
|
|
|
373
379
|
while (curr !== undefined) {
|
|
374
380
|
const stype = curr.getIdentifier().stype;
|
|
375
381
|
if (stype === _scope_type_1.ScopeType.ClassDefinition
|
|
376
|
-
|| stype ===
|
|
382
|
+
// || stype === ScopeType.ClassImplementation
|
|
377
383
|
|| stype === _scope_type_1.ScopeType.Interface) {
|
|
378
384
|
return true;
|
|
379
385
|
}
|
|
@@ -4,6 +4,7 @@ exports.TypeUtils = void 0;
|
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const basic_1 = require("../types/basic");
|
|
6
6
|
const cgeneric_type_1 = require("../types/basic/cgeneric_type");
|
|
7
|
+
// todo: refactor to static? for performance
|
|
7
8
|
class TypeUtils {
|
|
8
9
|
constructor(scope) {
|
|
9
10
|
this.scope = scope;
|
|
@@ -298,6 +299,11 @@ class TypeUtils {
|
|
|
298
299
|
return false;
|
|
299
300
|
}
|
|
300
301
|
}
|
|
302
|
+
else if (source instanceof basic_1.IntegerType) {
|
|
303
|
+
if (target instanceof basic_1.StringType || target instanceof basic_1.Integer8Type) {
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
301
307
|
else if (source instanceof basic_1.FloatType) {
|
|
302
308
|
if (target instanceof basic_1.IntegerType) {
|
|
303
309
|
return false;
|
|
@@ -8,6 +8,7 @@ const target_1 = require("../expressions/target");
|
|
|
8
8
|
const fstarget_1 = require("../expressions/fstarget");
|
|
9
9
|
const basic_1 = require("../../types/basic");
|
|
10
10
|
const inline_data_1 = require("../expressions/inline_data");
|
|
11
|
+
const _type_utils_1 = require("../_type_utils");
|
|
11
12
|
class InsertInternal {
|
|
12
13
|
runSyntax(node, scope, filename) {
|
|
13
14
|
let targetType;
|
|
@@ -15,7 +16,7 @@ class InsertInternal {
|
|
|
15
16
|
if (t) {
|
|
16
17
|
targetType = new target_1.Target().runSyntax(t, scope, filename);
|
|
17
18
|
}
|
|
18
|
-
if (targetType instanceof basic_1.TableType) {
|
|
19
|
+
if (targetType instanceof basic_1.TableType && node.findDirectTokenByText("LINES") === undefined) {
|
|
19
20
|
targetType = targetType.getRowType();
|
|
20
21
|
}
|
|
21
22
|
let source = node.findDirectExpression(Expressions.SimpleSource4);
|
|
@@ -33,6 +34,9 @@ class InsertInternal {
|
|
|
33
34
|
new fstarget_1.FSTarget().runSyntax(afterAssigning, scope, filename, sourceType);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
37
|
+
if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType) === false) {
|
|
38
|
+
throw new Error("Types not compatible");
|
|
39
|
+
}
|
|
36
40
|
const afterInto = node.findExpressionAfterToken("INTO");
|
|
37
41
|
if ((afterInto === null || afterInto === void 0 ? void 0 : afterInto.get()) instanceof Expressions.Target && sourceType) {
|
|
38
42
|
const inline = afterInto.findDirectExpression(Expressions.InlineData);
|
package/build/src/registry.js
CHANGED