@abaplint/transpiler-cli 2.6.29 → 2.6.31

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.
Files changed (2) hide show
  1. package/build/bundle.js +31 -17
  2. package/package.json +4 -4
package/build/bundle.js CHANGED
@@ -19568,16 +19568,19 @@ class CurrentScope {
19568
19568
  if (name === undefined) {
19569
19569
  return { found: false };
19570
19570
  }
19571
- let RTTIPrefix = "";
19571
+ let prefixRTTI = "";
19572
19572
  if (this.parentObj.getType() === "PROG") {
19573
- RTTIPrefix = "\\PROGRAM=" + this.parentObj.getName();
19573
+ prefixRTTI = "\\PROGRAM=" + this.parentObj.getName();
19574
19574
  }
19575
19575
  else if (this.parentObj.getType() === "CLAS") {
19576
- RTTIPrefix = "\\CLASS-POOL=" + this.parentObj.getName();
19576
+ prefixRTTI = "\\CLASS-POOL=" + this.parentObj.getName();
19577
19577
  }
19578
19578
  const findLocalClass = (_a = this.current) === null || _a === void 0 ? void 0 : _a.findClassDefinition(name);
19579
19579
  if (findLocalClass) {
19580
- return { found: true, id: findLocalClass, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "CLAS", RTTIName: RTTIPrefix + "\\CLASS=" + findLocalClass.getName() };
19580
+ if (findLocalClass.isGlobal() === true) {
19581
+ prefixRTTI = "";
19582
+ }
19583
+ return { found: true, id: findLocalClass, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "CLAS", RTTIName: prefixRTTI + "\\CLASS=" + findLocalClass.getName() };
19581
19584
  }
19582
19585
  const globalClas = this.reg.getObject("CLAS", name);
19583
19586
  if (globalClas) {
@@ -19585,7 +19588,10 @@ class CurrentScope {
19585
19588
  }
19586
19589
  const findLocalInterface = (_b = this.current) === null || _b === void 0 ? void 0 : _b.findInterfaceDefinition(name);
19587
19590
  if (findLocalInterface) {
19588
- return { found: true, id: findLocalInterface, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "INTF", RTTIName: RTTIPrefix + "\\INTERFACE=" + findLocalInterface.getName() };
19591
+ if (findLocalInterface.isGlobal() === true) {
19592
+ prefixRTTI = "";
19593
+ }
19594
+ return { found: true, id: findLocalInterface, type: _reference_1.ReferenceType.ObjectOrientedReference, ooType: "INTF", RTTIName: prefixRTTI + "\\INTERFACE=" + findLocalInterface.getName() };
19589
19595
  }
19590
19596
  const globalIntf = this.reg.getObject("INTF", name);
19591
19597
  if (globalIntf) {
@@ -46517,7 +46523,7 @@ class Registry {
46517
46523
  }
46518
46524
  static abaplintVersion() {
46519
46525
  // magic, see build script "version.sh"
46520
- return "2.97.16";
46526
+ return "2.97.17";
46521
46527
  }
46522
46528
  getDDICReferences() {
46523
46529
  return this.references;
@@ -72004,8 +72010,8 @@ class ClassImplementationTranspiler {
72004
72010
  return new chunk_1.Chunk().append(ret + ` {
72005
72011
  static INTERNAL_TYPE = 'CLAS';
72006
72012
  static INTERNAL_NAME = '${traversal.buildInternalName(token.getStr(), def)}';
72007
- static IMPLEMENTED_INTERFACES = [${this.findImplementedClass(traversal, def, scope).map(e => `"` + e.toUpperCase() + `"`).join(",")}];
72008
- static ATTRIBUTES = {${traversal.buildAttributes(def)}};`, node, traversal);
72013
+ static IMPLEMENTED_INTERFACES = [${this.findImplementedByClass(traversal, def, scope).map(e => `"` + e.toUpperCase() + `"`).join(",")}];
72014
+ static ATTRIBUTES = {${traversal.buildAttributes(def, scope).join(",\n")}};`, node, traversal);
72009
72015
  }
72010
72016
  findImplementedInterface(traversal, def, scope) {
72011
72017
  if (def === undefined || scope === undefined) {
@@ -72018,7 +72024,7 @@ static ATTRIBUTES = {${traversal.buildAttributes(def)}};`, node, traversal);
72018
72024
  }
72019
72025
  return list;
72020
72026
  }
72021
- findImplementedClass(traversal, def, scope) {
72027
+ findImplementedByClass(traversal, def, scope) {
72022
72028
  if (def === undefined || scope === undefined) {
72023
72029
  return [];
72024
72030
  }
@@ -72030,7 +72036,7 @@ static ATTRIBUTES = {${traversal.buildAttributes(def)}};`, node, traversal);
72030
72036
  let sup = def.getSuperClass();
72031
72037
  while (sup !== undefined) {
72032
72038
  const sdef = traversal.findClassDefinition(sup, scope);
72033
- list.push(...this.findImplementedClass(traversal, sdef, scope));
72039
+ list.push(...this.findImplementedByClass(traversal, sdef, scope));
72034
72040
  sup = sdef === null || sdef === void 0 ? void 0 : sdef.getSuperClass();
72035
72041
  }
72036
72042
  return list;
@@ -77132,11 +77138,12 @@ class InterfaceTranspiler {
77132
77138
  const def = traversal.getInterfaceDefinition(node.getFirstToken());
77133
77139
  for (const c of node.getChildren()) {
77134
77140
  if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.Interface) {
77141
+ const scope = traversal.findCurrentScopeByToken(node.getFirstToken());
77135
77142
  name = (_a = c.findDirectExpression(abaplint.Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr().toLowerCase();
77136
77143
  name = traversal_1.Traversal.escapeNamespace(name);
77137
77144
  ret += `class ${name} {\n`;
77138
77145
  ret += `static INTERNAL_TYPE = 'INTF';\n`;
77139
- ret += `static ATTRIBUTES = {${traversal.buildAttributes(def)}};\n`;
77146
+ ret += `static ATTRIBUTES = {${traversal.buildAttributes(def, scope).join(",\n")}};\n`;
77140
77147
  }
77141
77148
  else if (c instanceof abaplint.Nodes.StatementNode && c.get() instanceof abaplint.Statements.EndInterface) {
77142
77149
  ret += "}\n";
@@ -77880,10 +77887,13 @@ class Traversal {
77880
77887
  }
77881
77888
  return undefined;
77882
77889
  }
77883
- buildAttributes(def) {
77890
+ buildAttributes(def, scope, prefix = "") {
77884
77891
  var _a, _b;
77885
77892
  const attr = [];
77886
- for (const a of ((_a = def === null || def === void 0 ? void 0 : def.getAttributes()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {
77893
+ if (def === undefined) {
77894
+ return attr;
77895
+ }
77896
+ for (const a of ((_a = def.getAttributes()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {
77887
77897
  const type = new transpile_types_1.TranspileTypes().toType(a.getType());
77888
77898
  let runtime = "";
77889
77899
  switch (a.getVisibility()) {
@@ -77896,9 +77906,9 @@ class Traversal {
77896
77906
  default:
77897
77907
  runtime = "U";
77898
77908
  }
77899
- attr.push(`"${a.getName().toUpperCase()}": {"type": () => {return ${type};}, "visibility": "${runtime}", "is_constant": " "}`);
77909
+ attr.push(`"${prefix + a.getName().toUpperCase()}": {"type": () => {return ${type};}, "visibility": "${runtime}", "is_constant": " "}`);
77900
77910
  }
77901
- for (const a of ((_b = def === null || def === void 0 ? void 0 : def.getAttributes()) === null || _b === void 0 ? void 0 : _b.getConstants()) || []) {
77911
+ for (const a of ((_b = def.getAttributes()) === null || _b === void 0 ? void 0 : _b.getConstants()) || []) {
77902
77912
  const type = new transpile_types_1.TranspileTypes().toType(a.getType());
77903
77913
  let runtime = "";
77904
77914
  switch (a.getVisibility()) {
@@ -77911,9 +77921,13 @@ class Traversal {
77911
77921
  default:
77912
77922
  runtime = "U";
77913
77923
  }
77914
- attr.push(`"${a.getName().toUpperCase()}": {"type": () => {return ${type};}, "visibility": "${runtime}", "is_constant": "X"}`);
77924
+ attr.push(`"${prefix + a.getName().toUpperCase()}": {"type": () => {return ${type};}, "visibility": "${runtime}", "is_constant": "X"}`);
77925
+ }
77926
+ for (const impl of def.getImplementing()) {
77927
+ const idef = this.findInterfaceDefinition(impl.name, scope);
77928
+ attr.push(...this.buildAttributes(idef, scope, impl.name.toUpperCase() + "~"));
77915
77929
  }
77916
- return attr.join(",\n");
77930
+ return attr;
77917
77931
  }
77918
77932
  isBuiltinMethod(token) {
77919
77933
  const scope = this.findCurrentScopeByToken(token);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.6.29",
3
+ "version": "2.6.31",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,12 +25,12 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.6.29",
28
+ "@abaplint/transpiler": "^2.6.31",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",
32
- "@types/node": "^18.15.13",
33
- "@abaplint/core": "^2.97.16",
32
+ "@types/node": "^18.16.0",
33
+ "@abaplint/core": "^2.97.17",
34
34
  "progress": "^2.0.3",
35
35
  "webpack": "^5.80.0",
36
36
  "webpack-cli": "^5.0.2",