@abaplint/core 2.113.128 → 2.113.129

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.
@@ -8,7 +8,7 @@ class Color extends combi_1.Expression {
8
8
  const eq = (0, combi_1.seq)("=", source_1.Source);
9
9
  const integers = (0, combi_1.altPrio)("1", "2", "3", "4", "5", "6", "7");
10
10
  const texts = (0, combi_1.altPrio)("COL_BACKGROUND", "COL_HEADING", "COL_NORMAL", "COL_TOTAL", "COL_KEY", "COL_POSITIVE", "COL_NEGATIVE", "COL_GROUP");
11
- const value = (0, combi_1.alt)(eq, (0, combi_1.altPrio)("ON", "OFF", (0, combi_1.altPrio)(integers, texts)));
11
+ const value = (0, combi_1.alt)(eq, (0, combi_1.altPrio)("ON", "OFF", "COLOR OFF", (0, combi_1.altPrio)(integers, texts)));
12
12
  const toggle = (0, combi_1.altPrio)("ON", "OFF");
13
13
  return (0, combi_1.seq)("COLOR", (0, combi_1.opt)((0, combi_1.seq)(value, (0, combi_1.opt)(toggle))));
14
14
  }
@@ -6,8 +6,8 @@ const expressions_1 = require("../expressions");
6
6
  class DataBegin {
7
7
  getMatcher() {
8
8
  const occurs = (0, combi_1.seq)("OCCURS", expressions_1.Integer);
9
- const common = (0, combi_1.altPrio)((0, combi_1.seq)("COMMON PART", expressions_1.DefinitionName), "COMMON PART");
10
- const structure = (0, combi_1.seq)("BEGIN OF", (0, combi_1.altPrio)(common, (0, combi_1.seq)(expressions_1.DefinitionName, (0, combi_1.opt)("READ-ONLY"), (0, combi_1.opt)(occurs))));
9
+ const common = (0, combi_1.seq)("COMMON PART", (0, combi_1.optPrio)(expressions_1.DefinitionName));
10
+ const structure = (0, combi_1.seq)("BEGIN OF", (0, combi_1.altPrio)(common, (0, combi_1.seq)(expressions_1.DefinitionName, (0, combi_1.optPrio)("READ-ONLY"), (0, combi_1.optPrio)(occurs))));
11
11
  return (0, combi_1.seq)("DATA", structure);
12
12
  }
13
13
  }
@@ -5,7 +5,7 @@ const Structures = require("./");
5
5
  const _combi_1 = require("./_combi");
6
6
  class DynproLogic {
7
7
  getMatcher() {
8
- return (0, _combi_1.seq)((0, _combi_1.sub)(Structures.ProcessBeforeOutput), (0, _combi_1.sub)(Structures.ProcessAfterInput), (0, _combi_1.opt)((0, _combi_1.sub)(Structures.ProcessOnValueRequest)), (0, _combi_1.opt)((0, _combi_1.sub)(Structures.ProcessOnHelpRequest)));
8
+ return (0, _combi_1.seq)((0, _combi_1.sub)(Structures.ProcessBeforeOutput), (0, _combi_1.sub)(Structures.ProcessAfterInput), (0, _combi_1.opt)((0, _combi_1.sub)(Structures.ProcessOnHelpRequest)), (0, _combi_1.opt)((0, _combi_1.sub)(Structures.ProcessOnValueRequest)), (0, _combi_1.opt)((0, _combi_1.sub)(Structures.ProcessOnHelpRequest)));
9
9
  }
10
10
  }
11
11
  exports.DynproLogic = DynproLogic;
@@ -1,18 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Data = void 0;
4
- const Expressions = require("../../2_statements/expressions");
5
- const Statements = require("../../2_statements/statements");
6
- const Structures = require("../../3_structures/structures");
4
+ const _syntax_input_1 = require("../_syntax_input");
5
+ const data_1 = require("../statements/data");
6
+ const _reference_1 = require("../_reference");
7
7
  const nodes_1 = require("../../nodes");
8
+ const type_1 = require("../statements/type");
8
9
  const _typed_identifier_1 = require("../../types/_typed_identifier");
10
+ const types_1 = require("./types");
9
11
  const Basic = require("../../types/basic");
10
- const data_1 = require("../statements/data");
11
- const _reference_1 = require("../_reference");
12
- const _syntax_input_1 = require("../_syntax_input");
12
+ const Expressions = require("../../2_statements/expressions");
13
+ const Statements = require("../../2_statements/statements");
14
+ const Structures = require("../../3_structures/structures");
13
15
  class Data {
14
- runSyntax(node, input) {
15
- var _a;
16
+ static runSyntax(node, input) {
17
+ var _a, _b;
18
+ const fouth = (_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getChildren()[3];
19
+ const isCommonPart = fouth instanceof nodes_1.TokenNode && fouth.concatTokens() === "COMMON";
20
+ if (isCommonPart) {
21
+ this.runCommonPartSyntax(node, input);
22
+ return undefined;
23
+ }
16
24
  const name = node.findFirstExpression(Expressions.DefinitionName).getFirstToken();
17
25
  let table = false;
18
26
  const values = {};
@@ -29,7 +37,7 @@ class Data {
29
37
  }
30
38
  }
31
39
  else if (c instanceof nodes_1.StructureNode && ctyp instanceof Structures.Data) {
32
- const found = new Data().runSyntax(c, input);
40
+ const found = Data.runSyntax(c, input);
33
41
  if (found) {
34
42
  components.push({ name: found.getName(), type: found.getType() });
35
43
  }
@@ -41,7 +49,7 @@ class Data {
41
49
  }
42
50
  else if (c instanceof nodes_1.StatementNode && ctyp instanceof Statements.IncludeType) {
43
51
  // INCLUDES
44
- const typeToken = (_a = c.findFirstExpression(Expressions.TypeName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
52
+ const typeToken = (_b = c.findFirstExpression(Expressions.TypeName)) === null || _b === void 0 ? void 0 : _b.getFirstToken();
45
53
  const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();
46
54
  let foundId = input.scope.findType(typeName);
47
55
  if (foundId === undefined) {
@@ -93,6 +101,35 @@ class Data {
93
101
  return new _typed_identifier_1.TypedIdentifier(name, input.filename, new Basic.StructureType(components), undefined, val);
94
102
  }
95
103
  }
104
+ static runCommonPartSyntax(node, input) {
105
+ for (const c of node.getChildren()) {
106
+ const ctyp = c.get();
107
+ if (c instanceof nodes_1.StatementNode && ctyp instanceof Statements.Data) {
108
+ const found = new data_1.Data().runSyntax(c, input);
109
+ if (found) {
110
+ input.scope.addIdentifier(found);
111
+ }
112
+ }
113
+ else if (c instanceof nodes_1.StructureNode && ctyp instanceof Structures.Data) {
114
+ const found = Data.runSyntax(c, input);
115
+ if (found) {
116
+ input.scope.addIdentifier(found);
117
+ }
118
+ }
119
+ else if (c instanceof nodes_1.StatementNode && ctyp instanceof Statements.Type) {
120
+ const found = new type_1.Type().runSyntax(c, input);
121
+ if (found) {
122
+ input.scope.addIdentifier(found);
123
+ }
124
+ }
125
+ else if (c instanceof nodes_1.StructureNode && ctyp instanceof Structures.Types) {
126
+ const found = new types_1.Types().runSyntax(c, input);
127
+ if (found) {
128
+ input.scope.addIdentifier(found);
129
+ }
130
+ }
131
+ }
132
+ }
96
133
  }
97
134
  exports.Data = Data;
98
135
  //# sourceMappingURL=data.js.map
@@ -410,7 +410,7 @@ class SyntaxLogic {
410
410
  return true;
411
411
  }
412
412
  else if (stru instanceof Structures.Data) {
413
- this.scope.addIdentifier(new data_1.Data().runSyntax(node, input));
413
+ this.scope.addIdentifier(data_1.Data.runSyntax(node, input));
414
414
  return true;
415
415
  }
416
416
  else if (stru instanceof Structures.Statics) {
@@ -123,7 +123,7 @@ class Attributes {
123
123
  const ctyp = c.get();
124
124
  if (c instanceof nodes_1.StructureNode) {
125
125
  if (ctyp instanceof Structures.Data) {
126
- const found = new data_2.Data().runSyntax(c, input);
126
+ const found = data_2.Data.runSyntax(c, input);
127
127
  if (found !== undefined) {
128
128
  const attr = new class_attribute_1.ClassAttribute(found, visibility, found.getMeta(), found.getValue());
129
129
  this.instance.push(attr);
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.128";
70
+ return "2.113.129";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.128",
3
+ "version": "2.113.129",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",