@abaplint/transpiler-cli 2.11.62 → 2.11.64
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 -18
- package/package.json +3 -3
package/build/bundle.js
CHANGED
|
@@ -7972,7 +7972,7 @@ class StringTemplateFormatting extends combi_1.Expression {
|
|
|
7972
7972
|
const number = (0, combi_1.seq)("NUMBER =", numberOptions);
|
|
7973
7973
|
const sign = (0, combi_1.seq)("SIGN =", signOptions);
|
|
7974
7974
|
const decimals = (0, combi_1.seq)("DECIMALS =", _1.Source);
|
|
7975
|
-
const alpha = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("ALPHA =", alphaOptions));
|
|
7975
|
+
const alpha = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("ALPHA =", alphaOptions), version_1.Version.OpenABAP);
|
|
7976
7976
|
const xsd = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("XSD =", zeroXSDOptions));
|
|
7977
7977
|
const country = (0, combi_1.seq)("COUNTRY =", _1.Source);
|
|
7978
7978
|
const formatting = (0, combi_1.altPrio)((0, combi_1.seq)("TIME =", dateTimeOptions), (0, combi_1.seq)("DATE =", dateTimeOptions), (0, combi_1.seq)("CASE =", caseOptions), (0, combi_1.seq)("EXPONENT", _1.Source), (0, combi_1.seq)("ZERO =", zeroXSDOptions), xsd, (0, combi_1.seq)("STYLE =", styleOptions), (0, combi_1.seq)("CURRENCY =", _1.Source), (0, combi_1.per)(sign, number, decimals, width, pad, alpha, align, country), (0, combi_1.per)(timezone, timestamp));
|
|
@@ -13694,7 +13694,7 @@ class InterfaceDef {
|
|
|
13694
13694
|
getMatcher() {
|
|
13695
13695
|
const val = (0, combi_1.seq)(expressions_1.AttributeName, "=", expressions_1.Source);
|
|
13696
13696
|
const dataValues = (0, combi_1.seq)("DATA VALUES", (0, combi_1.plus)(val));
|
|
13697
|
-
const options = (0, combi_1.alt)(expressions_1.AbstractMethods, expressions_1.FinalMethods, "ALL METHODS ABSTRACT", "ALL METHODS FINAL", (0, combi_1.ver)(version_1.Version.v740sp02, "PARTIALLY IMPLEMENTED"));
|
|
13697
|
+
const options = (0, combi_1.alt)(expressions_1.AbstractMethods, expressions_1.FinalMethods, "ALL METHODS ABSTRACT", "ALL METHODS FINAL", (0, combi_1.ver)(version_1.Version.v740sp02, "PARTIALLY IMPLEMENTED", version_1.Version.OpenABAP));
|
|
13698
13698
|
return (0, combi_1.seq)("INTERFACES", expressions_1.InterfaceName, (0, combi_1.opt)(options), (0, combi_1.opt)(dataValues));
|
|
13699
13699
|
}
|
|
13700
13700
|
}
|
|
@@ -18368,7 +18368,7 @@ const Structures = __webpack_require__(/*! ./ */ "./node_modules/@abaplint/core/
|
|
|
18368
18368
|
const _combi_1 = __webpack_require__(/*! ./_combi */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/_combi.js");
|
|
18369
18369
|
class DynproLogic {
|
|
18370
18370
|
getMatcher() {
|
|
18371
|
-
return (0, _combi_1.seq)((0, _combi_1.sub)(Structures.ProcessBeforeOutput), (0, _combi_1.sub)(Structures.ProcessAfterInput), (0, _combi_1.opt)((0, _combi_1.sub)(Structures.ProcessOnHelpRequest)), (0, _combi_1.opt)((0, _combi_1.sub)(Structures.ProcessOnValueRequest)), (0, _combi_1.opt)((0, _combi_1.sub)(Structures.ProcessOnHelpRequest)));
|
|
18371
|
+
return (0, _combi_1.seq)((0, _combi_1.sub)(Structures.ProcessBeforeOutput), (0, _combi_1.opt)((0, _combi_1.sub)(Structures.ProcessAfterInput)), (0, _combi_1.opt)((0, _combi_1.sub)(Structures.ProcessOnHelpRequest)), (0, _combi_1.opt)((0, _combi_1.sub)(Structures.ProcessOnValueRequest)), (0, _combi_1.opt)((0, _combi_1.sub)(Structures.ProcessOnHelpRequest)));
|
|
18372
18372
|
}
|
|
18373
18373
|
}
|
|
18374
18374
|
exports.DynproLogic = DynproLogic;
|
|
@@ -53851,7 +53851,7 @@ class Registry {
|
|
|
53851
53851
|
}
|
|
53852
53852
|
static abaplintVersion() {
|
|
53853
53853
|
// magic, see build script "version.sh"
|
|
53854
|
-
return "2.113.
|
|
53854
|
+
return "2.113.191";
|
|
53855
53855
|
}
|
|
53856
53856
|
getDDICReferences() {
|
|
53857
53857
|
return this.ddicReferences;
|
|
@@ -60099,6 +60099,9 @@ ${indentation}CATCH ${className} INTO ${targetName}.`;
|
|
|
60099
60099
|
return issue_1.Issue.atToken(lowFile, node.getFirstToken(), "Outline DATA", this.getMetadata().key, this.conf.severity, fix);
|
|
60100
60100
|
}
|
|
60101
60101
|
partiallyImplemented(node, lowFile) {
|
|
60102
|
+
if (this.lowReg.getConfig().getVersion() === version_1.Version.OpenABAP) {
|
|
60103
|
+
return undefined;
|
|
60104
|
+
}
|
|
60102
60105
|
if (node.get() instanceof Statements.InterfaceDef) {
|
|
60103
60106
|
const partially = node.findDirectTokenByText("PARTIALLY");
|
|
60104
60107
|
if (partially === undefined) {
|
|
@@ -61940,7 +61943,11 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
61940
61943
|
if (cdef instanceof _typed_identifier_1.TypedIdentifier) {
|
|
61941
61944
|
const foo = cdef.getType();
|
|
61942
61945
|
if (foo instanceof basic_1.ObjectReferenceType) {
|
|
61943
|
-
cdef = foo.
|
|
61946
|
+
cdef = spag === null || spag === void 0 ? void 0 : spag.findClassDefinition(foo.getQualifiedName());
|
|
61947
|
+
if (cdef === undefined) {
|
|
61948
|
+
const cglobal = this.highReg.getObject("CLAS", foo.getQualifiedName());
|
|
61949
|
+
cdef = cglobal === null || cglobal === void 0 ? void 0 : cglobal.getDefinition();
|
|
61950
|
+
}
|
|
61944
61951
|
}
|
|
61945
61952
|
else {
|
|
61946
61953
|
throw new Error("newParameters, downport, unexpected");
|
|
@@ -79361,8 +79368,10 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
79361
79368
|
exports.FieldAssignmentTranspiler = void 0;
|
|
79362
79369
|
const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
79363
79370
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
79371
|
+
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
79372
|
+
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/transpiler/build/src/expressions/source.js");
|
|
79364
79373
|
class FieldAssignmentTranspiler {
|
|
79365
|
-
transpile(node, traversal) {
|
|
79374
|
+
transpile(node, traversal, context) {
|
|
79366
79375
|
const ret = new chunk_1.Chunk();
|
|
79367
79376
|
const field = node.findDirectExpression(core_1.Expressions.FieldSub);
|
|
79368
79377
|
if (field === undefined) {
|
|
@@ -79372,7 +79381,11 @@ class FieldAssignmentTranspiler {
|
|
|
79372
79381
|
if (source === undefined) {
|
|
79373
79382
|
throw new Error("FieldAssignmentTranspiler, Expected Source");
|
|
79374
79383
|
}
|
|
79375
|
-
|
|
79384
|
+
if (context instanceof abaplint.BasicTypes.StructureType) {
|
|
79385
|
+
context = context.getComponentByName(field.concatTokens());
|
|
79386
|
+
}
|
|
79387
|
+
const sourc = new source_1.SourceTranspiler().transpile(source, traversal, context).getCode();
|
|
79388
|
+
ret.appendString(`.setField("${field.concatTokens().toLowerCase()}", ${sourc})`);
|
|
79376
79389
|
return ret;
|
|
79377
79390
|
}
|
|
79378
79391
|
}
|
|
@@ -80625,7 +80638,7 @@ class SourceTranspiler {
|
|
|
80625
80638
|
constructor(addGet = false) {
|
|
80626
80639
|
this.addGet = addGet;
|
|
80627
80640
|
}
|
|
80628
|
-
transpile(node, traversal) {
|
|
80641
|
+
transpile(node, traversal, context) {
|
|
80629
80642
|
let ret = new chunk_1.Chunk();
|
|
80630
80643
|
const post = new chunk_1.Chunk();
|
|
80631
80644
|
const children = node.getChildren();
|
|
@@ -80640,7 +80653,7 @@ class SourceTranspiler {
|
|
|
80640
80653
|
ret.appendChunk(new constant_1.ConstantTranspiler(this.addGet).transpile(c, traversal));
|
|
80641
80654
|
}
|
|
80642
80655
|
else if (c.get() instanceof core_1.Expressions.StringTemplate) {
|
|
80643
|
-
ret.appendChunk(
|
|
80656
|
+
ret.appendChunk(new _1.StringTemplateTranspiler().transpile(c, traversal, context));
|
|
80644
80657
|
}
|
|
80645
80658
|
else if (c.get() instanceof core_1.Expressions.Cond) {
|
|
80646
80659
|
ret.appendChunk(traversal.traverse(c));
|
|
@@ -80695,7 +80708,8 @@ class SourceTranspiler {
|
|
|
80695
80708
|
ret = new chunk_1.Chunk().appendString(new _1.TypeNameOrInfer().transpile(typ, traversal).getCode());
|
|
80696
80709
|
ret.appendString(".set(");
|
|
80697
80710
|
// todo: handle LET
|
|
80698
|
-
|
|
80711
|
+
const context = new _1.TypeNameOrInfer().findType(typ, traversal);
|
|
80712
|
+
ret.appendString(new SourceTranspiler().transpile(c.getFirstChild(), traversal, context).getCode());
|
|
80699
80713
|
ret.appendString(")");
|
|
80700
80714
|
}
|
|
80701
80715
|
else if (c.get() instanceof core_1.Expressions.ValueBody) {
|
|
@@ -81563,7 +81577,7 @@ const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abapli
|
|
|
81563
81577
|
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
|
|
81564
81578
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
81565
81579
|
class StringTemplateTranspiler {
|
|
81566
|
-
transpile(node, traversal) {
|
|
81580
|
+
transpile(node, traversal, context) {
|
|
81567
81581
|
let ret = "";
|
|
81568
81582
|
const children = node.getChildren();
|
|
81569
81583
|
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
@@ -81588,7 +81602,7 @@ class StringTemplateTranspiler {
|
|
|
81588
81602
|
}
|
|
81589
81603
|
}
|
|
81590
81604
|
else if (c instanceof core_1.Nodes.ExpressionNode) {
|
|
81591
|
-
ret += new _1.StringTemplateSourceTranspiler().transpile(c, traversal).getCode();
|
|
81605
|
+
ret += new _1.StringTemplateSourceTranspiler().transpile(c, traversal, context).getCode();
|
|
81592
81606
|
}
|
|
81593
81607
|
}
|
|
81594
81608
|
return new chunk_1.Chunk("new abap.types.String().set(" + ret + ")");
|
|
@@ -81612,14 +81626,15 @@ exports.StringTemplateSourceTranspiler = void 0;
|
|
|
81612
81626
|
const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
81613
81627
|
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
|
|
81614
81628
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
81629
|
+
const transpile_types_1 = __webpack_require__(/*! ../transpile_types */ "./node_modules/@abaplint/transpiler/build/src/transpile_types.js");
|
|
81615
81630
|
class StringTemplateSourceTranspiler {
|
|
81616
|
-
transpile(node, traversal) {
|
|
81631
|
+
transpile(node, traversal, context) {
|
|
81617
81632
|
let ret = "";
|
|
81618
81633
|
const pre = "abap.templateFormatting(";
|
|
81619
81634
|
let post = ")";
|
|
81620
81635
|
const formatting = node.findDirectExpression(core_1.Expressions.StringTemplateFormatting);
|
|
81621
81636
|
if (formatting) {
|
|
81622
|
-
const options = this.build(formatting, traversal);
|
|
81637
|
+
const options = this.build(formatting, traversal, context, node);
|
|
81623
81638
|
if (options) {
|
|
81624
81639
|
post = "," + options + ")";
|
|
81625
81640
|
}
|
|
@@ -81631,7 +81646,7 @@ class StringTemplateSourceTranspiler {
|
|
|
81631
81646
|
ret += pre + new _1.SourceTranspiler().transpile(c, traversal).getCode() + post;
|
|
81632
81647
|
return new chunk_1.Chunk(ret);
|
|
81633
81648
|
}
|
|
81634
|
-
build(node, traversal) {
|
|
81649
|
+
build(node, traversal, context, _top) {
|
|
81635
81650
|
let option = "";
|
|
81636
81651
|
let count = 0;
|
|
81637
81652
|
for (const c of node.getChildren()) {
|
|
@@ -81651,6 +81666,11 @@ class StringTemplateSourceTranspiler {
|
|
|
81651
81666
|
option += new _1.SourceTranspiler(true).transpile(c, traversal).getCode();
|
|
81652
81667
|
}
|
|
81653
81668
|
}
|
|
81669
|
+
if (option.startsWith(`"alpha":"in"`)) {
|
|
81670
|
+
if (context !== undefined) {
|
|
81671
|
+
option += `, "alphaInContext": ` + transpile_types_1.TranspileTypes.toType(context);
|
|
81672
|
+
}
|
|
81673
|
+
}
|
|
81654
81674
|
if (option !== "") {
|
|
81655
81675
|
return "{" + option + "}";
|
|
81656
81676
|
}
|
|
@@ -81941,7 +81961,7 @@ class ValueBodyTranspiler {
|
|
|
81941
81961
|
const hasLines = body.findDirectExpression(core_1.Expressions.ValueBodyLine) !== undefined;
|
|
81942
81962
|
for (const child of body.getChildren()) {
|
|
81943
81963
|
if (child.get() instanceof core_1.Expressions.FieldAssignment && child instanceof core_1.Nodes.ExpressionNode) {
|
|
81944
|
-
const transpiled = new field_assignment_1.FieldAssignmentTranspiler().transpile(child, traversal).getCode();
|
|
81964
|
+
const transpiled = new field_assignment_1.FieldAssignmentTranspiler().transpile(child, traversal, context).getCode();
|
|
81945
81965
|
if (hasLines === false) {
|
|
81946
81966
|
ret.appendString(transpiled);
|
|
81947
81967
|
}
|
|
@@ -87222,12 +87242,24 @@ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abap
|
|
|
87222
87242
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
87223
87243
|
class MoveTranspiler {
|
|
87224
87244
|
transpile(node, traversal) {
|
|
87225
|
-
|
|
87245
|
+
const sourceExpression = node.findDirectExpression(abaplint.Expressions.Source);
|
|
87226
87246
|
const targets = [];
|
|
87227
|
-
|
|
87247
|
+
const targetExpressions = node.findDirectExpressions(abaplint.Expressions.Target);
|
|
87248
|
+
for (const t of targetExpressions) {
|
|
87228
87249
|
targets.push(traversal.traverse(t));
|
|
87229
87250
|
}
|
|
87230
87251
|
const ret = new chunk_1.Chunk();
|
|
87252
|
+
if (targetExpressions.length === 1
|
|
87253
|
+
&& sourceExpression?.getChildren().length === 1
|
|
87254
|
+
&& sourceExpression.findDirectExpression(abaplint.Expressions.StringTemplate)
|
|
87255
|
+
&& sourceExpression.concatTokens().toUpperCase().endsWith(" ALPHA = IN }|")
|
|
87256
|
+
&& sourceExpression.concatTokens().toUpperCase().startsWith("|{")) {
|
|
87257
|
+
const target = targets[0].getCode();
|
|
87258
|
+
const tSource = traversal.traverse(sourceExpression.findFirstExpression(abaplint.Expressions.StringTemplateSource)?.findDirectExpression(abaplint.Expressions.Source));
|
|
87259
|
+
ret.appendString(target + `.set(abap.alphaIn(${tSource.getCode()}, ${target}, ${target}));`);
|
|
87260
|
+
return ret;
|
|
87261
|
+
}
|
|
87262
|
+
let source = traversal.traverse(sourceExpression);
|
|
87231
87263
|
const second = node.getChildren()[1]?.concatTokens();
|
|
87232
87264
|
switch (second) {
|
|
87233
87265
|
case "?=":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.64",
|
|
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.191",
|
|
31
|
+
"@abaplint/transpiler": "^2.11.64",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
33
|
"@types/node": "^24.3.0",
|
|
34
34
|
"@types/progress": "^2.0.7",
|