@abaplint/core 2.113.1 → 2.113.3

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.
@@ -1821,6 +1821,8 @@ declare type DynproField = {
1821
1821
 
1822
1822
  declare type DynproHeader = {
1823
1823
  number: string;
1824
+ description: string;
1825
+ nextScreen: string;
1824
1826
  fields: DynproField[];
1825
1827
  };
1826
1828
 
@@ -2679,6 +2681,8 @@ declare class FunctionExportingParameter extends Expression {
2679
2681
  declare class FunctionGroup extends ABAPObject {
2680
2682
  private includes;
2681
2683
  private modules;
2684
+ private description;
2685
+ private dynpros;
2682
2686
  getType(): string;
2683
2687
  getDescription(): string | undefined;
2684
2688
  setDirty(): void;
@@ -2686,6 +2690,7 @@ declare class FunctionGroup extends ABAPObject {
2686
2690
  maxLength: number;
2687
2691
  allowNamespace: boolean;
2688
2692
  };
2693
+ getDynpros(): DynproList;
2689
2694
  getSequencedFiles(): readonly ABAPFile[];
2690
2695
  getModules(): FunctionModuleDefinition[];
2691
2696
  getIncludeFiles(): {
@@ -4901,9 +4906,6 @@ declare namespace Objects {
4901
4906
  Package,
4902
4907
  Parameter,
4903
4908
  PersonalizationObject,
4904
- DynproField,
4905
- DynproHeader,
4906
- DynproList,
4907
4909
  Program,
4908
4910
  ProxyObject,
4909
4911
  PushChannel,
@@ -16,7 +16,9 @@ class StatementFlow {
16
16
  var _a, _b, _c, _d;
17
17
  const ret = [];
18
18
  let name = "";
19
- const structures = stru.findAllStructuresMulti([Structures.Form, Structures.ClassImplementation, Structures.FunctionModule]);
19
+ const structures = stru.findAllStructuresMulti([
20
+ Structures.Form, Structures.ClassImplementation, Structures.FunctionModule, Structures.Module
21
+ ]);
20
22
  for (const s of structures) {
21
23
  if (s.get() instanceof Structures.Form) {
22
24
  name = "FORM " + ((_a = s.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
@@ -34,6 +36,10 @@ class StatementFlow {
34
36
  name = "FUNCTION " + ((_d = s.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens());
35
37
  ret.push(this.run(s, name));
36
38
  }
39
+ else if (s.get() instanceof Structures.Module) {
40
+ name = s.getFirstStatement().concatTokens().toUpperCase();
41
+ ret.push(this.run(s, name));
42
+ }
37
43
  else {
38
44
  throw new Error("StatementFlow, unknown structure");
39
45
  }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseDynpros = parseDynpros;
4
+ const xml_utils_1 = require("../xml_utils");
5
+ function parseDynpros(parsed) {
6
+ var _a, _b, _c, _d;
7
+ const dynpros = [];
8
+ const xmlDynpros = (_c = (_b = (_a = parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.DYNPROS;
9
+ if (xmlDynpros !== undefined) {
10
+ for (const d of (0, xml_utils_1.xmlToArray)(xmlDynpros.item)) {
11
+ const fields = [];
12
+ for (const f of (0, xml_utils_1.xmlToArray)((_d = d.FIELDS) === null || _d === void 0 ? void 0 : _d.RPY_DYFATC)) {
13
+ fields.push({
14
+ name: f.NAME,
15
+ type: f.TYPE,
16
+ length: f.LENGTH,
17
+ });
18
+ }
19
+ dynpros.push({
20
+ number: d.HEADER.SCREEN,
21
+ description: d.HEADER.DESCRIPT,
22
+ nextScreen: d.HEADER.NEXTSCREEN,
23
+ fields: fields,
24
+ });
25
+ }
26
+ }
27
+ return dynpros;
28
+ }
29
+ //# sourceMappingURL=_dynpros.js.map
@@ -5,18 +5,23 @@ const _abap_object_1 = require("./_abap_object");
5
5
  const types_1 = require("../abap/types");
6
6
  const xml_utils_1 = require("../xml_utils");
7
7
  const fast_xml_parser_1 = require("fast-xml-parser");
8
+ const _dynpros_1 = require("./_dynpros");
8
9
  class FunctionGroup extends _abap_object_1.ABAPObject {
9
10
  constructor() {
10
11
  super(...arguments);
11
12
  this.includes = undefined;
12
13
  this.modules = undefined;
14
+ this.description = undefined;
15
+ this.dynpros = undefined;
13
16
  }
14
17
  getType() {
15
18
  return "FUGR";
16
19
  }
17
20
  getDescription() {
18
- // todo
19
- return undefined;
21
+ if (this.description === undefined) {
22
+ this.parseXML();
23
+ }
24
+ return this.description;
20
25
  }
21
26
  setDirty() {
22
27
  super.setDirty();
@@ -29,6 +34,12 @@ class FunctionGroup extends _abap_object_1.ABAPObject {
29
34
  allowNamespace: true,
30
35
  };
31
36
  }
37
+ getDynpros() {
38
+ if (this.dynpros === undefined) {
39
+ this.parseXML();
40
+ }
41
+ return this.dynpros || [];
42
+ }
32
43
  getSequencedFiles() {
33
44
  const main = this.getMainABAPFile();
34
45
  if (main === undefined) {
@@ -130,22 +141,24 @@ class FunctionGroup extends _abap_object_1.ABAPObject {
130
141
  }
131
142
  /////////////////////////////////
132
143
  parseXML() {
133
- var _a, _b;
144
+ var _a, _b, _c;
134
145
  this.includes = [];
135
146
  this.modules = [];
136
147
  const parsed = this.parseRaw2();
137
148
  if (parsed === undefined) {
138
149
  return;
139
150
  }
151
+ this.description = (_a = parsed.abapGit["asx:abap"]["asx:values"]) === null || _a === void 0 ? void 0 : _a.AREAT;
152
+ this.dynpros = (0, _dynpros_1.parseDynpros)(parsed);
140
153
  // INCLUDES
141
- const includes = (_a = parsed.abapGit["asx:abap"]["asx:values"]) === null || _a === void 0 ? void 0 : _a.INCLUDES;
154
+ const includes = (_b = parsed.abapGit["asx:abap"]["asx:values"]) === null || _b === void 0 ? void 0 : _b.INCLUDES;
142
155
  if (includes !== undefined) {
143
156
  for (const i of (0, xml_utils_1.xmlToArray)(includes.SOBJ_NAME)) {
144
157
  this.includes.push(i);
145
158
  }
146
159
  }
147
160
  // FUNCTION MODULES
148
- const functions = (_b = parsed.abapGit["asx:abap"]["asx:values"]) === null || _b === void 0 ? void 0 : _b.FUNCTIONS;
161
+ const functions = (_c = parsed.abapGit["asx:abap"]["asx:values"]) === null || _c === void 0 ? void 0 : _c.FUNCTIONS;
149
162
  for (const module of (0, xml_utils_1.xmlToArray)(functions === null || functions === void 0 ? void 0 : functions.item)) {
150
163
  this.modules.push(new types_1.FunctionModuleDefinition(module));
151
164
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Program = void 0;
4
4
  const _abap_object_1 = require("./_abap_object");
5
- const xml_utils_1 = require("../xml_utils");
5
+ const _dynpros_1 = require("./_dynpros");
6
6
  class Program extends _abap_object_1.ABAPObject {
7
7
  getType() {
8
8
  return "PROG";
@@ -38,11 +38,10 @@ class Program extends _abap_object_1.ABAPObject {
38
38
  }
39
39
  getDynpros() {
40
40
  this.parseXML();
41
- return this.parsedXML.dynpros;
41
+ return this.parsedXML.dynpros || [];
42
42
  }
43
43
  ////////////////////////////
44
44
  parseXML() {
45
- var _a, _b, _c, _d;
46
45
  if (this.parsedXML !== undefined) {
47
46
  return;
48
47
  }
@@ -56,24 +55,7 @@ class Program extends _abap_object_1.ABAPObject {
56
55
  };
57
56
  return;
58
57
  }
59
- const dynpros = [];
60
- const xmlDynpros = (_c = (_b = (_a = parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.DYNPROS;
61
- if (xmlDynpros !== undefined) {
62
- for (const d of (0, xml_utils_1.xmlToArray)(xmlDynpros.item)) {
63
- const fields = [];
64
- for (const f of (0, xml_utils_1.xmlToArray)((_d = d.FIELDS) === null || _d === void 0 ? void 0 : _d.RPY_DYFATC)) {
65
- fields.push({
66
- name: f.NAME,
67
- type: f.TYPE,
68
- length: f.LENGTH,
69
- });
70
- }
71
- dynpros.push({
72
- number: d.HEADER.SCREEN,
73
- fields: fields,
74
- });
75
- }
76
- }
58
+ const dynpros = (0, _dynpros_1.parseDynpros)(parsed);
77
59
  this.parsedXML = {
78
60
  isInclude: file ? file.getRaw().includes("<SUBC>I</SUBC>") : false,
79
61
  isModulePool: file ? file.getRaw().includes("<SUBC>M</SUBC>") : false,
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.1";
70
+ return "2.113.3";
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.1",
3
+ "version": "2.113.3",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",