@abaplint/transpiler 2.2.13 → 2.2.15

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.
@@ -11,28 +11,28 @@ class ComponentCompareTranspiler {
11
11
  if (node.findDirectExpression(core_1.Expressions.CompareOperator)) {
12
12
  const compare = traversal.traverse(node.findDirectExpression(core_1.Expressions.CompareOperator)).getCode();
13
13
  const source = traversal.traverse(node.findDirectExpression(core_1.Expressions.Source)).getCode();
14
- return new chunk_1.Chunk(`(i) => {return ${pre}abap.compare.${compare}(i.${component}, ${source});}`);
14
+ return new chunk_1.Chunk(`(I) => {return ${pre}abap.compare.${compare}(I.${component}, ${source});}`);
15
15
  }
16
16
  if ((concat.startsWith("NOT") && concat.endsWith("IS INITIAL"))
17
17
  || concat.endsWith("IS NOT INITIAL")) {
18
- return new chunk_1.Chunk(`(i) => {return abap.compare.initial(i.${component}) === false;}`);
18
+ return new chunk_1.Chunk(`(I) => {return abap.compare.initial(I.${component}) === false;}`);
19
19
  }
20
20
  else if (concat.endsWith("IS INITIAL")) {
21
- return new chunk_1.Chunk(`(i) => {return abap.compare.initial(i.${component});}`);
21
+ return new chunk_1.Chunk(`(I) => {return abap.compare.initial(I.${component});}`);
22
22
  }
23
23
  if ((concat.startsWith("NOT") && concat.endsWith("IS BOUND"))
24
24
  || concat.endsWith("IS NOT BOUND")) {
25
- return new chunk_1.Chunk(`(i) => {return abap.compare.initial(i.${component});}`);
25
+ return new chunk_1.Chunk(`(I) => {return abap.compare.initial(I.${component});}`);
26
26
  }
27
27
  else if (concat.endsWith("IS BOUND")) {
28
- return new chunk_1.Chunk(`(i) => {return abap.compare.initial(i.${component}) === false;}`);
28
+ return new chunk_1.Chunk(`(I) => {return abap.compare.initial(I.${component}) === false;}`);
29
29
  }
30
30
  if ((concat.startsWith("NOT") && concat.endsWith("IS ASSIGNED"))
31
31
  || concat.endsWith("IS NOT ASSIGNED")) {
32
- return new chunk_1.Chunk(`(i) => {return abap.compare.assigned(i.${component}) === false;}`);
32
+ return new chunk_1.Chunk(`(I) => {return abap.compare.assigned(I.${component}) === false;}`);
33
33
  }
34
34
  else if (concat.endsWith("IS ASSIGNED")) {
35
- return new chunk_1.Chunk(`(i) => {return abap.compare.assigned(i.${component});}`);
35
+ return new chunk_1.Chunk(`(I) => {return abap.compare.assigned(I.${component});}`);
36
36
  }
37
37
  return new chunk_1.Chunk("ComponentCompareTodo");
38
38
  }
@@ -9,7 +9,7 @@ class ComponentCondTranspiler {
9
9
  for (const c of node.getChildren()) {
10
10
  if (c instanceof abaplint.Nodes.ExpressionNode) {
11
11
  let cond = traversal.traverse(c).getCode();
12
- cond = cond.replace(/^\(i\) => \{return /, "");
12
+ cond = cond.replace(/^\(I\) => \{return /, "");
13
13
  cond = cond.replace(/;\}$/, "");
14
14
  ret += cond;
15
15
  }
@@ -26,7 +26,7 @@ class ComponentCondTranspiler {
26
26
  }
27
27
  }
28
28
  }
29
- ret = `(i) => {return ${ret};}`;
29
+ ret = `(I) => {return ${ret};}`;
30
30
  return new chunk_1.Chunk(ret);
31
31
  }
32
32
  }
@@ -9,7 +9,7 @@ class ComponentCondSubTranspiler {
9
9
  for (const c of node.getChildren()) {
10
10
  if (c instanceof abaplint.Nodes.ExpressionNode) {
11
11
  let cond = traversal.traverse(c).getCode();
12
- cond = cond.replace(/^\(i\) => \{return /, "");
12
+ cond = cond.replace(/^\(I\) => \{return /, "");
13
13
  cond = cond.replace(/;\}$/, "");
14
14
  ret += cond;
15
15
  }
@@ -29,7 +29,7 @@ class ComponentCondSubTranspiler {
29
29
  }
30
30
  }
31
31
  }
32
- ret = `(i) => {return ${ret};}`;
32
+ ret = `(I) => {return ${ret};}`;
33
33
  return new chunk_1.Chunk(ret);
34
34
  }
35
35
  }
@@ -55,8 +55,12 @@ class Keywords {
55
55
  let ret = [];
56
56
  for (const c of node.getChildren()) {
57
57
  if (c instanceof abaplint.Nodes.TokenNodeRegex) {
58
- if (keywords.some(k => k === c.getFirstToken().getStr().toLowerCase())) {
59
- ret.push(c.getFirstToken());
58
+ const token = c.getFirstToken();
59
+ if (keywords.some(k => k === token.getStr().toLowerCase())) {
60
+ const start = token.getStart();
61
+ if (!(start instanceof abaplint.VirtualPosition)) {
62
+ ret.push(token);
63
+ }
60
64
  }
61
65
  }
62
66
  else if (c instanceof abaplint.Nodes.TokenNode) {
@@ -39,6 +39,7 @@ class Requires {
39
39
  }
40
40
  if (f.getFilename() === filename
41
41
  || f.getFilename().endsWith(".clas.testclasses.abap")
42
+ || f.getFilename().endsWith(".clas.macros.abap")
42
43
  || f.getFilename() === ((_f = clas.getMainABAPFile()) === null || _f === void 0 ? void 0 : _f.getFilename())) {
43
44
  continue;
44
45
  }
@@ -0,0 +1,7 @@
1
+ import * as abaplint from "@abaplint/core";
2
+ import { IStatementTranspiler } from "./_statement_transpiler";
3
+ import { Traversal } from "../traversal";
4
+ import { Chunk } from "../chunk";
5
+ export declare class ClassDefinitionLoadTranspiler implements IStatementTranspiler {
6
+ transpile(_node: abaplint.Nodes.StatementNode, _traversal: Traversal): Chunk;
7
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ClassDefinitionLoadTranspiler = void 0;
4
+ const chunk_1 = require("../chunk");
5
+ class ClassDefinitionLoadTranspiler {
6
+ transpile(_node, _traversal) {
7
+ // for now, do nothing
8
+ return new chunk_1.Chunk(``);
9
+ }
10
+ }
11
+ exports.ClassDefinitionLoadTranspiler = ClassDefinitionLoadTranspiler;
12
+ //# sourceMappingURL=class_definition_load.js.map
@@ -12,6 +12,7 @@ export * from "./call";
12
12
  export * from "./case";
13
13
  export * from "./check";
14
14
  export * from "./class_deferred";
15
+ export * from "./class_definition_load";
15
16
  export * from "./class_implementation";
16
17
  export * from "./class_local_friends";
17
18
  export * from "./clear";
@@ -28,6 +28,7 @@ __exportStar(require("./call"), exports);
28
28
  __exportStar(require("./case"), exports);
29
29
  __exportStar(require("./check"), exports);
30
30
  __exportStar(require("./class_deferred"), exports);
31
+ __exportStar(require("./class_definition_load"), exports);
31
32
  __exportStar(require("./class_implementation"), exports);
32
33
  __exportStar(require("./class_local_friends"), exports);
33
34
  __exportStar(require("./clear"), exports);
@@ -62,6 +62,9 @@ class MethodImplementationTranspiler {
62
62
  else if (parameterDefault.getFirstToken().getStr().toLowerCase() === "abap_false") {
63
63
  val = "abap.builtin.abap_false";
64
64
  }
65
+ else if (parameterDefault.getFirstToken().getStr().toLowerCase() === "space") {
66
+ val = "abap.builtin.space";
67
+ }
65
68
  else {
66
69
  // note: this can be difficult, the "def" might be from an interface, ie. a different scope than the method
67
70
  val = new expressions_1.FieldChainTranspiler().transpile(parameterDefault, traversal, true, methodDef === null || methodDef === void 0 ? void 0 : methodDef.getFilename()).getCode();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.2.13",
3
+ "version": "2.2.15",
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.36",
31
+ "@abaplint/core": "^2.93.39",
32
32
  "source-map": "^0.7.4"
33
33
  },
34
34
  "devDependencies": {