@abaplint/core 2.93.30 → 2.93.32
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/5_syntax/expressions/for.js +10 -2
- package/build/src/abap/5_syntax/expressions/inline_loop_definition.js +6 -1
- package/build/src/abap/5_syntax/expressions/let.js +4 -2
- package/build/src/abap/5_syntax/statements/get_reference.js +10 -4
- package/build/src/registry.js +1 -1
- package/build/src/rules/downport.js +2 -2
- package/package.json +3 -3
|
@@ -11,14 +11,19 @@ const cond_1 = require("./cond");
|
|
|
11
11
|
const basic_1 = require("../../types/basic");
|
|
12
12
|
const _typed_identifier_1 = require("../../types/_typed_identifier");
|
|
13
13
|
const _reference_1 = require("../_reference");
|
|
14
|
+
const let_1 = require("./let");
|
|
14
15
|
class For {
|
|
15
16
|
runSyntax(node, scope, filename) {
|
|
16
17
|
var _a;
|
|
17
18
|
let scoped = false;
|
|
18
19
|
const inlineLoop = node.findDirectExpressions(Expressions.InlineLoopDefinition);
|
|
19
|
-
const inlineField = node.
|
|
20
|
+
const inlineField = node.findDirectExpressions(Expressions.InlineFieldDefinition);
|
|
20
21
|
const groupsToken = (_a = node.findExpressionAfterToken("GROUPS")) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
21
|
-
const
|
|
22
|
+
const lett = node.findDirectExpression(Expressions.Let);
|
|
23
|
+
const addScope = inlineLoop.length > 0
|
|
24
|
+
|| inlineField.length > 0
|
|
25
|
+
|| lett !== undefined
|
|
26
|
+
|| groupsToken !== undefined;
|
|
22
27
|
if (addScope) {
|
|
23
28
|
// this scope is popped in parent expressions
|
|
24
29
|
scope.push(_scope_type_1.ScopeType.For, "FOR", node.getFirstToken().getStart(), filename);
|
|
@@ -45,6 +50,9 @@ class For {
|
|
|
45
50
|
for (const s of node.findDirectExpressions(Expressions.Cond)) {
|
|
46
51
|
new cond_1.Cond().runSyntax(s, scope, filename);
|
|
47
52
|
}
|
|
53
|
+
if (lett) {
|
|
54
|
+
new let_1.Let().runSyntax(lett, scope, filename, true);
|
|
55
|
+
}
|
|
48
56
|
return scoped;
|
|
49
57
|
}
|
|
50
58
|
}
|
|
@@ -28,7 +28,12 @@ class InlineLoopDefinition {
|
|
|
28
28
|
else if (sourceType instanceof basic_1.UnknownType) {
|
|
29
29
|
throw new Error("Unknown type, " + sourceType.getError());
|
|
30
30
|
}
|
|
31
|
-
if (rowType === undefined
|
|
31
|
+
if (rowType === undefined
|
|
32
|
+
&& node.concatTokens().toUpperCase().includes(" IN GROUP ")
|
|
33
|
+
&& sourceType !== undefined) {
|
|
34
|
+
rowType = sourceType;
|
|
35
|
+
}
|
|
36
|
+
else if (rowType === undefined) {
|
|
32
37
|
throw new Error("InlineLoopDefinition, not a table type");
|
|
33
38
|
}
|
|
34
39
|
const identifier = new _typed_identifier_1.TypedIdentifier(target.getFirstToken(), filename, rowType, ["inline" /* IdentifierMeta.InlineDefinition */]);
|
|
@@ -5,11 +5,13 @@ const Expressions = require("../../2_statements/expressions");
|
|
|
5
5
|
const inline_field_definition_1 = require("./inline_field_definition");
|
|
6
6
|
const _scope_type_1 = require("../_scope_type");
|
|
7
7
|
class Let {
|
|
8
|
-
runSyntax(node, scope, filename) {
|
|
8
|
+
runSyntax(node, scope, filename, skipScope = false) {
|
|
9
9
|
if (node === undefined) {
|
|
10
10
|
return false;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
if (skipScope !== true) {
|
|
13
|
+
scope.push(_scope_type_1.ScopeType.Let, "LET", node.getFirstToken().getStart(), filename);
|
|
14
|
+
}
|
|
13
15
|
for (const f of node.findDirectExpressions(Expressions.InlineFieldDefinition)) {
|
|
14
16
|
new inline_field_definition_1.InlineFieldDefinition().runSyntax(f, scope, filename);
|
|
15
17
|
}
|
|
@@ -4,13 +4,19 @@ exports.GetReference = void 0;
|
|
|
4
4
|
const Expressions = require("../../2_statements/expressions");
|
|
5
5
|
const source_1 = require("../expressions/source");
|
|
6
6
|
const target_1 = require("../expressions/target");
|
|
7
|
+
const inline_data_1 = require("../expressions/inline_data");
|
|
8
|
+
const basic_1 = require("../../types/basic");
|
|
7
9
|
class GetReference {
|
|
8
10
|
runSyntax(node, scope, filename) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
const s = node.findDirectExpression(Expressions.Source);
|
|
12
|
+
const type = new source_1.Source().runSyntax(s, scope, filename);
|
|
13
|
+
const target = node.findDirectExpression(Expressions.Target);
|
|
14
|
+
const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);
|
|
15
|
+
if (inline) {
|
|
16
|
+
new inline_data_1.InlineData().runSyntax(inline, scope, filename, type ? new basic_1.DataReference(type) : undefined);
|
|
11
17
|
}
|
|
12
|
-
|
|
13
|
-
new target_1.Target().runSyntax(
|
|
18
|
+
else if (target) {
|
|
19
|
+
new target_1.Target().runSyntax(target, scope, filename);
|
|
14
20
|
}
|
|
15
21
|
}
|
|
16
22
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -1228,11 +1228,11 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
1228
1228
|
if (index === undefined) {
|
|
1229
1229
|
return undefined;
|
|
1230
1230
|
}
|
|
1231
|
-
let uniqueName = this.uniqueName(
|
|
1231
|
+
let uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
1232
1232
|
uniqueName = `<${uniqueName}>`;
|
|
1233
1233
|
const tName = target.concatTokens().split("[")[0];
|
|
1234
1234
|
const condition = this.tableCondition(tableExpression);
|
|
1235
|
-
const tabixBackup = this.uniqueName(
|
|
1235
|
+
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
1236
1236
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
1237
1237
|
// restore tabix before exeption
|
|
1238
1238
|
const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.93.
|
|
3
|
+
"version": "2.93.32",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@microsoft/api-extractor": "^7.31.2",
|
|
50
50
|
"@types/chai": "^4.3.3",
|
|
51
|
-
"@types/mocha": "^
|
|
51
|
+
"@types/mocha": "^10.0.0",
|
|
52
52
|
"@types/node": "^18.7.23",
|
|
53
53
|
"chai": "^4.3.6",
|
|
54
54
|
"eslint": "^8.24.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"c8": "^7.12.0",
|
|
57
57
|
"source-map-support": "^0.5.21",
|
|
58
58
|
"ts-json-schema-generator": "^1.1.1",
|
|
59
|
-
"typescript": "^4.8.
|
|
59
|
+
"typescript": "^4.8.4"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"fast-xml-parser": "^4.0.10",
|