@abaplint/transpiler 2.3.54 → 2.3.56

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.
@@ -24,7 +24,7 @@ class ConstantTranspiler {
24
24
  if (str) {
25
25
  let res = str.getFirstToken().getStr();
26
26
  if (res.startsWith("'") && this.addGet === false) {
27
- const code = "new abap.types.Character({length: " + (res.length - 2) + "}).set(" + this.escape(res) + ")";
27
+ const code = "new abap.types.Character(" + (res.length - 2) + ").set(" + this.escape(res) + ")";
28
28
  return new chunk_1.Chunk().append(code, node, traversal);
29
29
  }
30
30
  else if (res.startsWith("`") && this.addGet === false) {
@@ -52,7 +52,7 @@ class ConstantTranspiler {
52
52
  chunk.appendString(",");
53
53
  }
54
54
  if (res.startsWith("'") && this.addGet === false) {
55
- const code = "new abap.types.Character({length: " + (res.length - 2) + "}).set(" + this.escape(res) + ")";
55
+ const code = "new abap.types.Character(" + (res.length - 2) + ").set(" + this.escape(res) + ")";
56
56
  chunk.append(code, node, traversal);
57
57
  }
58
58
  else if (res.startsWith("`") && this.addGet === false) {
@@ -88,7 +88,7 @@ class TranspileTypes {
88
88
  else if (type instanceof abaplint.BasicTypes.AnyType) {
89
89
  // if not supplied its a Character(4)
90
90
  resolved = "Character";
91
- extra = "{length: 4}";
91
+ extra = "4";
92
92
  }
93
93
  else if (type instanceof abaplint.BasicTypes.SimpleType) {
94
94
  // if not supplied its a Character(1)
@@ -96,25 +96,7 @@ class TranspileTypes {
96
96
  }
97
97
  else if (type instanceof abaplint.BasicTypes.CharacterType) {
98
98
  resolved = "Character";
99
- const e = {
100
- length: type.getLength() || undefined,
101
- qualifiedName: type.getQualifiedName(),
102
- conversionExit: type.getConversionExit(),
103
- };
104
- if (type.getLength() === 1) {
105
- delete e.length;
106
- }
107
- extra = JSON.stringify(e);
108
- if (extra === "{}") {
109
- extra = "";
110
- }
111
- /*
112
- if (type.getLength() !== 1) {
113
- extra = "{length: " + type.getLength() + ", qualifiedName: \"" + type.getQualifiedName() + "\"}";
114
- } else if (type.getQualifiedName() !== undefined) {
115
- extra = "{qualifiedName: \"" + type.getQualifiedName() + "\"}";
116
- }
117
- */
99
+ extra = type.getLength() + ", " + JSON.stringify(type.getAbstractTypeData());
118
100
  }
119
101
  else if (type instanceof abaplint.BasicTypes.NumericType) {
120
102
  resolved = "Numc";
@@ -55,9 +55,9 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
55
55
 
56
56
  async function run() {
57
57
  await initializeABAP();
58
- let lt_input = new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character({length: 30}), testclass_name: new abap.types.Character({length: 30}), method_name: new abap.types.Character({length: 30})}), {"withHeader":false,"type":"STANDARD","isUnique":false,"keyFields":[]});
59
- let ls_input = new abap.types.Structure({class_name: new abap.types.Character({length: 30}), testclass_name: new abap.types.Character({length: 30}), method_name: new abap.types.Character({length: 30})});
60
- let ls_result = new abap.types.Structure({list: new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character({length: 30}), testclass_name: new abap.types.Character({length: 30}), method_name: new abap.types.Character({length: 30}), expected: new abap.types.String(), actual: new abap.types.String(), status: new abap.types.String(), runtime: new abap.types.Integer(), message: new abap.types.String(), js_location: new abap.types.String()}), {"withHeader":false,"type":"STANDARD","isUnique":false,"keyFields":[]}), json: new abap.types.String()});
58
+ let lt_input = new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character(30), testclass_name: new abap.types.Character(30), method_name: new abap.types.Character(30})}), {"withHeader":false,"type":"STANDARD","isUnique":false,"keyFields":[]});
59
+ let ls_input = new abap.types.Structure({class_name: new abap.types.Character(30), testclass_name: new abap.types.Character(30), method_name: new abap.types.Character(30)});
60
+ let ls_result = new abap.types.Structure({list: new abap.types.Table(new abap.types.Structure({class_name: new abap.types.Character(30), testclass_name: new abap.types.Character(30), method_name: new abap.types.Character(30), expected: new abap.types.String(), actual: new abap.types.String(), status: new abap.types.String(), runtime: new abap.types.Integer(), message: new abap.types.String(), js_location: new abap.types.String()}), {"withHeader":false,"type":"STANDARD","isUnique":false,"keyFields":[]}), json: new abap.types.String()});
61
61
  `;
62
62
  for (const obj of reg.getObjects()) {
63
63
  if (reg.isDependency(obj) || !(obj instanceof abaplint.Objects.Class)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.3.54",
3
+ "version": "2.3.56",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "author": "abaplint",
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
- "@abaplint/core": "^2.93.94",
31
+ "@abaplint/core": "^2.93.95",
32
32
  "source-map": "^0.7.4"
33
33
  },
34
34
  "devDependencies": {