@abaplint/transpiler 1.7.36 → 1.7.40

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.
@@ -66,9 +66,17 @@ class DatabaseSetup {
66
66
  if (type instanceof abaplint.BasicTypes.CharacterType) {
67
67
  return `NCHAR(${type.getLength()})`;
68
68
  }
69
+ else if (type instanceof abaplint.BasicTypes.NumericType) {
70
+ // it will be fine, the runtime representation of numc is also text
71
+ return `NCHAR(${type.getLength()})`;
72
+ }
69
73
  else if (type instanceof abaplint.BasicTypes.StringType) {
70
74
  return `TEXT`;
71
75
  }
76
+ else if (type instanceof abaplint.BasicTypes.XStringType) {
77
+ // it will be fine, the runtime representation of xstring is also text
78
+ return `TEXT`;
79
+ }
72
80
  else if (type instanceof abaplint.BasicTypes.IntegerType) {
73
81
  return `INT`;
74
82
  }
@@ -49,9 +49,14 @@ class MethodSourceTranspiler {
49
49
  else if (child.get() instanceof core_1.Expressions.Dynamic) {
50
50
  const second = child.getChildren()[1];
51
51
  if (second.get() instanceof core_1.Expressions.FieldChain) {
52
+ ret.appendString("[");
52
53
  ret.appendChunk(traversal.traverse(second));
54
+ ret.appendString("]");
53
55
  }
54
56
  else if (second.get() instanceof core_1.Expressions.Constant) {
57
+ if (ret.getCode().endsWith(".") === false) {
58
+ ret.appendString(".");
59
+ }
55
60
  ret.appendString(second.getFirstToken().getStr().replace(/\'/g, "").toLowerCase().replace("~", "$"));
56
61
  }
57
62
  else {
@@ -69,11 +74,11 @@ class MethodSourceTranspiler {
69
74
  ret.append(".", child.getFirstToken().getStart(), traversal);
70
75
  }
71
76
  else if (child.concatTokens() === "->") {
72
- if (ret.getCode() === "super") {
73
- ret.append(".", child, traversal);
77
+ if (ret.getCode() !== "super") {
78
+ ret.append(".get()", child, traversal);
74
79
  }
75
- else {
76
- ret.append(".get().", child, traversal);
80
+ if (!(nextChild.get() instanceof core_1.Expressions.Dynamic)) {
81
+ ret.append(".", child, traversal);
77
82
  }
78
83
  }
79
84
  else if (child.get() instanceof core_1.Expressions.FieldChain) {
@@ -4,7 +4,11 @@ exports.SQLSourceTranspiler = void 0;
4
4
  const abaplint = require("@abaplint/core");
5
5
  class SQLSourceTranspiler {
6
6
  transpile(node, traversal) {
7
- return traversal.traverse(node.findDirectExpression(abaplint.Expressions.Source));
7
+ let s = node.findDirectExpression(abaplint.Expressions.Source);
8
+ if (s === undefined) {
9
+ s = node.findDirectExpression(abaplint.Expressions.SimpleSource3);
10
+ }
11
+ return traversal.traverse(s);
8
12
  }
9
13
  }
10
14
  exports.SQLSourceTranspiler = SQLSourceTranspiler;
@@ -10,6 +10,7 @@ class CreateDataTranspiler {
10
10
  var _a, _b, _c;
11
11
  const targetNode = node.findDirectExpression(abaplint.Expressions.Target);
12
12
  const target = traversal.traverse(targetNode);
13
+ const concat = node.concatTokens();
13
14
  const options = [];
14
15
  let dynamic = (_a = node.findDirectExpression(abaplint.Expressions.Dynamic)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(abaplint.Expressions.ConstantString);
15
16
  if (dynamic) {
@@ -31,6 +32,10 @@ class CreateDataTranspiler {
31
32
  if (node.findDirectTokenByText("TABLE")) {
32
33
  options.push(`"table": true`);
33
34
  }
35
+ if (concat.includes(" LIKE LINE OF ")) {
36
+ const so = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Source));
37
+ options.push(`"likeLineOf": ` + so.getCode());
38
+ }
34
39
  let add = "";
35
40
  if (options.length > 0) {
36
41
  add = ",{" + options.join(",") + "}";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "1.7.36",
3
+ "version": "1.7.40",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -27,7 +27,7 @@
27
27
  "author": "abaplint",
28
28
  "license": "MIT",
29
29
  "dependencies": {
30
- "@abaplint/core": "^2.85.0",
30
+ "@abaplint/core": "^2.85.9",
31
31
  "source-map": "^0.7.3"
32
32
  },
33
33
  "devDependencies": {