@abaplint/transpiler-cli 2.10.69 → 2.10.70
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.
- package/build/bundle.js +15 -1
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -78755,10 +78755,12 @@ exports.DatabaseTableTranspiler = DatabaseTableTranspiler;
|
|
|
78755
78755
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
78756
78756
|
exports.FieldChainTranspiler = void 0;
|
|
78757
78757
|
const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
78758
|
+
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
78758
78759
|
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
|
|
78759
78760
|
const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@abaplint/transpiler/build/src/traversal.js");
|
|
78760
78761
|
const field_symbol_1 = __webpack_require__(/*! ./field_symbol */ "./node_modules/@abaplint/transpiler/build/src/expressions/field_symbol.js");
|
|
78761
78762
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
78763
|
+
const feature_flags_1 = __webpack_require__(/*! ../feature_flags */ "./node_modules/@abaplint/transpiler/build/src/feature_flags.js");
|
|
78762
78764
|
class FieldChainTranspiler {
|
|
78763
78765
|
constructor(addGet = false) {
|
|
78764
78766
|
this.addGet = addGet;
|
|
@@ -78767,11 +78769,14 @@ class FieldChainTranspiler {
|
|
|
78767
78769
|
const ret = new chunk_1.Chunk();
|
|
78768
78770
|
const extra = [];
|
|
78769
78771
|
let interfaceNameAdded = false;
|
|
78772
|
+
let context = undefined;
|
|
78773
|
+
const scope = traversal.findCurrentScopeByToken(node.getFirstToken());
|
|
78770
78774
|
for (const c of node.getChildren()) {
|
|
78771
78775
|
if (c.get() instanceof core_1.Expressions.SourceField
|
|
78772
78776
|
|| c.get() instanceof core_1.Expressions.Field) {
|
|
78773
78777
|
const name = traversal.prefixAndName(c.getFirstToken(), filename).replace("~", "$");
|
|
78774
78778
|
ret.append(traversal_1.Traversal.prefixVariable(traversal_1.Traversal.escapeNamespace(name)), c, traversal);
|
|
78779
|
+
context = scope?.findVariable(c.getFirstToken().getStr())?.getType();
|
|
78775
78780
|
}
|
|
78776
78781
|
else if (c instanceof core_1.Nodes.ExpressionNode && c.get() instanceof core_1.Expressions.SourceFieldSymbol) {
|
|
78777
78782
|
ret.appendChunk(new field_symbol_1.FieldSymbolTranspiler().transpile(c, traversal));
|
|
@@ -78785,8 +78790,17 @@ class FieldChainTranspiler {
|
|
|
78785
78790
|
}
|
|
78786
78791
|
}
|
|
78787
78792
|
else if (c.get() instanceof core_1.Expressions.AttributeName) {
|
|
78793
|
+
let pprefix = "";
|
|
78794
|
+
if (context instanceof abaplint.BasicTypes.ObjectReferenceType) {
|
|
78795
|
+
const cdef = traversal.findClassDefinition(context.getIdentifierName(), scope);
|
|
78796
|
+
const attr = cdef?.getAttributes().findByName(c.getFirstToken().getStr());
|
|
78797
|
+
if (feature_flags_1.FEATURE_FLAGS.PRIVATE_ATTRIBUTES === true
|
|
78798
|
+
&& attr?.getVisibility() === abaplint.Visibility.Private) {
|
|
78799
|
+
pprefix = "#";
|
|
78800
|
+
}
|
|
78801
|
+
}
|
|
78788
78802
|
const interfaceName = traversal.isInterfaceAttribute(c.getFirstToken());
|
|
78789
|
-
let name = c.getFirstToken().getStr().toLowerCase();
|
|
78803
|
+
let name = pprefix + c.getFirstToken().getStr().toLowerCase();
|
|
78790
78804
|
if (prefix && interfaceName && name.startsWith(interfaceName) === false && interfaceNameAdded === false) {
|
|
78791
78805
|
name = traversal_1.Traversal.escapeNamespace(name).replace("~", "$");
|
|
78792
78806
|
name = traversal_1.Traversal.escapeNamespace(interfaceName) + "$" + name;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.70",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@abaplint/core": "^2.113.149",
|
|
31
|
-
"@abaplint/transpiler": "^2.10.
|
|
31
|
+
"@abaplint/transpiler": "^2.10.70",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
33
|
"@types/node": "^22.16.5",
|
|
34
34
|
"@types/progress": "^2.0.7",
|