@abaplint/core 2.120.91 → 2.120.92
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/statements/data.js +4 -1
- package/build/src/abap/4_file_information/abap_file_information_parser.js +6 -2
- package/build/src/abap/5_syntax/structures/data.js +5 -0
- package/build/src/abap/types/basic/structure_type.js +3 -0
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
|
@@ -3,9 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Data = void 0;
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
5
|
const expressions_1 = require("../expressions");
|
|
6
|
+
const tokens_1 = require("../../1_lexer/tokens");
|
|
6
7
|
class Data {
|
|
7
8
|
getMatcher() {
|
|
8
|
-
|
|
9
|
+
// unnamed field, only relevant inside DATA BEGIN OF
|
|
10
|
+
const unnamed = (0, combi_1.seq)((0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenLeft), (0, combi_1.tok)(tokens_1.ParenLeft)), expressions_1.Integer, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.ParenRight)));
|
|
11
|
+
return (0, combi_1.seq)("DATA", (0, combi_1.altPrio)(expressions_1.DataDefinition, unnamed), (0, combi_1.optPrio)("%_PREDEFINED"));
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
14
|
exports.Data = Data;
|
|
@@ -275,6 +275,7 @@ class ABAPFileInformationParser {
|
|
|
275
275
|
}
|
|
276
276
|
parseAttributes(node, visibility) {
|
|
277
277
|
var _a;
|
|
278
|
+
var _b;
|
|
278
279
|
if (node === undefined) {
|
|
279
280
|
return [];
|
|
280
281
|
}
|
|
@@ -291,7 +292,10 @@ class ABAPFileInformationParser {
|
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
294
|
for (const d of data) {
|
|
294
|
-
const name = d.findFirstExpression(Expressions.DefinitionName).getFirstToken();
|
|
295
|
+
const name = (_a = d.findFirstExpression(Expressions.DefinitionName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
296
|
+
if (name === undefined) {
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
295
299
|
ret.push({
|
|
296
300
|
name: name.getStr(),
|
|
297
301
|
identifier: new _identifier_1.Identifier(name, this.filename),
|
|
@@ -305,7 +309,7 @@ class ABAPFileInformationParser {
|
|
|
305
309
|
classData.push(structure.findDirectStatement(Statements.ClassDataBegin));
|
|
306
310
|
}
|
|
307
311
|
for (const d of classData) {
|
|
308
|
-
const name = ((
|
|
312
|
+
const name = ((_b = d.findFirstExpression(Expressions.DefinitionName)) !== null && _b !== void 0 ? _b : d.findDirectExpression(Expressions.NamespaceSimpleName)).getFirstToken();
|
|
309
313
|
ret.push({
|
|
310
314
|
name: name.getStr(),
|
|
311
315
|
identifier: new _identifier_1.Identifier(name, this.filename),
|
|
@@ -70,6 +70,11 @@ class Data {
|
|
|
70
70
|
for (const c of node.getChildren()) {
|
|
71
71
|
const ctyp = c.get();
|
|
72
72
|
if (c instanceof nodes_1.StatementNode && ctyp instanceof Statements.Data) {
|
|
73
|
+
const unnamedLength = c.findDirectExpression(Expressions.Integer);
|
|
74
|
+
if (unnamedLength && c.findDirectExpression(Expressions.DataDefinition) === undefined) {
|
|
75
|
+
components.push({ name: "", type: new Basic.CharacterType(parseInt(unnamedLength.concatTokens(), 10)) });
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
73
78
|
const found = new data_1.Data().runSyntax(c, input);
|
|
74
79
|
if (found) {
|
|
75
80
|
components.push({ name: found.getName(), type: found.getType() });
|
|
@@ -14,6 +14,9 @@ class StructureType extends _abstract_type_1.AbstractType {
|
|
|
14
14
|
}
|
|
15
15
|
this.indexed = {};
|
|
16
16
|
for (const c of components) {
|
|
17
|
+
if (c.name === "") {
|
|
18
|
+
continue; // unnamed field, eg. "DATA: BEGIN OF str, (10), END OF str."
|
|
19
|
+
}
|
|
17
20
|
const upper = c.name.toUpperCase();
|
|
18
21
|
if (this.indexed[upper] !== undefined) {
|
|
19
22
|
throw new Error("Structure, duplicate field name \"" + upper + "\", " + qualifiedName);
|
package/build/src/registry.js
CHANGED