@abaplint/transpiler 2.10.63 → 2.10.65

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.
@@ -5,7 +5,6 @@ const core_1 = require("@abaplint/core");
5
5
  const traversal_1 = require("../traversal");
6
6
  const method_call_param_1 = require("./method_call_param");
7
7
  const chunk_1 = require("../chunk");
8
- const feature_flags_1 = require("../feature_flags");
9
8
  class MethodCallTranspiler {
10
9
  transpile(node, traversal) {
11
10
  const nameToken = node.findDirectExpression(core_1.Expressions.MethodName)?.getFirstToken();
@@ -23,8 +22,7 @@ class MethodCallTranspiler {
23
22
  name = m.name.toLowerCase();
24
23
  }
25
24
  name = traversal_1.Traversal.escapeNamespace(name.replace("~", "$"));
26
- if (feature_flags_1.FEATURE_FLAGS.private === true
27
- && m?.def.getVisibility() === core_1.Visibility.Private
25
+ if (m?.def.getVisibility() === core_1.Visibility.Private
28
26
  && m.def.isStatic() === false) {
29
27
  const id = scope?.getParent()?.getParent()?.getIdentifier();
30
28
  if (id?.stype === core_1.ScopeType.ClassImplementation
@@ -1,3 +1 @@
1
- export declare const FEATURE_FLAGS: {
2
- private: boolean;
3
- };
1
+ export declare const FEATURE_FLAGS: {};
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FEATURE_FLAGS = void 0;
4
- exports.FEATURE_FLAGS = {
5
- private: true,
6
- };
4
+ exports.FEATURE_FLAGS = {};
7
5
  //# sourceMappingURL=feature_flags.js.map
@@ -4,7 +4,6 @@ exports.CallTranspiler = void 0;
4
4
  const abaplint = require("@abaplint/core");
5
5
  const chunk_1 = require("../chunk");
6
6
  const expressions_1 = require("../expressions");
7
- const feature_flags_1 = require("../feature_flags");
8
7
  class CallTranspiler {
9
8
  transpile(node, traversal) {
10
9
  const chain = node.findDirectExpression(abaplint.Expressions.MethodCallChain);
@@ -67,8 +66,7 @@ class CallTranspiler {
67
66
  }
68
67
  if (nameToken) {
69
68
  const scope = traversal.findCurrentScopeByToken(nameToken);
70
- if (feature_flags_1.FEATURE_FLAGS.private === true
71
- && m?.def.getVisibility() === abaplint.Visibility.Private
69
+ if (m?.def.getVisibility() === abaplint.Visibility.Private
72
70
  && m.def.isStatic() === false) {
73
71
  const id = scope?.getParent()?.getParent()?.getIdentifier();
74
72
  if (id?.stype === abaplint.ScopeType.ClassImplementation
@@ -6,7 +6,14 @@ const chunk_1 = require("../chunk");
6
6
  class CollectTranspiler {
7
7
  transpile(node, traversal) {
8
8
  const source = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Source));
9
- const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Target));
9
+ const targetExpression = node.findDirectExpression(abaplint.Expressions.Target);
10
+ if (targetExpression === undefined) {
11
+ return new chunk_1.Chunk()
12
+ .appendString("abap.statements.collect(")
13
+ .appendChunk(source)
14
+ .appendString(");");
15
+ }
16
+ const target = traversal.traverse(targetExpression);
10
17
  const fstarget = node.findDirectExpression(abaplint.Expressions.FSTarget);
11
18
  if (fstarget) {
12
19
  return new chunk_1.Chunk(`throw new Error("Collect, transpiler todo");`);
@@ -8,7 +8,6 @@ const traversal_1 = require("../traversal");
8
8
  const expressions_1 = require("../expressions");
9
9
  const chunk_1 = require("../chunk");
10
10
  const unique_identifier_1 = require("../unique_identifier");
11
- const feature_flags_1 = require("../feature_flags");
12
11
  class MethodImplementationTranspiler {
13
12
  transpile(node, traversal) {
14
13
  const token = node.findFirstExpression(abaplint.Expressions.MethodName).getFirstToken();
@@ -119,8 +118,7 @@ class MethodImplementationTranspiler {
119
118
  }
120
119
  // https://github.com/tc39/proposal-class-fields
121
120
  let isPrivate = "";
122
- if (feature_flags_1.FEATURE_FLAGS.private === true
123
- && method?.getVisibility() === abaplint.Visibility.Private
121
+ if (method?.getVisibility() === abaplint.Visibility.Private
124
122
  && method.isStatic() === false) {
125
123
  isPrivate = "#";
126
124
  }
@@ -7,7 +7,7 @@ const chunk_1 = require("../chunk");
7
7
  const transpile_types_1 = require("../transpile_types");
8
8
  class RangesTranspiler {
9
9
  transpile(node, traversal) {
10
- const token = node.findFirstExpression(abaplint.Expressions.SimpleName)?.getFirstToken();
10
+ const token = node.findFirstExpression(abaplint.Expressions.DefinitionName)?.getFirstToken();
11
11
  if (token === undefined) {
12
12
  throw new Error("RangesTranspiler, token not found");
13
13
  }
@@ -9,7 +9,6 @@ const transpile_types_1 = require("./transpile_types");
9
9
  const chunk_1 = require("./chunk");
10
10
  const expressions_1 = require("./expressions");
11
11
  const keywords_1 = require("./keywords");
12
- const feature_flags_1 = require("./feature_flags");
13
12
  class Traversal {
14
13
  constructor(spaghetti, file, obj, reg, options) {
15
14
  this.scopeCache = undefined;
@@ -403,7 +402,7 @@ class Traversal {
403
402
  continue;
404
403
  }
405
404
  let privateHash = "";
406
- if (feature_flags_1.FEATURE_FLAGS.private === true && a.getVisibility() === abaplint.Visibility.Private) {
405
+ if (a.getVisibility() === abaplint.Visibility.Private) {
407
406
  privateHash = "#";
408
407
  }
409
408
  const methodName = privateHash + Traversal.escapeNamespace(name.replace("~", "$"));
@@ -26,6 +26,7 @@ exports.config = {
26
26
  "parser_error": true,
27
27
  "allowed_object_types": {
28
28
  "allowed": [
29
+ "APIS",
29
30
  "AUTH",
30
31
  "CLAS",
31
32
  "DEVC",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.10.63",
3
+ "version": "2.10.65",
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.113.136",
32
+ "@abaplint/core": "^2.113.148",
33
33
  "source-map": "^0.7.4"
34
34
  },
35
35
  "devDependencies": {