@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.
@@ -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
- return (0, combi_1.seq)("DATA", expressions_1.DataDefinition, (0, combi_1.optPrio)("%_PREDEFINED"));
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 = ((_a = d.findFirstExpression(Expressions.DefinitionName)) !== null && _a !== void 0 ? _a : d.findDirectExpression(Expressions.NamespaceSimpleName)).getFirstToken();
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);
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.120.91";
78
+ return "2.120.92";
79
79
  }
80
80
  getDDICReferences() {
81
81
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.120.91",
3
+ "version": "2.120.92",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",