@abaplint/transpiler-cli 2.10.62 → 2.10.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 +59 -12
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -82865,7 +82865,14 @@ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/tr
|
|
|
82865
82865
|
class CollectTranspiler {
|
|
82866
82866
|
transpile(node, traversal) {
|
|
82867
82867
|
const source = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Source));
|
|
82868
|
-
const
|
|
82868
|
+
const targetExpression = node.findDirectExpression(abaplint.Expressions.Target);
|
|
82869
|
+
if (targetExpression === undefined) {
|
|
82870
|
+
return new chunk_1.Chunk()
|
|
82871
|
+
.appendString("abap.statements.collect(")
|
|
82872
|
+
.appendChunk(source)
|
|
82873
|
+
.appendString(");");
|
|
82874
|
+
}
|
|
82875
|
+
const target = traversal.traverse(targetExpression);
|
|
82869
82876
|
const fstarget = node.findDirectExpression(abaplint.Expressions.FSTarget);
|
|
82870
82877
|
if (fstarget) {
|
|
82871
82878
|
return new chunk_1.Chunk(`throw new Error("Collect, transpiler todo");`);
|
|
@@ -84711,7 +84718,6 @@ __exportStar(__webpack_require__(/*! ./close_dataset */ "./node_modules/@abaplin
|
|
|
84711
84718
|
__exportStar(__webpack_require__(/*! ./collect */ "./node_modules/@abaplint/transpiler/build/src/statements/collect.js"), exports);
|
|
84712
84719
|
__exportStar(__webpack_require__(/*! ./commit */ "./node_modules/@abaplint/transpiler/build/src/statements/commit.js"), exports);
|
|
84713
84720
|
__exportStar(__webpack_require__(/*! ./compute */ "./node_modules/@abaplint/transpiler/build/src/statements/compute.js"), exports);
|
|
84714
|
-
__exportStar(__webpack_require__(/*! ./program */ "./node_modules/@abaplint/transpiler/build/src/statements/program.js"), exports);
|
|
84715
84721
|
__exportStar(__webpack_require__(/*! ./concatenate */ "./node_modules/@abaplint/transpiler/build/src/statements/concatenate.js"), exports);
|
|
84716
84722
|
__exportStar(__webpack_require__(/*! ./condense */ "./node_modules/@abaplint/transpiler/build/src/statements/condense.js"), exports);
|
|
84717
84723
|
__exportStar(__webpack_require__(/*! ./constant */ "./node_modules/@abaplint/transpiler/build/src/statements/constant.js"), exports);
|
|
@@ -84723,8 +84729,8 @@ __exportStar(__webpack_require__(/*! ./data */ "./node_modules/@abaplint/transpi
|
|
|
84723
84729
|
__exportStar(__webpack_require__(/*! ./delete_database */ "./node_modules/@abaplint/transpiler/build/src/statements/delete_database.js"), exports);
|
|
84724
84730
|
__exportStar(__webpack_require__(/*! ./delete_dataset */ "./node_modules/@abaplint/transpiler/build/src/statements/delete_dataset.js"), exports);
|
|
84725
84731
|
__exportStar(__webpack_require__(/*! ./delete_internal */ "./node_modules/@abaplint/transpiler/build/src/statements/delete_internal.js"), exports);
|
|
84726
|
-
__exportStar(__webpack_require__(/*! ./delete_report */ "./node_modules/@abaplint/transpiler/build/src/statements/delete_report.js"), exports);
|
|
84727
84732
|
__exportStar(__webpack_require__(/*! ./delete_memory */ "./node_modules/@abaplint/transpiler/build/src/statements/delete_memory.js"), exports);
|
|
84733
|
+
__exportStar(__webpack_require__(/*! ./delete_report */ "./node_modules/@abaplint/transpiler/build/src/statements/delete_report.js"), exports);
|
|
84728
84734
|
__exportStar(__webpack_require__(/*! ./delete_textpool */ "./node_modules/@abaplint/transpiler/build/src/statements/delete_textpool.js"), exports);
|
|
84729
84735
|
__exportStar(__webpack_require__(/*! ./describe */ "./node_modules/@abaplint/transpiler/build/src/statements/describe.js"), exports);
|
|
84730
84736
|
__exportStar(__webpack_require__(/*! ./do */ "./node_modules/@abaplint/transpiler/build/src/statements/do.js"), exports);
|
|
@@ -84785,8 +84791,10 @@ __exportStar(__webpack_require__(/*! ./open_dataset */ "./node_modules/@abaplint
|
|
|
84785
84791
|
__exportStar(__webpack_require__(/*! ./overlay */ "./node_modules/@abaplint/transpiler/build/src/statements/overlay.js"), exports);
|
|
84786
84792
|
__exportStar(__webpack_require__(/*! ./parameter */ "./node_modules/@abaplint/transpiler/build/src/statements/parameter.js"), exports);
|
|
84787
84793
|
__exportStar(__webpack_require__(/*! ./perform */ "./node_modules/@abaplint/transpiler/build/src/statements/perform.js"), exports);
|
|
84794
|
+
__exportStar(__webpack_require__(/*! ./program */ "./node_modules/@abaplint/transpiler/build/src/statements/program.js"), exports);
|
|
84788
84795
|
__exportStar(__webpack_require__(/*! ./raise_event */ "./node_modules/@abaplint/transpiler/build/src/statements/raise_event.js"), exports);
|
|
84789
84796
|
__exportStar(__webpack_require__(/*! ./raise */ "./node_modules/@abaplint/transpiler/build/src/statements/raise.js"), exports);
|
|
84797
|
+
__exportStar(__webpack_require__(/*! ./ranges */ "./node_modules/@abaplint/transpiler/build/src/statements/ranges.js"), exports);
|
|
84790
84798
|
__exportStar(__webpack_require__(/*! ./read_dataset */ "./node_modules/@abaplint/transpiler/build/src/statements/read_dataset.js"), exports);
|
|
84791
84799
|
__exportStar(__webpack_require__(/*! ./read_line */ "./node_modules/@abaplint/transpiler/build/src/statements/read_line.js"), exports);
|
|
84792
84800
|
__exportStar(__webpack_require__(/*! ./read_report */ "./node_modules/@abaplint/transpiler/build/src/statements/read_report.js"), exports);
|
|
@@ -86047,6 +86055,47 @@ exports.RaiseEventTranspiler = RaiseEventTranspiler;
|
|
|
86047
86055
|
|
|
86048
86056
|
/***/ }),
|
|
86049
86057
|
|
|
86058
|
+
/***/ "./node_modules/@abaplint/transpiler/build/src/statements/ranges.js":
|
|
86059
|
+
/*!**************************************************************************!*\
|
|
86060
|
+
!*** ./node_modules/@abaplint/transpiler/build/src/statements/ranges.js ***!
|
|
86061
|
+
\**************************************************************************/
|
|
86062
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
86063
|
+
|
|
86064
|
+
"use strict";
|
|
86065
|
+
|
|
86066
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
86067
|
+
exports.RangesTranspiler = void 0;
|
|
86068
|
+
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
86069
|
+
const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@abaplint/transpiler/build/src/traversal.js");
|
|
86070
|
+
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
86071
|
+
const transpile_types_1 = __webpack_require__(/*! ../transpile_types */ "./node_modules/@abaplint/transpiler/build/src/transpile_types.js");
|
|
86072
|
+
class RangesTranspiler {
|
|
86073
|
+
transpile(node, traversal) {
|
|
86074
|
+
const token = node.findFirstExpression(abaplint.Expressions.SimpleName)?.getFirstToken();
|
|
86075
|
+
if (token === undefined) {
|
|
86076
|
+
throw new Error("RangesTranspiler, token not found");
|
|
86077
|
+
}
|
|
86078
|
+
const scope = traversal.findCurrentScopeByToken(token);
|
|
86079
|
+
if (scope === undefined) {
|
|
86080
|
+
throw new Error("RangesTranspiler, scope not found: " + node.concatTokens());
|
|
86081
|
+
}
|
|
86082
|
+
const found = scope.findVariable(token.getStr());
|
|
86083
|
+
if (found === undefined) {
|
|
86084
|
+
throw new Error("RangesTranspiler, var not found, \"" + token.getStr() + "\", " + traversal.getFilename() + ", line: " + token.getRow());
|
|
86085
|
+
}
|
|
86086
|
+
const ret = new chunk_1.Chunk()
|
|
86087
|
+
.appendString("let ")
|
|
86088
|
+
.appendString(traversal_1.Traversal.prefixVariable(traversal_1.Traversal.escapeNamespace(found.getName().toLowerCase())))
|
|
86089
|
+
.appendString(" = " + new transpile_types_1.TranspileTypes().toType(found.getType()))
|
|
86090
|
+
.appendString(";");
|
|
86091
|
+
return ret;
|
|
86092
|
+
}
|
|
86093
|
+
}
|
|
86094
|
+
exports.RangesTranspiler = RangesTranspiler;
|
|
86095
|
+
//# sourceMappingURL=ranges.js.map
|
|
86096
|
+
|
|
86097
|
+
/***/ }),
|
|
86098
|
+
|
|
86050
86099
|
/***/ "./node_modules/@abaplint/transpiler/build/src/statements/read_dataset.js":
|
|
86051
86100
|
/*!********************************************************************************!*\
|
|
86052
86101
|
!*** ./node_modules/@abaplint/transpiler/build/src/statements/read_dataset.js ***!
|
|
@@ -101346,7 +101395,7 @@ class Progress {
|
|
|
101346
101395
|
this.bar.render();
|
|
101347
101396
|
}
|
|
101348
101397
|
}
|
|
101349
|
-
function loadLib(config) {
|
|
101398
|
+
async function loadLib(config) {
|
|
101350
101399
|
const files = [];
|
|
101351
101400
|
if (config.lib && config.lib !== "" && config.libs === undefined) {
|
|
101352
101401
|
config.libs = [{ url: config.lib }];
|
|
@@ -101364,7 +101413,6 @@ function loadLib(config) {
|
|
|
101364
101413
|
childProcess.execSync("git clone --quiet --depth 1 " + l.url + " .", { cwd: dir, stdio: "inherit" });
|
|
101365
101414
|
cleanupFolder = true;
|
|
101366
101415
|
}
|
|
101367
|
-
let count = 0;
|
|
101368
101416
|
let patterns = ["/src/**"];
|
|
101369
101417
|
if (l.files !== undefined && typeof l.files === "string" && l.files !== "") {
|
|
101370
101418
|
patterns = [l.files];
|
|
@@ -101372,18 +101420,17 @@ function loadLib(config) {
|
|
|
101372
101420
|
else if (Array.isArray(l.files)) {
|
|
101373
101421
|
patterns = l.files;
|
|
101374
101422
|
}
|
|
101423
|
+
const filesToRead = [];
|
|
101375
101424
|
for (const pattern of patterns) {
|
|
101376
|
-
for (
|
|
101425
|
+
for (const filename of glob.sync(dir + pattern, { nosort: true, nodir: true })) {
|
|
101377
101426
|
if (filename.endsWith(".clas.testclasses.abap")) {
|
|
101378
101427
|
continue;
|
|
101379
101428
|
}
|
|
101380
|
-
|
|
101381
|
-
filename = path.basename(filename);
|
|
101382
|
-
files.push({ filename, contents });
|
|
101383
|
-
count++;
|
|
101429
|
+
filesToRead.push(filename);
|
|
101384
101430
|
}
|
|
101385
101431
|
}
|
|
101386
|
-
|
|
101432
|
+
files.push(...await file_operations_1.FileOperations.readAllFiles(filesToRead, ""));
|
|
101433
|
+
console.log("\t" + filesToRead.length + " files added from lib");
|
|
101387
101434
|
if (cleanupFolder === true) {
|
|
101388
101435
|
file_operations_1.FileOperations.deleteFolderRecursive(dir);
|
|
101389
101436
|
}
|
|
@@ -101427,7 +101474,7 @@ function writeObjects(objects, config, outputFolder, files) {
|
|
|
101427
101474
|
async function run() {
|
|
101428
101475
|
console.log("Transpiler CLI");
|
|
101429
101476
|
const config = config_1.TranspilerConfig.find(process.argv[2]);
|
|
101430
|
-
const libFiles = loadLib(config);
|
|
101477
|
+
const libFiles = await loadLib(config);
|
|
101431
101478
|
const files = await file_operations_1.FileOperations.loadFiles(config);
|
|
101432
101479
|
console.log("\nBuilding");
|
|
101433
101480
|
const t = new Transpiler.Transpiler(config.options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.64",
|
|
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.136",
|
|
31
|
-
"@abaplint/transpiler": "^2.10.
|
|
31
|
+
"@abaplint/transpiler": "^2.10.64",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
33
|
"@types/node": "^22.16.0",
|
|
34
34
|
"@types/progress": "^2.0.7",
|