@abaplint/core 2.93.47 → 2.93.49
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/target.js +2 -2
- package/build/src/abap/5_syntax/_procedural.js +11 -3
- package/build/src/abap/5_syntax/expressions/target.js +7 -0
- package/build/src/abap/5_syntax/statements/append.js +2 -0
- package/build/src/abap/5_syntax/statements/loop.js +6 -0
- package/build/src/registry.js +1 -1
- package/package.json +2 -2
|
@@ -10,12 +10,12 @@ class Target extends combi_1.Expression {
|
|
|
10
10
|
getRunnable() {
|
|
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
|
-
const something = (0, combi_1.starPrio)((0, combi_1.altPrio)(attr, comp, _1.TableExpression));
|
|
13
|
+
const something = (0, combi_1.starPrio)((0, combi_1.altPrio)(dereference_1.Dereference, attr, comp, _1.TableExpression));
|
|
14
14
|
const cast = (0, combi_1.seq)((0, combi_1.altPrio)(_1.Cast, _1.NewObject), _1.Arrow, _1.FieldAll);
|
|
15
15
|
const clas = (0, combi_1.seq)(_1.ClassName, (0, combi_1.tok)(tokens_1.StaticArrow), attribute_name_1.AttributeName);
|
|
16
16
|
const start = (0, combi_1.altPrio)(cast, clas, _1.TargetField, _1.TargetFieldSymbol);
|
|
17
17
|
const fields = (0, combi_1.seq)((0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength));
|
|
18
|
-
const optional = (0, combi_1.altPrio)(_1.TableBody, fields
|
|
18
|
+
const optional = (0, combi_1.altPrio)(_1.TableBody, fields);
|
|
19
19
|
return (0, combi_1.altPrio)(_1.InlineData, _1.InlineFS, (0, combi_1.seq)(start, something, optional));
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -11,6 +11,7 @@ const objects_1 = require("../../objects");
|
|
|
11
11
|
const _typed_identifier_1 = require("../types/_typed_identifier");
|
|
12
12
|
const basic_1 = require("../types/basic");
|
|
13
13
|
const ddic_1 = require("../../ddic");
|
|
14
|
+
const _object_oriented_1 = require("./_object_oriented");
|
|
14
15
|
class Procedural {
|
|
15
16
|
constructor(reg, scope) {
|
|
16
17
|
this.scope = scope;
|
|
@@ -67,7 +68,7 @@ class Procedural {
|
|
|
67
68
|
return undefined;
|
|
68
69
|
}
|
|
69
70
|
findFunctionScope(obj, node, filename) {
|
|
70
|
-
var _a;
|
|
71
|
+
var _a, _b;
|
|
71
72
|
if (!(obj instanceof objects_1.FunctionGroup)) {
|
|
72
73
|
throw new Error("findFunctionScope, expected function group input");
|
|
73
74
|
}
|
|
@@ -87,8 +88,7 @@ class Procedural {
|
|
|
87
88
|
else {
|
|
88
89
|
found = ddic.lookup(param.type).type;
|
|
89
90
|
}
|
|
90
|
-
if (param.direction === types_1.FunctionModuleParameterDirection.tables
|
|
91
|
-
&& !(found instanceof basic_1.TableType)) {
|
|
91
|
+
if (param.direction === types_1.FunctionModuleParameterDirection.tables) {
|
|
92
92
|
found = new basic_1.TableType(found, { withHeader: true });
|
|
93
93
|
}
|
|
94
94
|
if (found instanceof basic_1.UnknownType && ((_a = param.type) === null || _a === void 0 ? void 0 : _a.includes("-"))) {
|
|
@@ -101,6 +101,14 @@ class Procedural {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
+
else if (found instanceof basic_1.UnknownType && ((_b = param.type) === null || _b === void 0 ? void 0 : _b.includes("=>"))) {
|
|
105
|
+
const [name, field] = param.type.split("=>");
|
|
106
|
+
const def = this.scope.findObjectDefinition(name);
|
|
107
|
+
const c = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(def, field);
|
|
108
|
+
if (c) {
|
|
109
|
+
found = c.getType();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
104
112
|
if (found instanceof basic_1.UnknownType && param.type) {
|
|
105
113
|
const f = ddic.lookupBuiltinType(param.type);
|
|
106
114
|
if (f) {
|
|
@@ -11,6 +11,7 @@ const attribute_name_1 = require("./attribute_name");
|
|
|
11
11
|
const field_offset_1 = require("./field_offset");
|
|
12
12
|
const _reference_1 = require("../_reference");
|
|
13
13
|
const table_expression_1 = require("./table_expression");
|
|
14
|
+
const expressions_1 = require("../../2_statements/expressions");
|
|
14
15
|
class Target {
|
|
15
16
|
runSyntax(node, scope, filename) {
|
|
16
17
|
const concat = node.concatTokens();
|
|
@@ -54,6 +55,12 @@ class Target {
|
|
|
54
55
|
throw new Error("Not a object reference, target");
|
|
55
56
|
}
|
|
56
57
|
}
|
|
58
|
+
else if (current.get() instanceof expressions_1.Dereference) {
|
|
59
|
+
if (!(context instanceof basic_1.DataReference)) {
|
|
60
|
+
throw new Error("Not a object reference, target");
|
|
61
|
+
}
|
|
62
|
+
context = context.getType();
|
|
63
|
+
}
|
|
57
64
|
else if (current.get() instanceof Expressions.ComponentName) {
|
|
58
65
|
context = new component_name_1.ComponentName().runSyntax(context, current);
|
|
59
66
|
}
|
|
@@ -7,6 +7,7 @@ const target_1 = require("../expressions/target");
|
|
|
7
7
|
const basic_1 = require("../../types/basic");
|
|
8
8
|
const fstarget_1 = require("../expressions/fstarget");
|
|
9
9
|
const inline_data_1 = require("../expressions/inline_data");
|
|
10
|
+
// todo: issue error for short APPEND if the source is without header line
|
|
10
11
|
class Append {
|
|
11
12
|
runSyntax(node, scope, filename) {
|
|
12
13
|
let targetType = undefined;
|
|
@@ -37,6 +38,7 @@ class Append {
|
|
|
37
38
|
if (source) {
|
|
38
39
|
if (targetType !== undefined
|
|
39
40
|
&& !(targetType instanceof basic_1.TableType)
|
|
41
|
+
&& dataTarget !== target
|
|
40
42
|
&& !(targetType instanceof basic_1.VoidType)) {
|
|
41
43
|
throw new Error("Append, target not a table type");
|
|
42
44
|
}
|
|
@@ -33,6 +33,12 @@ class Loop {
|
|
|
33
33
|
else if (sourceType instanceof basic_1.UnknownType) {
|
|
34
34
|
throw new Error("Loop, not a table type, " + sourceType.getError());
|
|
35
35
|
}
|
|
36
|
+
else if (sourceType instanceof basic_1.TableType
|
|
37
|
+
&& target === undefined
|
|
38
|
+
&& sourceType.isWithHeader() === false
|
|
39
|
+
&& node.getChildren().length === 4) {
|
|
40
|
+
throw new Error("Loop, no header line");
|
|
41
|
+
}
|
|
36
42
|
else if (!(sourceType instanceof basic_1.TableType)
|
|
37
43
|
&& !(sourceType instanceof basic_1.VoidType)
|
|
38
44
|
&& concat.startsWith("LOOP AT GROUP ") === false) {
|
package/build/src/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.93.
|
|
3
|
+
"version": "2.93.49",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@microsoft/api-extractor": "^7.33.4",
|
|
50
50
|
"@types/chai": "^4.3.3",
|
|
51
51
|
"@types/mocha": "^10.0.0",
|
|
52
|
-
"@types/node": "^18.11.
|
|
52
|
+
"@types/node": "^18.11.3",
|
|
53
53
|
"chai": "^4.3.6",
|
|
54
54
|
"eslint": "^8.25.0",
|
|
55
55
|
"mocha": "^10.1.0",
|