@abaplint/transpiler 2.2.7 → 2.2.9

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.
@@ -77,6 +77,7 @@ class DatabaseSetup {
77
77
  // statements are inside a javascript string stemplate
78
78
  ret = ret.replace(/\\/g, "\\\\");
79
79
  ret = ret.replace(/`/g, "\\`");
80
+ ret = ret.replace(/\${/g, "\\${");
80
81
  return ret;
81
82
  }
82
83
  }
@@ -44,7 +44,7 @@ class SQLiteDatabaseSchema {
44
44
  previous = j.LTAB + "," + j.RTAB;
45
45
  }
46
46
  from = from.trim();
47
- return `CREATE VIEW ${view.getName().toLowerCase()} AS SELECT ${columns} FROM ${from};\n`;
47
+ return `CREATE VIEW '${view.getName().toLowerCase()}' AS SELECT ${columns} FROM ${from};\n`;
48
48
  }
49
49
  buildTABL(tabl) {
50
50
  const type = tabl.parseType(this.reg);
@@ -57,8 +57,8 @@ class SQLiteDatabaseSchema {
57
57
  }
58
58
  // assumption: all transparent tables have primary keys
59
59
  // add single quotes to field names to allow for keywords as field names
60
- const key = ", PRIMARY KEY(" + tabl.listKeys().map(e => "'" + e.toLowerCase() + "'").join(",") + ")";
61
- return `CREATE TABLE ${tabl.getName().toLowerCase()} (${fields.join(", ")}${key});\n`;
60
+ const key = ", PRIMARY KEY(" + tabl.listKeys(this.reg).map(e => "'" + e.toLowerCase() + "'").join(",") + ")";
61
+ return `CREATE TABLE '${tabl.getName().toLowerCase()}' (${fields.join(", ")}${key});\n`;
62
62
  }
63
63
  toType(type, fieldname, errorInfo) {
64
64
  if (type instanceof abaplint.BasicTypes.CharacterType) {
@@ -15,7 +15,7 @@ class HandleTable {
15
15
  const chunk = new chunk_1.Chunk().appendString(`abap.DDIC["${obj.getName().toUpperCase()}"] = {
16
16
  "objectType": "TABL",
17
17
  "type": ${new transpile_types_1.TranspileTypes().toType(type)},
18
- "keyFields": ${JSON.stringify(obj.listKeys())},
18
+ "keyFields": ${JSON.stringify(obj.listKeys(reg))},
19
19
  };`);
20
20
  const output = {
21
21
  object: {
@@ -96,7 +96,7 @@ class SelectTranspiler {
96
96
  if (from.length === 1) {
97
97
  const tabl = traversal.findTable(from[0]);
98
98
  if (tabl) {
99
- keys = tabl.listKeys().map(k => k.toLowerCase());
99
+ keys = tabl.listKeys(traversal.reg).map(k => k.toLowerCase());
100
100
  }
101
101
  }
102
102
  return keys;
@@ -5,7 +5,7 @@ export declare class Traversal {
5
5
  private readonly spaghetti;
6
6
  private readonly file;
7
7
  private readonly obj;
8
- private readonly reg;
8
+ readonly reg: abaplint.IRegistry;
9
9
  readonly runtimeTypeError: boolean;
10
10
  constructor(spaghetti: abaplint.ISpaghettiScope, file: abaplint.ABAPFile, obj: abaplint.ABAPObject, reg: abaplint.IRegistry, runtimeTypeError?: boolean);
11
11
  static escapeClassName(name: string | undefined): string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
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.35",
31
+ "@abaplint/core": "^2.93.36",
32
32
  "source-map": "^0.7.4"
33
33
  },
34
34
  "devDependencies": {