@abaplint/transpiler-cli 2.11.38 → 2.11.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.
- package/build/bundle.js +50 -6
- package/package.json +3 -3
package/build/bundle.js
CHANGED
|
@@ -4379,7 +4379,7 @@ class For extends combi_1.Expression {
|
|
|
4379
4379
|
const t = (0, combi_1.alt)(_1.TargetField, _1.TargetFieldSymbol);
|
|
4380
4380
|
const groups = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)("GROUPS", t, "OF", t, "IN", _1.Source, (0, combi_1.optPrio)(groupBy)));
|
|
4381
4381
|
const f = (0, combi_1.seq)("FOR", (0, combi_1.alt)(itera, inn, groups), (0, combi_1.optPrio)(_1.Let));
|
|
4382
|
-
return (0, combi_1.ver)(version_1.Version.v740sp05, f);
|
|
4382
|
+
return (0, combi_1.ver)(version_1.Version.v740sp05, f, version_1.Version.OpenABAP);
|
|
4383
4383
|
}
|
|
4384
4384
|
}
|
|
4385
4385
|
exports.For = For;
|
|
@@ -53791,7 +53791,7 @@ class Registry {
|
|
|
53791
53791
|
}
|
|
53792
53792
|
static abaplintVersion() {
|
|
53793
53793
|
// magic, see build script "version.sh"
|
|
53794
|
-
return "2.113.
|
|
53794
|
+
return "2.113.181";
|
|
53795
53795
|
}
|
|
53796
53796
|
getDDICReferences() {
|
|
53797
53797
|
return this.ddicReferences;
|
|
@@ -79195,9 +79195,14 @@ class FieldChainTranspiler {
|
|
|
79195
79195
|
let name = c.getFirstToken().getStr().toLowerCase();
|
|
79196
79196
|
if (context instanceof abaplint.BasicTypes.ObjectReferenceType) {
|
|
79197
79197
|
const cdef = traversal.findClassDefinition(context.getIdentifierName(), scope);
|
|
79198
|
-
const
|
|
79198
|
+
const tokenName = c.getFirstToken().getStr();
|
|
79199
|
+
const attr = cdef?.getAttributes().findByName(tokenName);
|
|
79200
|
+
// Do not mark constants as private JS fields. Constants are exposed on instances via constructor copying.
|
|
79201
|
+
const constants = cdef?.getAttributes().getConstants() || [];
|
|
79202
|
+
const isConstant = constants.some(cons => cons.getName().toUpperCase() === tokenName.toUpperCase());
|
|
79199
79203
|
if (feature_flags_1.FEATURE_FLAGS.PRIVATE_ATTRIBUTES === true
|
|
79200
|
-
&& attr?.getVisibility() === abaplint.Visibility.Private
|
|
79204
|
+
&& attr?.getVisibility() === abaplint.Visibility.Private
|
|
79205
|
+
&& isConstant === false) {
|
|
79201
79206
|
const id = scope?.getParent()?.getParent()?.getIdentifier();
|
|
79202
79207
|
if (id?.stype === abaplint.ScopeType.ClassImplementation
|
|
79203
79208
|
&& cdef?.getName().toUpperCase() === id.sname.toUpperCase()) {
|
|
@@ -81621,6 +81626,8 @@ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/tr
|
|
|
81621
81626
|
const type_name_or_infer_1 = __webpack_require__(/*! ./type_name_or_infer */ "./node_modules/@abaplint/transpiler/build/src/expressions/type_name_or_infer.js");
|
|
81622
81627
|
const value_body_line_1 = __webpack_require__(/*! ./value_body_line */ "./node_modules/@abaplint/transpiler/build/src/expressions/value_body_line.js");
|
|
81623
81628
|
const field_assignment_1 = __webpack_require__(/*! ./field_assignment */ "./node_modules/@abaplint/transpiler/build/src/expressions/field_assignment.js");
|
|
81629
|
+
const statements_1 = __webpack_require__(/*! ../statements */ "./node_modules/@abaplint/transpiler/build/src/statements/index.js");
|
|
81630
|
+
const source_field_symbol_1 = __webpack_require__(/*! ./source_field_symbol */ "./node_modules/@abaplint/transpiler/build/src/expressions/source_field_symbol.js");
|
|
81624
81631
|
class ValueBodyTranspiler {
|
|
81625
81632
|
transpile(typ, body, traversal) {
|
|
81626
81633
|
if (!(typ.get() instanceof core_1.Expressions.TypeNameOrInfer)) {
|
|
@@ -81628,8 +81635,9 @@ class ValueBodyTranspiler {
|
|
|
81628
81635
|
}
|
|
81629
81636
|
let ret = new chunk_1.Chunk().appendString(new type_name_or_infer_1.TypeNameOrInfer().transpile(typ, traversal).getCode());
|
|
81630
81637
|
const context = new type_name_or_infer_1.TypeNameOrInfer().findType(typ, traversal);
|
|
81631
|
-
|
|
81638
|
+
let post = "";
|
|
81632
81639
|
let extraFields = "";
|
|
81640
|
+
const hasLines = body.findDirectExpression(core_1.Expressions.ValueBodyLine) !== undefined;
|
|
81633
81641
|
for (const child of body.getChildren()) {
|
|
81634
81642
|
if (child.get() instanceof core_1.Expressions.FieldAssignment && child instanceof core_1.Nodes.ExpressionNode) {
|
|
81635
81643
|
const transpiled = new field_assignment_1.FieldAssignmentTranspiler().transpile(child, traversal).getCode();
|
|
@@ -81655,11 +81663,47 @@ class ValueBodyTranspiler {
|
|
|
81655
81663
|
const source = traversal.traverse(child);
|
|
81656
81664
|
ret.appendString(".set(" + source.getCode() + ".clone())");
|
|
81657
81665
|
}
|
|
81666
|
+
else if (child.get() instanceof core_1.Expressions.For && child instanceof core_1.Nodes.ExpressionNode) {
|
|
81667
|
+
if (child.getChildren().length !== 2) {
|
|
81668
|
+
throw new Error("ValueBody FOR todo, num");
|
|
81669
|
+
}
|
|
81670
|
+
const loop = child.findDirectExpression(core_1.Expressions.InlineLoopDefinition);
|
|
81671
|
+
if (loop === undefined) {
|
|
81672
|
+
throw new Error("ValueBody FOR todo");
|
|
81673
|
+
}
|
|
81674
|
+
else if (loop.getChildren().length !== 3) {
|
|
81675
|
+
throw new Error("ValueBody FOR todo, num loop");
|
|
81676
|
+
}
|
|
81677
|
+
let targetDeclare = "";
|
|
81678
|
+
let targetAction = "";
|
|
81679
|
+
const fs = loop.findDirectExpression(core_1.Expressions.TargetFieldSymbol);
|
|
81680
|
+
if (fs) {
|
|
81681
|
+
targetDeclare = new statements_1.FieldSymbolTranspiler().transpile(fs, traversal).getCode();
|
|
81682
|
+
const targetName = new source_field_symbol_1.SourceFieldSymbolTranspiler().transpile(fs, traversal).getCode();
|
|
81683
|
+
targetAction = `${targetName}.assign(unique1);`;
|
|
81684
|
+
}
|
|
81685
|
+
else {
|
|
81686
|
+
const field = traversal.traverse(loop.findDirectExpression(core_1.Expressions.TargetField));
|
|
81687
|
+
if (field === undefined) {
|
|
81688
|
+
throw new Error("ValueBody FOR empty field todo");
|
|
81689
|
+
}
|
|
81690
|
+
targetAction = `const ${field.getCode()} = unique1.clone();`;
|
|
81691
|
+
}
|
|
81692
|
+
const source = traversal.traverse(loop.findDirectExpression(core_1.Expressions.Source)).getCode();
|
|
81693
|
+
const val = new type_name_or_infer_1.TypeNameOrInfer().transpile(typ, traversal).getCode();
|
|
81694
|
+
ret = new chunk_1.Chunk().appendString(`await (async () => {
|
|
81695
|
+
${targetDeclare}
|
|
81696
|
+
const VAL = ${val};
|
|
81697
|
+
for await (const unique1 of abap.statements.loop(${source})) {
|
|
81698
|
+
${targetAction}
|
|
81699
|
+
VAL`);
|
|
81700
|
+
post = ";\n}\nreturn VAL;\n})()";
|
|
81701
|
+
}
|
|
81658
81702
|
else {
|
|
81659
81703
|
throw new Error("ValueBodyTranspiler, unknown " + child.get().constructor.name + " \"" + child.concatTokens()) + "\"";
|
|
81660
81704
|
}
|
|
81661
81705
|
}
|
|
81662
|
-
return ret;
|
|
81706
|
+
return ret.appendString(post);
|
|
81663
81707
|
}
|
|
81664
81708
|
}
|
|
81665
81709
|
exports.ValueBodyTranspiler = ValueBodyTranspiler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.40",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"author": "abaplint",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@abaplint/core": "^2.113.
|
|
31
|
-
"@abaplint/transpiler": "^2.11.
|
|
30
|
+
"@abaplint/core": "^2.113.181",
|
|
31
|
+
"@abaplint/transpiler": "^2.11.40",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
33
|
"@types/node": "^24.3.0",
|
|
34
34
|
"@types/progress": "^2.0.7",
|