@abaplint/core 2.113.213 → 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/abaplint.d.ts +1 -1
- package/build/src/abap/5_syntax/basic_types.js +1 -1
- 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/cds_determine_types.js +1 -1
- package/build/src/cds/expressions/cds_cast.js +1 -1
- package/build/src/cds/expressions/cds_condition.js +1 -1
- package/build/src/cds/expressions/cds_element.js +2 -2
- package/build/src/cds/expressions/cds_join.js +1 -1
- package/build/src/objects/data_definition.js +12 -10
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
package/build/abaplint.d.ts
CHANGED
|
@@ -6839,7 +6839,7 @@ declare class StructureType extends AbstractType {
|
|
|
6839
6839
|
private readonly indexed;
|
|
6840
6840
|
private readonly components;
|
|
6841
6841
|
constructor(components: IStructureComponent[], qualifiedName?: string, ddicName?: string, description?: string);
|
|
6842
|
-
getComponents(): IStructureComponent[];
|
|
6842
|
+
getComponents(): readonly IStructureComponent[];
|
|
6843
6843
|
getComponentByName(name: string): AbstractType | undefined;
|
|
6844
6844
|
toText(level: number): string;
|
|
6845
6845
|
isGeneric(): boolean;
|
|
@@ -579,7 +579,7 @@ class BasicTypes {
|
|
|
579
579
|
throw new Error("parseType, componentName expected");
|
|
580
580
|
}
|
|
581
581
|
if (found instanceof Types.StructureType) {
|
|
582
|
-
const newComponents = found.getComponents();
|
|
582
|
+
const newComponents = [...found.getComponents()];
|
|
583
583
|
newComponents.push({ name: componentName, type: Types.VoidType.get("INDICATORStodo") });
|
|
584
584
|
found = new Types.StructureType(newComponents, qualifiedName);
|
|
585
585
|
}
|
|
@@ -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;
|
|
@@ -37,7 +37,7 @@ class CDSDetermineTypes {
|
|
|
37
37
|
}
|
|
38
38
|
components.push({
|
|
39
39
|
name: f.name,
|
|
40
|
-
type: new basic_1.UnknownType("CDS parser error, unknown source, " + ddlsName),
|
|
40
|
+
type: new basic_1.UnknownType("CDS parser error, unknown source, " + f.name + ", " + ddlsName),
|
|
41
41
|
});
|
|
42
42
|
continue;
|
|
43
43
|
}
|
|
@@ -5,7 +5,7 @@ const _1 = require(".");
|
|
|
5
5
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
6
6
|
class CDSCast extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.
|
|
8
|
+
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.starPrio)((0, combi_1.seq)(".", _1.CDSName)));
|
|
9
9
|
return (0, combi_1.seq)("CAST", "(", (0, combi_1.altPrio)(_1.CDSFunction, _1.CDSCase, _1.CDSAggregate, _1.CDSArithmetics, CDSCast, _1.CDSString, name), "AS", _1.CDSType, (0, combi_1.optPrio)((0, combi_1.seq)("PRESERVING", "TYPE")), ")");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -6,7 +6,7 @@ const combi_1 = require("../../abap/2_statements/combi");
|
|
|
6
6
|
const cds_integer_1 = require("./cds_integer");
|
|
7
7
|
class CDSCondition extends combi_1.Expression {
|
|
8
8
|
getRunnable() {
|
|
9
|
-
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.
|
|
9
|
+
const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.starPrio)((0, combi_1.seq)(".", (0, combi_1.altPrio)(_1.CDSString, _1.CDSName))));
|
|
10
10
|
const left = (0, combi_1.altPrio)(_1.CDSString, _1.CDSFunction, _1.CDSAggregate, name);
|
|
11
11
|
const operators = (0, combi_1.altPrio)("=", (0, combi_1.seq)("!", "="), (0, combi_1.seq)("<", ">"), (0, combi_1.seq)(">", "="), (0, combi_1.seq)("<", "="), "<", ">", "LIKE", "NOT LIKE");
|
|
12
12
|
const compare = (0, combi_1.seq)(operators, (0, combi_1.altPrio)(left, cds_integer_1.CDSInteger));
|
|
@@ -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;
|
|
@@ -8,7 +8,7 @@ class CDSJoin extends combi_1.Expression {
|
|
|
8
8
|
getRunnable() {
|
|
9
9
|
const cond = (0, combi_1.seq)(_1.CDSSource, "ON", cds_condition_1.CDSCondition);
|
|
10
10
|
const foo = (0, combi_1.altPrio)((0, combi_1.seq)("(", cond, ")"), cond);
|
|
11
|
-
return (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("LEFT OUTER TO ONE", "LEFT OUTER", "INNER")), "JOIN", foo);
|
|
11
|
+
return (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("LEFT OUTER TO ONE", "LEFT OUTER", "INNER", "CROSS")), "JOIN", foo);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
exports.CDSJoin = CDSJoin;
|
|
@@ -128,7 +128,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
128
128
|
return undefined;
|
|
129
129
|
}
|
|
130
130
|
findFieldNames(tree) {
|
|
131
|
-
var _a, _b;
|
|
131
|
+
var _a, _b, _c;
|
|
132
132
|
let expr = tree.findFirstExpression(expressions_1.CDSSelect);
|
|
133
133
|
if (expr === undefined) {
|
|
134
134
|
expr = tree.findFirstExpression(expressions_1.CDSAnnotate);
|
|
@@ -140,14 +140,16 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
140
140
|
let prefix = "";
|
|
141
141
|
let found = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName);
|
|
142
142
|
if (found === undefined) {
|
|
143
|
-
const list = e.findAllExpressions(expressions_1.CDSName);
|
|
144
|
-
if (
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
const list = (_b = e.findDirectExpression(expressions_1.CDSPrefixedName)) === null || _b === void 0 ? void 0 : _b.findAllExpressions(expressions_1.CDSName);
|
|
144
|
+
if (list) {
|
|
145
|
+
if (e.concatTokens().toUpperCase().includes(" REDIRECTED TO ")) {
|
|
146
|
+
found = list[0];
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
found = list[list.length - 1];
|
|
150
|
+
if (list.length > 1) {
|
|
151
|
+
prefix = list[0].concatTokens();
|
|
152
|
+
}
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
155
|
}
|
|
@@ -155,7 +157,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
155
157
|
continue;
|
|
156
158
|
}
|
|
157
159
|
const name = found === null || found === void 0 ? void 0 : found.concatTokens();
|
|
158
|
-
if ((
|
|
160
|
+
if ((_c = this.parsedData) === null || _c === void 0 ? void 0 : _c.associations.some(a => { var _a; return a.name.toUpperCase() === name.toUpperCase() || ((_a = a.as) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === name.toUpperCase(); })) {
|
|
159
161
|
continue;
|
|
160
162
|
}
|
|
161
163
|
const annotations = [];
|
package/build/src/registry.js
CHANGED