@abaplint/transpiler-cli 2.11.69 → 2.11.71
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 +68 -14
- package/build/types.d.ts +2 -0
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -105,14 +105,19 @@ class FileOperations {
|
|
|
105
105
|
return Promise.all(promises);
|
|
106
106
|
}
|
|
107
107
|
static async loadFiles(config) {
|
|
108
|
-
const
|
|
108
|
+
const inputFilters = (config.input_filter ?? []).map(pattern => new RegExp(pattern, "i"));
|
|
109
|
+
const excludeFilters = (config.exclude_filter ?? []).map(pattern => new RegExp(pattern, "i"));
|
|
109
110
|
let skipped = 0;
|
|
110
111
|
let added = 0;
|
|
111
112
|
const folders = Array.isArray(config.input_folder) ? config.input_folder : [config.input_folder];
|
|
112
113
|
const filesToRead = [];
|
|
113
114
|
for (const folder of folders) {
|
|
114
115
|
for (const filename of glob.sync(folder + "/**", { nosort: true, nodir: true })) {
|
|
115
|
-
if (
|
|
116
|
+
if (inputFilters.length > 0 && inputFilters.some(a => a.test(filename)) === false) {
|
|
117
|
+
skipped++;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
else if (excludeFilters.length > 0 && excludeFilters.some(a => a.test(filename)) === true) {
|
|
116
121
|
skipped++;
|
|
117
122
|
continue;
|
|
118
123
|
}
|
|
@@ -3751,12 +3756,10 @@ exports.CorrespondingBody = void 0;
|
|
|
3751
3756
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
3752
3757
|
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
3753
3758
|
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
3754
|
-
const component_chain_1 = __webpack_require__(/*! ./component_chain */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_chain.js");
|
|
3755
3759
|
class CorrespondingBody extends combi_1.Expression {
|
|
3756
3760
|
getRunnable() {
|
|
3757
|
-
const mapping = (0, combi_1.seq)("MAPPING", (0, combi_1.plus)((0, combi_1.seq)(_1.ComponentName, "=", component_chain_1.ComponentChain)));
|
|
3758
3761
|
const discarding = (0, combi_1.ver)(version_1.Version.v751, "DISCARDING DUPLICATES");
|
|
3759
|
-
return (0, combi_1.seq)((0, combi_1.optPrio)("DEEP"), (0, combi_1.optPrio)(_1.CorrespondingBodyBase), _1.Source, (0, combi_1.optPrio)(discarding), (0, combi_1.optPrio)(
|
|
3762
|
+
return (0, combi_1.seq)((0, combi_1.optPrio)("DEEP"), (0, combi_1.optPrio)(_1.CorrespondingBodyBase), _1.Source, (0, combi_1.optPrio)(discarding), (0, combi_1.optPrio)(_1.CorrespondingBodyMapping), (0, combi_1.optPrio)("CHANGING CONTROL"), (0, combi_1.optPrio)((0, combi_1.seq)("MAPPING FROM ENTITY", (0, combi_1.optPrio)("USING CONTROL"))), // todo, version something?
|
|
3760
3763
|
(0, combi_1.optPrio)((0, combi_1.seq)("EXCEPT", (0, combi_1.alt)((0, combi_1.plus)(_1.Field), "*"))));
|
|
3761
3764
|
}
|
|
3762
3765
|
}
|
|
@@ -3788,6 +3791,29 @@ exports.CorrespondingBodyBase = CorrespondingBodyBase;
|
|
|
3788
3791
|
|
|
3789
3792
|
/***/ }),
|
|
3790
3793
|
|
|
3794
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/corresponding_body_mapping.js":
|
|
3795
|
+
/*!***********************************************************************************************************!*\
|
|
3796
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/corresponding_body_mapping.js ***!
|
|
3797
|
+
\***********************************************************************************************************/
|
|
3798
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3799
|
+
|
|
3800
|
+
"use strict";
|
|
3801
|
+
|
|
3802
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3803
|
+
exports.CorrespondingBodyMapping = void 0;
|
|
3804
|
+
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
3805
|
+
const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
3806
|
+
class CorrespondingBodyMapping extends combi_1.Expression {
|
|
3807
|
+
getRunnable() {
|
|
3808
|
+
const mapping = (0, combi_1.seq)("MAPPING", (0, combi_1.plus)((0, combi_1.seq)(_1.ComponentName, "=", _1.ComponentChain)));
|
|
3809
|
+
return mapping;
|
|
3810
|
+
}
|
|
3811
|
+
}
|
|
3812
|
+
exports.CorrespondingBodyMapping = CorrespondingBodyMapping;
|
|
3813
|
+
//# sourceMappingURL=corresponding_body_mapping.js.map
|
|
3814
|
+
|
|
3815
|
+
/***/ }),
|
|
3816
|
+
|
|
3791
3817
|
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/data_definition.js":
|
|
3792
3818
|
/*!************************************************************************************************!*\
|
|
3793
3819
|
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/data_definition.js ***!
|
|
@@ -4769,9 +4795,7 @@ __exportStar(__webpack_require__(/*! ./compare */ "./node_modules/@abaplint/core
|
|
|
4769
4795
|
__exportStar(__webpack_require__(/*! ./component_chain_simple */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_chain_simple.js"), exports);
|
|
4770
4796
|
__exportStar(__webpack_require__(/*! ./component_chain */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_chain.js"), exports);
|
|
4771
4797
|
__exportStar(__webpack_require__(/*! ./component_compare_simple */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_compare_simple.js"), exports);
|
|
4772
|
-
__exportStar(__webpack_require__(/*! ./value_base */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/value_base.js"), exports);
|
|
4773
4798
|
__exportStar(__webpack_require__(/*! ./component_compare_single */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_compare_single.js"), exports);
|
|
4774
|
-
__exportStar(__webpack_require__(/*! ./corresponding_body_base */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/corresponding_body_base.js"), exports);
|
|
4775
4799
|
__exportStar(__webpack_require__(/*! ./component_compare */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_compare.js"), exports);
|
|
4776
4800
|
__exportStar(__webpack_require__(/*! ./component_cond_sub */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_cond_sub.js"), exports);
|
|
4777
4801
|
__exportStar(__webpack_require__(/*! ./component_cond */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/component_cond.js"), exports);
|
|
@@ -4784,6 +4808,8 @@ __exportStar(__webpack_require__(/*! ./constant_field_length */ "./node_modules/
|
|
|
4784
4808
|
__exportStar(__webpack_require__(/*! ./constant_string */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/constant_string.js"), exports);
|
|
4785
4809
|
__exportStar(__webpack_require__(/*! ./constant */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/constant.js"), exports);
|
|
4786
4810
|
__exportStar(__webpack_require__(/*! ./conv_body */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/conv_body.js"), exports);
|
|
4811
|
+
__exportStar(__webpack_require__(/*! ./corresponding_body_base */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/corresponding_body_base.js"), exports);
|
|
4812
|
+
__exportStar(__webpack_require__(/*! ./corresponding_body_mapping */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/corresponding_body_mapping.js"), exports);
|
|
4787
4813
|
__exportStar(__webpack_require__(/*! ./corresponding_body */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/corresponding_body.js"), exports);
|
|
4788
4814
|
__exportStar(__webpack_require__(/*! ./data_definition */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/data_definition.js"), exports);
|
|
4789
4815
|
__exportStar(__webpack_require__(/*! ./database_connection */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/database_connection.js"), exports);
|
|
@@ -4964,6 +4990,7 @@ __exportStar(__webpack_require__(/*! ./type_structure */ "./node_modules/@abapli
|
|
|
4964
4990
|
__exportStar(__webpack_require__(/*! ./type_table_key */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_table_key.js"), exports);
|
|
4965
4991
|
__exportStar(__webpack_require__(/*! ./type_table */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type_table.js"), exports);
|
|
4966
4992
|
__exportStar(__webpack_require__(/*! ./type */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/type.js"), exports);
|
|
4993
|
+
__exportStar(__webpack_require__(/*! ./value_base */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/value_base.js"), exports);
|
|
4967
4994
|
__exportStar(__webpack_require__(/*! ./value_body_line */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/value_body_line.js"), exports);
|
|
4968
4995
|
__exportStar(__webpack_require__(/*! ./value_body_lines */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/value_body_lines.js"), exports);
|
|
4969
4996
|
__exportStar(__webpack_require__(/*! ./value_body */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/value_body.js"), exports);
|
|
@@ -53851,7 +53878,7 @@ class Registry {
|
|
|
53851
53878
|
}
|
|
53852
53879
|
static abaplintVersion() {
|
|
53853
53880
|
// magic, see build script "version.sh"
|
|
53854
|
-
return "2.113.
|
|
53881
|
+
return "2.113.195";
|
|
53855
53882
|
}
|
|
53856
53883
|
getDDICReferences() {
|
|
53857
53884
|
return this.ddicReferences;
|
|
@@ -78541,7 +78568,7 @@ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/tr
|
|
|
78541
78568
|
class CompareTranspiler {
|
|
78542
78569
|
transpile(node, traversal) {
|
|
78543
78570
|
// todo, this is not correct
|
|
78544
|
-
|
|
78571
|
+
let concat = node.concatTokens().toUpperCase();
|
|
78545
78572
|
let pre = concat.startsWith("NOT ") ? "!" : "";
|
|
78546
78573
|
const sources = node.findDirectExpressionsMulti([core_1.Expressions.Source, core_1.Expressions.SourceFieldSymbolChain, core_1.Expressions.SourceFieldSymbol]);
|
|
78547
78574
|
if (sources.length === 1) {
|
|
@@ -78571,7 +78598,10 @@ class CompareTranspiler {
|
|
|
78571
78598
|
return new chunk_1.Chunk().appendString("abap.compare.assigned(").appendChunk(s0).appendString(")");
|
|
78572
78599
|
}
|
|
78573
78600
|
if (concat.endsWith(" IS SUPPLIED")) {
|
|
78574
|
-
|
|
78601
|
+
if (concat.startsWith("NOT ")) {
|
|
78602
|
+
concat = concat.replace("NOT ", "");
|
|
78603
|
+
}
|
|
78604
|
+
return new chunk_1.Chunk().appendString(pre + "(INPUT && INPUT." + concat.replace(" IS SUPPLIED", "" + ")").toLowerCase());
|
|
78575
78605
|
}
|
|
78576
78606
|
else if (concat.endsWith(" IS NOT SUPPLIED")) {
|
|
78577
78607
|
return new chunk_1.Chunk().appendString(pre + "INPUT && INPUT." + concat.replace(" IS NOT SUPPLIED", "").toLowerCase() + " === undefined");
|
|
@@ -79277,6 +79307,8 @@ const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abapli
|
|
|
79277
79307
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
79278
79308
|
const type_name_or_infer_1 = __webpack_require__(/*! ./type_name_or_infer */ "./node_modules/@abaplint/transpiler/build/src/expressions/type_name_or_infer.js");
|
|
79279
79309
|
const transpile_types_1 = __webpack_require__(/*! ../transpile_types */ "./node_modules/@abaplint/transpiler/build/src/transpile_types.js");
|
|
79310
|
+
const component_chain_1 = __webpack_require__(/*! ./component_chain */ "./node_modules/@abaplint/transpiler/build/src/expressions/component_chain.js");
|
|
79311
|
+
const unique_identifier_1 = __webpack_require__(/*! ../unique_identifier */ "./node_modules/@abaplint/transpiler/build/src/unique_identifier.js");
|
|
79280
79312
|
class CorrespondingBodyTranspiler {
|
|
79281
79313
|
transpile(typ, body, traversal) {
|
|
79282
79314
|
if (!(typ.get() instanceof core_1.Expressions.TypeNameOrInfer)) {
|
|
@@ -79285,6 +79317,8 @@ class CorrespondingBodyTranspiler {
|
|
|
79285
79317
|
const type = new type_name_or_infer_1.TypeNameOrInfer().findType(typ, traversal);
|
|
79286
79318
|
let target = transpile_types_1.TranspileTypes.toType(type);
|
|
79287
79319
|
let source;
|
|
79320
|
+
const mapping = [];
|
|
79321
|
+
const mappingRow = { componentName: undefined, componentChain: undefined };
|
|
79288
79322
|
for (const child of body.getChildren()) {
|
|
79289
79323
|
const c = child.get();
|
|
79290
79324
|
if (c instanceof core_1.Expressions.Source && child instanceof core_1.Nodes.ExpressionNode) {
|
|
@@ -79294,12 +79328,33 @@ class CorrespondingBodyTranspiler {
|
|
|
79294
79328
|
source = traversal.traverse(child?.findDirectExpression(core_1.Expressions.Source));
|
|
79295
79329
|
target = `abap.statements.moveCorresponding(${source.getCode()}, ${target})`;
|
|
79296
79330
|
}
|
|
79331
|
+
else if (c instanceof core_1.Expressions.CorrespondingBodyMapping && child instanceof core_1.Nodes.ExpressionNode) {
|
|
79332
|
+
for (const cc of child.getChildren()) {
|
|
79333
|
+
if (cc.get() instanceof core_1.Expressions.ComponentName) {
|
|
79334
|
+
mappingRow.componentName = cc;
|
|
79335
|
+
}
|
|
79336
|
+
else if (cc.get() instanceof core_1.Expressions.ComponentChain) {
|
|
79337
|
+
mappingRow.componentChain = cc;
|
|
79338
|
+
mapping.push(mappingRow);
|
|
79339
|
+
}
|
|
79340
|
+
}
|
|
79341
|
+
}
|
|
79297
79342
|
else {
|
|
79298
|
-
throw new Error("CorrespondingBodyTranspiler, todo, " + c.constructor.name);
|
|
79343
|
+
throw new Error("CorrespondingBodyTranspiler, todo, " + c.constructor.name + ", " + body.concatTokens());
|
|
79299
79344
|
}
|
|
79300
79345
|
}
|
|
79301
79346
|
const ret = new chunk_1.Chunk();
|
|
79302
|
-
|
|
79347
|
+
const id = unique_identifier_1.UniqueIdentifier.get();
|
|
79348
|
+
ret.appendString("(await (async () => {\n");
|
|
79349
|
+
ret.appendString(`const ${id} = ${target};\n`);
|
|
79350
|
+
ret.appendString(`abap.statements.moveCorresponding(${source.getCode()}, ${id});\n`);
|
|
79351
|
+
for (const map of mapping) {
|
|
79352
|
+
const componentName = map.componentName.concatTokens().toLowerCase();
|
|
79353
|
+
const chain = new component_chain_1.ComponentChainTranspiler().transpile(map.componentChain, traversal).getCode();
|
|
79354
|
+
ret.appendString(`${id}.get().${componentName}.set(${source.getCode()}.get().${chain});\n`);
|
|
79355
|
+
}
|
|
79356
|
+
ret.appendString("return " + id + ";\n");
|
|
79357
|
+
ret.appendString("})())");
|
|
79303
79358
|
return ret;
|
|
79304
79359
|
}
|
|
79305
79360
|
}
|
|
@@ -79646,7 +79701,7 @@ class FilterBodyTranspiler {
|
|
|
79646
79701
|
throw new Error("FilterBodyTranspiler, Expected TypeNameOrInfer");
|
|
79647
79702
|
}
|
|
79648
79703
|
else if (body.findDirectTokenByText("EXCEPT")) {
|
|
79649
|
-
return new chunk_1.Chunk(`throw new Error("FilterBodyTranspiler EXCEPT in, not supported, transpiler")
|
|
79704
|
+
return new chunk_1.Chunk(`(() => { throw new Error("FilterBodyTranspiler EXCEPT in, not supported, transpiler"); })()`);
|
|
79650
79705
|
}
|
|
79651
79706
|
const source = traversal.traverse(body.findDirectExpression(core_1.Expressions.Source)).getCode();
|
|
79652
79707
|
const type = new type_name_or_infer_1.TypeNameOrInfer().findType(typ, traversal);
|
|
@@ -92406,7 +92461,6 @@ exports.config = {
|
|
|
92406
92461
|
"begin_end_names": true,
|
|
92407
92462
|
"check_syntax": true,
|
|
92408
92463
|
"form_no_dash": true,
|
|
92409
|
-
"omit_preceding_zeros": true,
|
|
92410
92464
|
"obsolete_statement": {
|
|
92411
92465
|
"setExtended": true,
|
|
92412
92466
|
},
|
package/build/types.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export interface ITranspilerConfig {
|
|
|
3
3
|
input_folder: string | string[];
|
|
4
4
|
/** list of regex, case insensitive, empty gives all files, positive list */
|
|
5
5
|
input_filter?: string[];
|
|
6
|
+
/** list of regex, case insensitive */
|
|
7
|
+
exclude_filter?: string[];
|
|
6
8
|
output_folder: string;
|
|
7
9
|
/** to be deprecated, "lib", use "libs" instead
|
|
8
10
|
* @deprecated
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.71",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -27,10 +27,10 @@
|
|
|
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.195",
|
|
31
|
+
"@abaplint/transpiler": "^2.11.71",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
|
-
"@types/node": "^24.3.
|
|
33
|
+
"@types/node": "^24.3.1",
|
|
34
34
|
"@types/progress": "^2.0.7",
|
|
35
35
|
"glob": "=7.2.0",
|
|
36
36
|
"progress": "^2.0.3",
|