@abaplint/core 2.113.173 → 2.113.175
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/table_expression.js +1 -1
- package/build/src/abap/5_syntax/expressions/corresponding_body.js +5 -0
- package/build/src/abap/5_syntax/expressions/select.js +18 -11
- package/build/src/registry.js +1 -1
- package/build/src/rules/downport.js +3 -0
- package/build/src/rules/inline_data_old_versions.js +1 -0
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ class TableExpression extends combi_1.Expression {
|
|
|
11
11
|
const key = (0, combi_1.seq)("KEY", _1.SimpleName);
|
|
12
12
|
const index = (0, combi_1.seq)("INDEX", _1.Source);
|
|
13
13
|
const ret = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.BracketLeftW), (0, combi_1.alt)(_1.Source, (0, combi_1.seq)((0, combi_1.optPrio)(key), (0, combi_1.opt)("COMPONENTS"), (0, combi_1.altPrio)(fields, index))), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WBracketRight), (0, combi_1.tok)(tokens_1.WBracketRightW)));
|
|
14
|
-
return (0, combi_1.ver)(version_1.Version.v740sp02, ret);
|
|
14
|
+
return (0, combi_1.ver)(version_1.Version.v740sp02, ret, version_1.Version.OpenABAP);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
exports.TableExpression = TableExpression;
|
|
@@ -5,9 +5,14 @@ const Expressions = require("../../2_statements/expressions");
|
|
|
5
5
|
const source_1 = require("./source");
|
|
6
6
|
class CorrespondingBody {
|
|
7
7
|
static runSyntax(node, input, targetType) {
|
|
8
|
+
var _a;
|
|
8
9
|
if (node === undefined) {
|
|
9
10
|
return targetType;
|
|
10
11
|
}
|
|
12
|
+
const base = (_a = node.findDirectExpression(Expressions.CorrespondingBodyBase)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source);
|
|
13
|
+
if (base) {
|
|
14
|
+
source_1.Source.runSyntax(base, input);
|
|
15
|
+
}
|
|
11
16
|
let type = undefined;
|
|
12
17
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
13
18
|
if (type === undefined) {
|
|
@@ -34,8 +34,9 @@ class Select {
|
|
|
34
34
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
+
const isSingle = node.getChildren()[1].concatTokens().toUpperCase() === "SINGLE";
|
|
37
38
|
this.checkFields(fields, dbSources, input, node);
|
|
38
|
-
this.handleInto(node, input, fields, dbSources);
|
|
39
|
+
this.handleInto(node, input, fields, dbSources, isSingle);
|
|
39
40
|
const fae = node.findDirectExpression(Expressions.SQLForAllEntries);
|
|
40
41
|
if (fae) {
|
|
41
42
|
input.scope.push(_scope_type_1.ScopeType.OpenSQL, "SELECT", token.getStart(), input.filename);
|
|
@@ -135,7 +136,7 @@ class Select {
|
|
|
135
136
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
|
-
static handleInto(node, input, fields, dbSources) {
|
|
139
|
+
static handleInto(node, input, fields, dbSources, isSingle) {
|
|
139
140
|
const intoTable = node.findDirectExpression(Expressions.SQLIntoTable);
|
|
140
141
|
if (intoTable) {
|
|
141
142
|
const inline = intoTable.findFirstExpression(Expressions.InlineData);
|
|
@@ -145,9 +146,15 @@ class Select {
|
|
|
145
146
|
}
|
|
146
147
|
const intoStructure = node.findDirectExpression(Expressions.SQLIntoStructure);
|
|
147
148
|
if (intoStructure) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
inline_data_1.InlineData.runSyntax(
|
|
149
|
+
const inlineList = intoStructure.findAllExpressions(Expressions.InlineData);
|
|
150
|
+
if (inlineList.length === 1 && fields.length === 1 && dbSources.length === 1 && isSingle === false) {
|
|
151
|
+
inline_data_1.InlineData.runSyntax(inlineList[0], input, this.buildTableType(fields, dbSources, input.scope));
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
for (const inline of inlineList) {
|
|
155
|
+
// todo, for now these are voided
|
|
156
|
+
inline_data_1.InlineData.runSyntax(inline, input, basic_1.VoidType.get("SELECT_todo1"));
|
|
157
|
+
}
|
|
151
158
|
}
|
|
152
159
|
}
|
|
153
160
|
const intoList = node.findDirectExpression(Expressions.SQLIntoList);
|
|
@@ -169,7 +176,7 @@ class Select {
|
|
|
169
176
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
170
177
|
return;
|
|
171
178
|
}
|
|
172
|
-
let type = basic_1.VoidType.get("
|
|
179
|
+
let type = basic_1.VoidType.get("SELECT_todo2");
|
|
173
180
|
if (isSimple.test(field.code)) {
|
|
174
181
|
for (const dbSource of dbSources) {
|
|
175
182
|
if (dbSource === undefined) {
|
|
@@ -221,15 +228,15 @@ class Select {
|
|
|
221
228
|
}
|
|
222
229
|
static buildTableType(fields, dbSources, scope) {
|
|
223
230
|
if (dbSources.length !== 1) {
|
|
224
|
-
return basic_1.VoidType.get("
|
|
231
|
+
return basic_1.VoidType.get("SELECT_todo3");
|
|
225
232
|
}
|
|
226
233
|
if (dbSources[0] === undefined) {
|
|
227
234
|
// then its a voided table
|
|
228
|
-
return basic_1.VoidType.get("
|
|
235
|
+
return basic_1.VoidType.get("SELECT_todo4");
|
|
229
236
|
}
|
|
230
237
|
const dbType = dbSources[0].parseType(scope.getRegistry());
|
|
231
238
|
if (!(dbType instanceof basic_1.StructureType)) {
|
|
232
|
-
return basic_1.VoidType.get("
|
|
239
|
+
return basic_1.VoidType.get("SELECT_todo5");
|
|
233
240
|
}
|
|
234
241
|
if (fields.length === 1 && fields[0].code === "*") {
|
|
235
242
|
return new basic_1.TableType(dbType, { withHeader: false, keyType: basic_1.TableKeyType.default }, undefined);
|
|
@@ -240,13 +247,13 @@ class Select {
|
|
|
240
247
|
for (const field of fields) {
|
|
241
248
|
const type = dbType.getComponentByName(field.code);
|
|
242
249
|
if (type === undefined) {
|
|
243
|
-
return basic_1.VoidType.get("
|
|
250
|
+
return basic_1.VoidType.get("SELECT_todo6");
|
|
244
251
|
}
|
|
245
252
|
components.push({ name: field.code, type });
|
|
246
253
|
}
|
|
247
254
|
return new basic_1.TableType(new basic_1.StructureType(components), { withHeader: false, keyType: basic_1.TableKeyType.default }, undefined);
|
|
248
255
|
}
|
|
249
|
-
return basic_1.VoidType.get("
|
|
256
|
+
return basic_1.VoidType.get("SELECT_todo7");
|
|
250
257
|
}
|
|
251
258
|
static findFields(node, input) {
|
|
252
259
|
var _a, _b;
|
package/build/src/registry.js
CHANGED
|
@@ -2729,6 +2729,9 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
2729
2729
|
return false;
|
|
2730
2730
|
}
|
|
2731
2731
|
replaceXsdBool(node, lowFile, highSyntax) {
|
|
2732
|
+
if (this.lowReg.getConfig().getVersion() === version_1.Version.OpenABAP) {
|
|
2733
|
+
return undefined;
|
|
2734
|
+
}
|
|
2732
2735
|
const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());
|
|
2733
2736
|
for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {
|
|
2734
2737
|
if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference
|
|
@@ -32,6 +32,7 @@ class InlineDataOldVersions extends _abap_rule_1.ABAPRule {
|
|
|
32
32
|
runParsed(file) {
|
|
33
33
|
const issues = [];
|
|
34
34
|
if (this.reg.getConfig().getVersion() >= version_1.Version.v740sp02
|
|
35
|
+
|| this.reg.getConfig().getVersion() === version_1.Version.OpenABAP
|
|
35
36
|
|| this.reg.getConfig().getVersion() === version_1.Version.Cloud) {
|
|
36
37
|
return [];
|
|
37
38
|
}
|