@abaplint/core 2.113.214 → 2.113.215
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/field_chain.js +2 -2
- package/build/src/abap/5_syntax/expressions/select.js +8 -4
- package/build/src/abap/5_syntax/expressions/target.js +2 -2
- package/build/src/abap/5_syntax/statements/append.js +2 -2
- package/build/src/cds/expressions/cds_element.js +2 -2
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
|
@@ -108,13 +108,13 @@ class FieldChain {
|
|
|
108
108
|
}
|
|
109
109
|
else if (current instanceof nodes_1.ExpressionNode
|
|
110
110
|
&& current.get() instanceof Expressions.TableExpression) {
|
|
111
|
-
if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType)) {
|
|
111
|
+
if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType) && !(context instanceof basic_1.UnknownType)) {
|
|
112
112
|
const message = "Table expression, expected table";
|
|
113
113
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, current.getFirstToken(), message));
|
|
114
114
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
115
115
|
}
|
|
116
116
|
table_expression_1.TableExpression.runSyntax(current, input, context);
|
|
117
|
-
if (!(context instanceof basic_1.VoidType)) {
|
|
117
|
+
if (!(context instanceof basic_1.VoidType) && !(context instanceof basic_1.UnknownType)) {
|
|
118
118
|
context = context.getRowType();
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -17,9 +17,13 @@ const _syntax_input_1 = require("../_syntax_input");
|
|
|
17
17
|
const isSimple = /^\w+$/;
|
|
18
18
|
class Select {
|
|
19
19
|
static runSyntax(node, input, skipImplicitInto = false) {
|
|
20
|
-
var _a;
|
|
20
|
+
var _a, _b;
|
|
21
21
|
const token = node.getFirstToken();
|
|
22
|
-
|
|
22
|
+
let from = node.findDirectExpression(Expressions.SQLFrom);
|
|
23
|
+
if (from === undefined) {
|
|
24
|
+
// huh, sometimes the select expression is wrapped
|
|
25
|
+
from = node.findFirstExpression(Expressions.SQLFrom);
|
|
26
|
+
}
|
|
23
27
|
const dbSources = from ? sql_from_1.SQLFrom.runSyntax(from, input) : [];
|
|
24
28
|
if (from === undefined) {
|
|
25
29
|
const message = `Missing FROM`;
|
|
@@ -34,7 +38,7 @@ class Select {
|
|
|
34
38
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
35
39
|
return;
|
|
36
40
|
}
|
|
37
|
-
const isSingle = node.getChildren()[1].concatTokens().toUpperCase() === "SINGLE"
|
|
41
|
+
const isSingle = ((_a = node.getChildren()[1]) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase()) === "SINGLE"
|
|
38
42
|
|| node.get() instanceof Expressions.SelectLoop;
|
|
39
43
|
this.checkFields(fields, dbSources, input, node);
|
|
40
44
|
this.handleInto(node, input, fields, dbSources, isSingle);
|
|
@@ -51,7 +55,7 @@ class Select {
|
|
|
51
55
|
&& node.findDirectExpression(Expressions.SQLIntoTable) === undefined
|
|
52
56
|
&& node.findDirectExpression(Expressions.SQLIntoList) === undefined
|
|
53
57
|
&& node.findDirectExpression(Expressions.SQLIntoStructure) === undefined) {
|
|
54
|
-
const fields = (
|
|
58
|
+
const fields = (_b = node.findFirstExpression(Expressions.SQLAggregation)) === null || _b === void 0 ? void 0 : _b.concatTokens();
|
|
55
59
|
const c = new RegExp(/^count\(\s*\*\s*\)$/, "i");
|
|
56
60
|
if (fields === undefined || c.test(fields) === false) {
|
|
57
61
|
const nameToken = from === null || from === void 0 ? void 0 : from.findDirectExpression(Expressions.SQLFromSource);
|
|
@@ -96,13 +96,13 @@ class Target {
|
|
|
96
96
|
}
|
|
97
97
|
else if (current instanceof nodes_1.ExpressionNode
|
|
98
98
|
&& current.get() instanceof Expressions.TableExpression) {
|
|
99
|
-
if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType)) {
|
|
99
|
+
if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType) && !(context instanceof unknown_type_1.UnknownType)) {
|
|
100
100
|
const message = "Table expression, expected table";
|
|
101
101
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
102
102
|
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
103
103
|
}
|
|
104
104
|
table_expression_1.TableExpression.runSyntax(current, input, context);
|
|
105
|
-
if (!(context instanceof basic_1.VoidType)) {
|
|
105
|
+
if (!(context instanceof basic_1.VoidType) && !(context instanceof unknown_type_1.UnknownType)) {
|
|
106
106
|
context = context.getRowType();
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -19,7 +19,7 @@ class Append {
|
|
|
19
19
|
}
|
|
20
20
|
const fsTarget = node.findExpressionAfterToken("ASSIGNING");
|
|
21
21
|
if (fsTarget && fsTarget.get() instanceof Expressions.FSTarget) {
|
|
22
|
-
if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType)) {
|
|
22
|
+
if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType) && !(targetType instanceof basic_1.UnknownType)) {
|
|
23
23
|
const message = "APPEND to non table type, " + (targetType === null || targetType === void 0 ? void 0 : targetType.constructor.name);
|
|
24
24
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
25
25
|
return;
|
|
@@ -29,7 +29,7 @@ class Append {
|
|
|
29
29
|
}
|
|
30
30
|
const dataTarget = node.findExpressionAfterToken("INTO");
|
|
31
31
|
if (dataTarget && node.concatTokens().toUpperCase().includes(" REFERENCE INTO DATA(")) {
|
|
32
|
-
if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType)) {
|
|
32
|
+
if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType) && !(targetType instanceof basic_1.UnknownType)) {
|
|
33
33
|
const message = "APPEND to non table type, " + (targetType === null || targetType === void 0 ? void 0 : targetType.constructor.name);
|
|
34
34
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
35
35
|
return;
|
|
@@ -8,8 +8,8 @@ const cds_cast_1 = require("./cds_cast");
|
|
|
8
8
|
class CDSElement extends combi_1.Expression {
|
|
9
9
|
getRunnable() {
|
|
10
10
|
const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.opt)((0, combi_1.alt)("PARENT", "COMPOSITION CHILD")), _1.CDSName);
|
|
11
|
-
const colonThing = (0, combi_1.seq)(":", (0, combi_1.alt)(_1.CDSName, _1.CDSType));
|
|
12
|
-
return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.altPrio)("KEY", "VIRTUAL")), (0, combi_1.altPrio)(_1.CDSAggregate, _1.CDSString, _1.CDSArithmetics, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.opt)((0, combi_1.alt)(redirected, colonThing))), _1.CDSInteger), (0, combi_1.opt)(cds_as_1.CDSAs));
|
|
11
|
+
const colonThing = (0, combi_1.seq)(":", (0, combi_1.alt)(_1.CDSName, _1.CDSType, "LOCALIZED"));
|
|
12
|
+
return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.altPrio)("KEY", "VIRTUAL")), (0, combi_1.altPrio)(_1.CDSAggregate, _1.CDSString, _1.CDSArithmetics, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.opt)(cds_as_1.CDSAs), (0, combi_1.opt)((0, combi_1.alt)(redirected, colonThing))), _1.CDSInteger), (0, combi_1.opt)(cds_as_1.CDSAs));
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
exports.CDSElement = CDSElement;
|
package/build/src/registry.js
CHANGED