@abaplint/transpiler 2.7.68 → 2.7.70

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.
@@ -83,13 +83,22 @@ class ConstantTranspiler {
83
83
  str = str.replace(reg, "$1\\'$2");
84
84
  }
85
85
  }
86
- if (str.startsWith("`")) {
86
+ else if (str.startsWith("`")) {
87
87
  const reg = new RegExp(/(.+)``(.+)/g);
88
88
  while (reg.test(str)) {
89
89
  str = str.replace(reg, "$1\\`$2");
90
90
  }
91
91
  str = str.replace(/\$\{/g, "\\${");
92
92
  }
93
+ else if (str.includes("\n")
94
+ || str.includes("\r")
95
+ || str.includes("\r")
96
+ || str.includes("\t")
97
+ || str.includes("\f")
98
+ || str.includes("\v")
99
+ || str.includes("\b")) {
100
+ str = JSON.stringify(str);
101
+ }
93
102
  return str;
94
103
  }
95
104
  }
@@ -81,8 +81,8 @@ class TranspileTypes {
81
81
  const renamingSuffix = {};
82
82
  for (const c of type.getComponents()) {
83
83
  list.push(`"` + c.name.toLowerCase() + `": ` + this.toType(c.type));
84
- if (c.renamingSuffix) {
85
- renamingSuffix[c.name.toLowerCase()] = c.renamingSuffix;
84
+ if (c.suffix) {
85
+ renamingSuffix[c.name.toLowerCase()] = c.suffix;
86
86
  }
87
87
  }
88
88
  extra = "{" + list.join(", ") + "}";
@@ -144,7 +144,7 @@ class Traversal {
144
144
  name = "this." + Traversal.escapeNamespace(name);
145
145
  }
146
146
  else if (this.isBuiltinVariable(t)) {
147
- name = "abap.builtin." + name;
147
+ name = "abap.builtin." + name.toLowerCase().replace("%", "$");
148
148
  }
149
149
  else if (this.isTypePool(t)) {
150
150
  const tp = this.isTypePool(t);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.7.68",
3
+ "version": "2.7.70",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "author": "abaplint",
30
30
  "license": "MIT",
31
31
  "dependencies": {
32
- "@abaplint/core": "^2.102.15",
32
+ "@abaplint/core": "^2.102.17",
33
33
  "source-map": "^0.7.4"
34
34
  },
35
35
  "devDependencies": {