@abaplint/core 2.93.31 → 2.93.33
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.
|
@@ -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
|
@@ -1106,11 +1106,9 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
1106
1106
|
return undefined;
|
|
1107
1107
|
}
|
|
1108
1108
|
const fieldChain = (_b = (_a = high.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.FieldChain);
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
const tableExpression = fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getChildren()[1];
|
|
1113
|
-
if (!(tableExpression.get() instanceof Expressions.TableExpression)
|
|
1109
|
+
const tableExpression = fieldChain === null || fieldChain === void 0 ? void 0 : fieldChain.getLastChild();
|
|
1110
|
+
if (tableExpression === undefined
|
|
1111
|
+
|| !(tableExpression.get() instanceof Expressions.TableExpression)
|
|
1114
1112
|
|| !(tableExpression instanceof nodes_1.ExpressionNode)) {
|
|
1115
1113
|
return undefined;
|
|
1116
1114
|
}
|
|
@@ -1128,8 +1126,15 @@ LOOP AT ${groupTargetName}tab ${groupTarget}.`;
|
|
|
1128
1126
|
concat = concat.substring(0, concat.length - 2);
|
|
1129
1127
|
condition = `WITH KEY ${concat}`;
|
|
1130
1128
|
}
|
|
1129
|
+
let pre = "";
|
|
1130
|
+
for (const c of fieldChain.getChildren()) {
|
|
1131
|
+
if (c === tableExpression) {
|
|
1132
|
+
break;
|
|
1133
|
+
}
|
|
1134
|
+
pre += c.concatTokens();
|
|
1135
|
+
}
|
|
1131
1136
|
const fsTarget = high.findDirectExpression(Expressions.FSTarget);
|
|
1132
|
-
const code = `READ TABLE ${
|
|
1137
|
+
const code = `READ TABLE ${pre} ${condition} ASSIGNING ${fsTarget === null || fsTarget === void 0 ? void 0 : fsTarget.concatTokens()}.`;
|
|
1133
1138
|
const fix = edit_helper_1.EditHelper.replaceRange(lowFile, high.getFirstToken().getStart(), high.getLastToken().getEnd(), code);
|
|
1134
1139
|
return issue_1.Issue.atToken(lowFile, high.getFirstToken(), "Downport, ASSIGN table expr", this.getMetadata().key, this.conf.severity, fix);
|
|
1135
1140
|
}
|
|
@@ -1228,11 +1233,11 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
1228
1233
|
if (index === undefined) {
|
|
1229
1234
|
return undefined;
|
|
1230
1235
|
}
|
|
1231
|
-
let uniqueName = this.uniqueName(
|
|
1236
|
+
let uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
1232
1237
|
uniqueName = `<${uniqueName}>`;
|
|
1233
1238
|
const tName = target.concatTokens().split("[")[0];
|
|
1234
1239
|
const condition = this.tableCondition(tableExpression);
|
|
1235
|
-
const tabixBackup = this.uniqueName(
|
|
1240
|
+
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
1236
1241
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
1237
1242
|
// restore tabix before exeption
|
|
1238
1243
|
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.33",
|
|
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",
|