@abaplint/transpiler 2.13.47 → 2.13.48

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.
@@ -188,14 +188,34 @@ class SQLCondTranspiler {
188
188
  return sourceWithComponents;
189
189
  }
190
190
  let ret = "";
191
+ let hostExpression = false;
191
192
  for (const child of node.getChildren()) {
193
+ if (!(child instanceof abaplint.Nodes.ExpressionNode) && child.getFirstToken().getStr() === "@") {
194
+ hostExpression = true;
195
+ continue;
196
+ }
192
197
  if (ret !== "") {
193
198
  ret += " ";
194
199
  }
195
- if ((child.get() instanceof abaplint.Expressions.SQLFieldName
200
+ if (hostExpression
201
+ && child instanceof abaplint.Nodes.ExpressionNode
202
+ && child.get() instanceof abaplint.Expressions.SimpleSource3) {
203
+ const code = new simple_source3_1.SimpleSource3Transpiler(true).transpile(child, traversal).getCode();
204
+ ret += `'" + ${code} + "'`;
205
+ hostExpression = false;
206
+ }
207
+ else if ((child.get() instanceof abaplint.Expressions.SQLFieldName
196
208
  || child.get() instanceof abaplint.Expressions.SQLAliasField)
197
209
  && child instanceof abaplint.Nodes.ExpressionNode) {
198
- ret += new sql_field_name_1.SQLFieldNameTranspiler().transpile(child, traversal).getCode();
210
+ if (hostExpression) {
211
+ let name = traversal.prefixAndName(child.getFirstToken(), filename).replace("~", "$");
212
+ name = traversal_1.Traversal.prefixVariable(traversal_1.Traversal.escapeNamespace(name));
213
+ ret += `'" + ${name}.get() + "'`;
214
+ hostExpression = false;
215
+ }
216
+ else {
217
+ ret += new sql_field_name_1.SQLFieldNameTranspiler().transpile(child, traversal).getCode();
218
+ }
199
219
  }
200
220
  else if (child.get() instanceof abaplint.Expressions.SQLSource
201
221
  && child instanceof abaplint.Nodes.ExpressionNode) {
@@ -90,7 +90,7 @@ class PerformTranspiler {
90
90
  index++;
91
91
  }
92
92
  index = 0;
93
- for (const u of node.findDirectExpression(abaplint.Expressions.PerformUsing)?.findDirectExpressions(abaplint.Expressions.Source) || []) {
93
+ for (const u of node.findDirectExpression(abaplint.Expressions.PerformUsing)?.findDirectExpressions(abaplint.Expressions.SimpleSource3) || []) {
94
94
  const name = def?.getUsingParameters()[index].getName().toLowerCase();
95
95
  if (name === undefined) {
96
96
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.13.47",
3
+ "version": "2.13.48",
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.120.6",
32
+ "@abaplint/core": "^2.120.9",
33
33
  "source-map": "^0.7.6"
34
34
  },
35
35
  "devDependencies": {