@abaplint/core 2.83.9 → 2.83.13
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 +3 -0
- package/build/src/abap/types/basic/decfloat16_type.js +1 -1
- package/build/src/abap/types/basic/decfloat34_type.js +1 -1
- package/build/src/abap/types/basic/string_type.js +1 -1
- package/build/src/abap/types/basic/utc_long_type.js +1 -1
- package/build/src/abap/types/basic/xstring_type.js +1 -1
- package/build/src/cds/cds_lexer.js +7 -2
- package/build/src/ddic.js +6 -15
- package/build/src/objects/data_definition.js +9 -0
- package/build/src/objects/table.js +8 -2
- package/build/src/registry.js +1 -1
- package/package.json +3 -3
package/build/abaplint.d.ts
CHANGED
|
@@ -1242,6 +1242,7 @@ declare class DataDefinition extends AbstractObject {
|
|
|
1242
1242
|
allowNamespace: boolean;
|
|
1243
1243
|
};
|
|
1244
1244
|
getSQLViewName(): string | undefined;
|
|
1245
|
+
getDefinitionName(): string | undefined;
|
|
1245
1246
|
getDescription(): string | undefined;
|
|
1246
1247
|
parseType(reg: IRegistry): AbstractType;
|
|
1247
1248
|
getParsedData(): ParsedDataDefinition | undefined;
|
|
@@ -4079,7 +4080,9 @@ declare class ParenRightW extends Token {
|
|
|
4079
4080
|
|
|
4080
4081
|
declare type ParsedDataDefinition = {
|
|
4081
4082
|
sqlViewName: string | undefined;
|
|
4083
|
+
definitionName: string | undefined;
|
|
4082
4084
|
fields: {
|
|
4085
|
+
key: boolean;
|
|
4083
4086
|
name: string;
|
|
4084
4087
|
annotations: string[];
|
|
4085
4088
|
}[];
|
|
@@ -71,7 +71,9 @@ class CDSLexer {
|
|
|
71
71
|
if (next === "\n") {
|
|
72
72
|
mode = Mode.Default;
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
else {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
75
77
|
}
|
|
76
78
|
else if (mode === Mode.Default && next === "/" && nextNext === "/") {
|
|
77
79
|
mode = Mode.SingleLineComment;
|
|
@@ -80,7 +82,10 @@ class CDSLexer {
|
|
|
80
82
|
}
|
|
81
83
|
// multi line comment handling
|
|
82
84
|
if (mode === Mode.MultiLineComment) {
|
|
83
|
-
if (
|
|
85
|
+
if (next === "\n") {
|
|
86
|
+
row++;
|
|
87
|
+
}
|
|
88
|
+
else if (prev === "*" && next === "/") {
|
|
84
89
|
mode = Mode.Default;
|
|
85
90
|
}
|
|
86
91
|
continue;
|
package/build/src/ddic.js
CHANGED
|
@@ -143,6 +143,7 @@ class DDIC {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
lookupNoVoid(name) {
|
|
146
|
+
var _a;
|
|
146
147
|
const foundTABL = this.reg.getObject("TABL", name);
|
|
147
148
|
if (foundTABL) {
|
|
148
149
|
return { type: foundTABL.parseType(this.reg), object: foundTABL };
|
|
@@ -155,10 +156,6 @@ class DDIC {
|
|
|
155
156
|
if (foundTTYP) {
|
|
156
157
|
return { type: foundTTYP.parseType(this.reg), object: foundTTYP };
|
|
157
158
|
}
|
|
158
|
-
const foundDDLS = this.reg.getObject("DDLS", name);
|
|
159
|
-
if (foundDDLS) {
|
|
160
|
-
return { type: foundDDLS.parseType(this.reg), object: foundDDLS };
|
|
161
|
-
}
|
|
162
159
|
const foundDTEL = this.reg.getObject("DTEL", name);
|
|
163
160
|
if (foundDTEL) {
|
|
164
161
|
return { type: foundDTEL.parseType(this.reg), object: foundDTEL };
|
|
@@ -166,7 +163,7 @@ class DDIC {
|
|
|
166
163
|
const upper = name.toUpperCase();
|
|
167
164
|
for (const obj of this.reg.getObjectsByType("DDLS")) {
|
|
168
165
|
const ddls = obj;
|
|
169
|
-
if (ddls.getSQLViewName() === upper) {
|
|
166
|
+
if (ddls.getSQLViewName() === upper || ((_a = ddls.getDefinitionName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === upper) {
|
|
170
167
|
return { type: ddls.parseType(this.reg), object: obj };
|
|
171
168
|
}
|
|
172
169
|
}
|
|
@@ -213,6 +210,7 @@ class DDIC {
|
|
|
213
210
|
}
|
|
214
211
|
}
|
|
215
212
|
lookupTableOrView(name) {
|
|
213
|
+
var _a;
|
|
216
214
|
if (name === undefined) {
|
|
217
215
|
return { type: new Types.UnknownType("undefined, lookupTableOrView") };
|
|
218
216
|
}
|
|
@@ -220,20 +218,17 @@ class DDIC {
|
|
|
220
218
|
if (foundTABL) {
|
|
221
219
|
return { type: foundTABL.parseType(this.reg), object: foundTABL };
|
|
222
220
|
}
|
|
223
|
-
const foundDDLS = this.reg.getObject("DDLS", name);
|
|
224
|
-
if (foundDDLS) {
|
|
225
|
-
return { type: foundDDLS.parseType(this.reg), object: foundDDLS };
|
|
226
|
-
}
|
|
227
221
|
const upper = name.toUpperCase();
|
|
228
222
|
for (const obj of this.reg.getObjectsByType("DDLS")) {
|
|
229
223
|
const ddls = obj;
|
|
230
|
-
if (ddls.getSQLViewName() === upper) {
|
|
224
|
+
if (ddls.getSQLViewName() === upper || ((_a = ddls.getDefinitionName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === upper) {
|
|
231
225
|
return { type: ddls.parseType(this.reg), object: ddls };
|
|
232
226
|
}
|
|
233
227
|
}
|
|
234
228
|
return this.lookupView(name);
|
|
235
229
|
}
|
|
236
230
|
lookupTableOrView2(name) {
|
|
231
|
+
var _a;
|
|
237
232
|
if (name === undefined) {
|
|
238
233
|
return undefined;
|
|
239
234
|
}
|
|
@@ -245,14 +240,10 @@ class DDIC {
|
|
|
245
240
|
if (foundVIEW) {
|
|
246
241
|
return foundVIEW;
|
|
247
242
|
}
|
|
248
|
-
const foundDDLS = this.reg.getObject("DDLS", name);
|
|
249
|
-
if (foundDDLS) {
|
|
250
|
-
return foundDDLS;
|
|
251
|
-
}
|
|
252
243
|
const upper = name.toUpperCase();
|
|
253
244
|
for (const obj of this.reg.getObjectsByType("DDLS")) {
|
|
254
245
|
const ddls = obj;
|
|
255
|
-
if (ddls.getSQLViewName() === upper) {
|
|
246
|
+
if (ddls.getSQLViewName() === upper || ((_a = ddls.getDefinitionName()) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === upper) {
|
|
256
247
|
return ddls;
|
|
257
248
|
}
|
|
258
249
|
}
|
|
@@ -25,6 +25,11 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
25
25
|
this.parse();
|
|
26
26
|
return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.sqlViewName;
|
|
27
27
|
}
|
|
28
|
+
getDefinitionName() {
|
|
29
|
+
var _a;
|
|
30
|
+
this.parse();
|
|
31
|
+
return (_a = this.parsedData) === null || _a === void 0 ? void 0 : _a.definitionName;
|
|
32
|
+
}
|
|
28
33
|
getDescription() {
|
|
29
34
|
// todo
|
|
30
35
|
return undefined;
|
|
@@ -53,12 +58,14 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
53
58
|
return this.parserError;
|
|
54
59
|
}
|
|
55
60
|
parse() {
|
|
61
|
+
var _a, _b;
|
|
56
62
|
if (this.isDirty() === false) {
|
|
57
63
|
return { updated: false, runtime: 0 };
|
|
58
64
|
}
|
|
59
65
|
const start = Date.now();
|
|
60
66
|
this.parsedData = {
|
|
61
67
|
sqlViewName: undefined,
|
|
68
|
+
definitionName: undefined,
|
|
62
69
|
fields: [],
|
|
63
70
|
sources: [],
|
|
64
71
|
relations: [],
|
|
@@ -68,6 +75,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
68
75
|
this.findSQLViewName();
|
|
69
76
|
this.parsedData.tree = new cds_parser_1.CDSParser().parse(this.findSourceFile());
|
|
70
77
|
if (this.parsedData.tree) {
|
|
78
|
+
this.parsedData.definitionName = (_b = (_a = this.parsedData.tree) === null || _a === void 0 ? void 0 : _a.findFirstExpression(expressions_1.CDSName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();
|
|
71
79
|
this.findSourcesAndRelations(this.parsedData.tree);
|
|
72
80
|
this.findFieldNames(this.parsedData.tree);
|
|
73
81
|
}
|
|
@@ -107,6 +115,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
|
|
|
107
115
|
this.parsedData.fields.push({
|
|
108
116
|
name: name,
|
|
109
117
|
annotations: annotations,
|
|
118
|
+
key: e.findDirectTokenByText("KEY") !== undefined,
|
|
110
119
|
});
|
|
111
120
|
}
|
|
112
121
|
}
|
|
@@ -90,8 +90,13 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
90
90
|
found = found.getType();
|
|
91
91
|
}
|
|
92
92
|
if (found instanceof Types.StructureType) {
|
|
93
|
-
|
|
94
|
-
components.push({ name:
|
|
93
|
+
if (field.GROUPNAME !== undefined) {
|
|
94
|
+
components.push({ name: field.GROUPNAME, type: found });
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
for (const c of found.getComponents()) {
|
|
98
|
+
components.push({ name: c.name, type: c.type });
|
|
99
|
+
}
|
|
95
100
|
}
|
|
96
101
|
}
|
|
97
102
|
else if ((((_a = field.PRECFIELD) === null || _a === void 0 ? void 0 : _a.startsWith("CI_")) || ((_b = field.PRECFIELD) === null || _b === void 0 ? void 0 : _b.startsWith("SI_")))
|
|
@@ -241,6 +246,7 @@ class Table extends _abstract_object_1.AbstractObject {
|
|
|
241
246
|
DATATYPE: field.DATATYPE,
|
|
242
247
|
DECIMALS: field.DECIMALS,
|
|
243
248
|
KEYFLAG: field.KEYFLAG,
|
|
249
|
+
GROUPNAME: field.GROUPNAME,
|
|
244
250
|
});
|
|
245
251
|
}
|
|
246
252
|
}
|
package/build/src/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.83.
|
|
3
|
+
"version": "2.83.13",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://abaplint.org",
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@microsoft/api-extractor": "^7.19.
|
|
48
|
+
"@microsoft/api-extractor": "^7.19.3",
|
|
49
49
|
"@types/chai": "^4.3.0",
|
|
50
50
|
"@types/mocha": "^9.0.0",
|
|
51
|
-
"@types/node": "^17.0.
|
|
51
|
+
"@types/node": "^17.0.5",
|
|
52
52
|
"chai": "^4.3.4",
|
|
53
53
|
"eslint": "^8.5.0",
|
|
54
54
|
"mocha": "^9.1.3",
|