@abaplint/transpiler-cli 2.10.14 → 2.10.16
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 +42 -111
- package/package.json +2 -2
package/build/bundle.js
CHANGED
|
@@ -79237,7 +79237,6 @@ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abap
|
|
|
79237
79237
|
const validation_1 = __webpack_require__(/*! ./validation */ "./node_modules/@abaplint/transpiler/build/src/validation.js");
|
|
79238
79238
|
Object.defineProperty(exports, "config", ({ enumerable: true, get: function () { return validation_1.config; } }));
|
|
79239
79239
|
const unit_test_1 = __webpack_require__(/*! ./unit_test */ "./node_modules/@abaplint/transpiler/build/src/unit_test.js");
|
|
79240
|
-
const keywords_1 = __webpack_require__(/*! ./keywords */ "./node_modules/@abaplint/transpiler/build/src/keywords.js");
|
|
79241
79240
|
const types_1 = __webpack_require__(/*! ./types */ "./node_modules/@abaplint/transpiler/build/src/types.js");
|
|
79242
79241
|
Object.defineProperty(exports, "UnknownTypesEnum", ({ enumerable: true, get: function () { return types_1.UnknownTypesEnum; } }));
|
|
79243
79242
|
const db_1 = __webpack_require__(/*! ./db */ "./node_modules/@abaplint/transpiler/build/src/db/index.js");
|
|
@@ -79271,7 +79270,6 @@ class Transpiler {
|
|
|
79271
79270
|
}
|
|
79272
79271
|
async run(reg, progress) {
|
|
79273
79272
|
reg.parse();
|
|
79274
|
-
new keywords_1.Keywords(this.options?.keywords).handle(reg);
|
|
79275
79273
|
this.validate(reg);
|
|
79276
79274
|
const dbSetup = new db_1.DatabaseSetup(reg).run(this.options);
|
|
79277
79275
|
const output = {
|
|
@@ -79346,13 +79344,12 @@ exports.Transpiler = Transpiler;
|
|
|
79346
79344
|
/*!*****************************************************************!*\
|
|
79347
79345
|
!*** ./node_modules/@abaplint/transpiler/build/src/keywords.js ***!
|
|
79348
79346
|
\*****************************************************************/
|
|
79349
|
-
/***/ ((__unused_webpack_module, exports
|
|
79347
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
79350
79348
|
|
|
79351
79349
|
"use strict";
|
|
79352
79350
|
|
|
79353
79351
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
79354
|
-
exports.
|
|
79355
|
-
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
79352
|
+
exports.DEFAULT_KEYWORDS = void 0;
|
|
79356
79353
|
// https://www.w3schools.com/js/js_reserved.asp
|
|
79357
79354
|
exports.DEFAULT_KEYWORDS = [
|
|
79358
79355
|
"abstract", "arguments", "await",
|
|
@@ -79375,94 +79372,6 @@ exports.DEFAULT_KEYWORDS = [
|
|
|
79375
79372
|
"volatile", "while", "yield"
|
|
79376
79373
|
];
|
|
79377
79374
|
// "with"
|
|
79378
|
-
/** Replaces javascript keywords in ABAP source code, in-memory only */
|
|
79379
|
-
class Keywords {
|
|
79380
|
-
constructor(keywords) {
|
|
79381
|
-
this.keywords = [];
|
|
79382
|
-
if (keywords !== undefined) {
|
|
79383
|
-
this.keywords = keywords;
|
|
79384
|
-
}
|
|
79385
|
-
else {
|
|
79386
|
-
this.keywords = exports.DEFAULT_KEYWORDS;
|
|
79387
|
-
}
|
|
79388
|
-
}
|
|
79389
|
-
handle(reg) {
|
|
79390
|
-
if (this.keywords.length === 0) {
|
|
79391
|
-
return;
|
|
79392
|
-
}
|
|
79393
|
-
reg.parse();
|
|
79394
|
-
for (const o of reg.getObjects()) {
|
|
79395
|
-
if (!(o instanceof abaplint.ABAPObject)) {
|
|
79396
|
-
continue;
|
|
79397
|
-
}
|
|
79398
|
-
for (const f of o.getABAPFiles()) {
|
|
79399
|
-
const tokens = [];
|
|
79400
|
-
for (const s of f.getStatements()) {
|
|
79401
|
-
if (s.get() instanceof abaplint.MacroCall) {
|
|
79402
|
-
tokens.push(...this.handleMacro(s));
|
|
79403
|
-
}
|
|
79404
|
-
else {
|
|
79405
|
-
tokens.push(...this.traverse(s, f));
|
|
79406
|
-
}
|
|
79407
|
-
}
|
|
79408
|
-
if (tokens.length === 0) {
|
|
79409
|
-
continue;
|
|
79410
|
-
}
|
|
79411
|
-
const rows = f.getRawRows();
|
|
79412
|
-
for (const t of tokens.reverse()) {
|
|
79413
|
-
const original = rows[t.getRow() - 1];
|
|
79414
|
-
const index = t.getEnd().getCol() - 1;
|
|
79415
|
-
rows[t.getRow() - 1] = original.substring(0, index) + "_" + original.substring(index);
|
|
79416
|
-
}
|
|
79417
|
-
reg.updateFile(new abaplint.MemoryFile(f.getFilename(), rows.join("\n")));
|
|
79418
|
-
}
|
|
79419
|
-
}
|
|
79420
|
-
reg.parse();
|
|
79421
|
-
}
|
|
79422
|
-
handleMacro(node) {
|
|
79423
|
-
const tokens = [];
|
|
79424
|
-
for (const token of node.getTokens()) {
|
|
79425
|
-
for (const k of this.keywords) {
|
|
79426
|
-
const lower = token.getStr().toLowerCase();
|
|
79427
|
-
if (k === lower
|
|
79428
|
-
|| "!" + k === lower
|
|
79429
|
-
|| lower.endsWith("~" + k)) {
|
|
79430
|
-
tokens.push(token);
|
|
79431
|
-
}
|
|
79432
|
-
}
|
|
79433
|
-
}
|
|
79434
|
-
return tokens;
|
|
79435
|
-
}
|
|
79436
|
-
traverse(node, file) {
|
|
79437
|
-
const ret = [];
|
|
79438
|
-
for (const c of node.getChildren()) {
|
|
79439
|
-
if (c instanceof abaplint.Nodes.TokenNodeRegex) {
|
|
79440
|
-
const token = c.getFirstToken();
|
|
79441
|
-
const start = token.getStart();
|
|
79442
|
-
if (start instanceof abaplint.VirtualPosition) {
|
|
79443
|
-
continue;
|
|
79444
|
-
}
|
|
79445
|
-
for (const k of this.keywords) {
|
|
79446
|
-
const lower = token.getStr().toLowerCase();
|
|
79447
|
-
if (k === lower
|
|
79448
|
-
|| "!" + k === lower
|
|
79449
|
-
|| lower.endsWith("~" + k)) {
|
|
79450
|
-
ret.push(token);
|
|
79451
|
-
break;
|
|
79452
|
-
}
|
|
79453
|
-
}
|
|
79454
|
-
}
|
|
79455
|
-
else if (c instanceof abaplint.Nodes.TokenNode) {
|
|
79456
|
-
continue;
|
|
79457
|
-
}
|
|
79458
|
-
else {
|
|
79459
|
-
ret.push(...this.traverse(c, file));
|
|
79460
|
-
}
|
|
79461
|
-
}
|
|
79462
|
-
return ret;
|
|
79463
|
-
}
|
|
79464
|
-
}
|
|
79465
|
-
exports.Keywords = Keywords;
|
|
79466
79375
|
//# sourceMappingURL=keywords.js.map
|
|
79467
79376
|
|
|
79468
79377
|
/***/ }),
|
|
@@ -81093,7 +81002,7 @@ class DataTranspiler {
|
|
|
81093
81002
|
value = "\n" + traversal.setValues(found, found.getName());
|
|
81094
81003
|
}
|
|
81095
81004
|
else {
|
|
81096
|
-
value = DataTranspiler.buildValue(node, found.getName().toLowerCase(), traversal);
|
|
81005
|
+
value = DataTranspiler.buildValue(node, traversal_1.Traversal.prefixVariable(found.getName().toLowerCase()), traversal);
|
|
81097
81006
|
}
|
|
81098
81007
|
const ret = new chunk_1.Chunk()
|
|
81099
81008
|
.appendString("let ")
|
|
@@ -81754,6 +81663,43 @@ exports.EndWhileTranspiler = EndWhileTranspiler;
|
|
|
81754
81663
|
|
|
81755
81664
|
/***/ }),
|
|
81756
81665
|
|
|
81666
|
+
/***/ "./node_modules/@abaplint/transpiler/build/src/statements/enhancement_point.js":
|
|
81667
|
+
/*!*************************************************************************************!*\
|
|
81668
|
+
!*** ./node_modules/@abaplint/transpiler/build/src/statements/enhancement_point.js ***!
|
|
81669
|
+
\*************************************************************************************/
|
|
81670
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
81671
|
+
|
|
81672
|
+
"use strict";
|
|
81673
|
+
|
|
81674
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
81675
|
+
exports.EnhancementPointTranspiler = void 0;
|
|
81676
|
+
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
81677
|
+
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
81678
|
+
class EnhancementPointTranspiler {
|
|
81679
|
+
transpile(_node, _traversal) {
|
|
81680
|
+
// for now, do nothing, but leave a comment
|
|
81681
|
+
// ENHANCEMENT-POINT enh_id SPOTS spot1 spot2 ... [STATIC] [INCLUDE BOUND].
|
|
81682
|
+
let enhId = "";
|
|
81683
|
+
const spots = [];
|
|
81684
|
+
for (const tn of _node.getTokenNodes()) {
|
|
81685
|
+
if (tn instanceof abaplint.Nodes.TokenNodeRegex) {
|
|
81686
|
+
if (!enhId) {
|
|
81687
|
+
enhId = tn.get().getStr();
|
|
81688
|
+
}
|
|
81689
|
+
else {
|
|
81690
|
+
spots.push(tn.get().getStr());
|
|
81691
|
+
}
|
|
81692
|
+
}
|
|
81693
|
+
}
|
|
81694
|
+
// [Transpiler] EnhancementPoint not implemented. Ignoring 'enh_id' spots 'spot1', 'spot2' ...
|
|
81695
|
+
return new chunk_1.Chunk(`// [Transpiler] EnhancementPoint not implemented. Ignoring '${enhId}' spots '${spots.join("', '")}'`);
|
|
81696
|
+
}
|
|
81697
|
+
}
|
|
81698
|
+
exports.EnhancementPointTranspiler = EnhancementPointTranspiler;
|
|
81699
|
+
//# sourceMappingURL=enhancement_point.js.map
|
|
81700
|
+
|
|
81701
|
+
/***/ }),
|
|
81702
|
+
|
|
81757
81703
|
/***/ "./node_modules/@abaplint/transpiler/build/src/statements/enhancement_section.js":
|
|
81758
81704
|
/*!***************************************************************************************!*\
|
|
81759
81705
|
!*** ./node_modules/@abaplint/transpiler/build/src/statements/enhancement_section.js ***!
|
|
@@ -82460,6 +82406,7 @@ __exportStar(__webpack_require__(/*! ./end_loop */ "./node_modules/@abaplint/tra
|
|
|
82460
82406
|
__exportStar(__webpack_require__(/*! ./end_method */ "./node_modules/@abaplint/transpiler/build/src/statements/end_method.js"), exports);
|
|
82461
82407
|
__exportStar(__webpack_require__(/*! ./end_try */ "./node_modules/@abaplint/transpiler/build/src/statements/end_try.js"), exports);
|
|
82462
82408
|
__exportStar(__webpack_require__(/*! ./end_while */ "./node_modules/@abaplint/transpiler/build/src/statements/end_while.js"), exports);
|
|
82409
|
+
__exportStar(__webpack_require__(/*! ./enhancement_point */ "./node_modules/@abaplint/transpiler/build/src/statements/enhancement_point.js"), exports);
|
|
82463
82410
|
__exportStar(__webpack_require__(/*! ./enhancement_section */ "./node_modules/@abaplint/transpiler/build/src/statements/enhancement_section.js"), exports);
|
|
82464
82411
|
__exportStar(__webpack_require__(/*! ./exit */ "./node_modules/@abaplint/transpiler/build/src/statements/exit.js"), exports);
|
|
82465
82412
|
__exportStar(__webpack_require__(/*! ./export */ "./node_modules/@abaplint/transpiler/build/src/statements/export.js"), exports);
|
|
@@ -87333,7 +87280,7 @@ class Traversal {
|
|
|
87333
87280
|
}
|
|
87334
87281
|
}
|
|
87335
87282
|
};
|
|
87336
|
-
handle(val, name);
|
|
87283
|
+
handle(val, Traversal.prefixVariable(name));
|
|
87337
87284
|
return ret;
|
|
87338
87285
|
}
|
|
87339
87286
|
buildInternalName(name, def) {
|
|
@@ -87868,14 +87815,10 @@ exports.UnitTest = UnitTest;
|
|
|
87868
87815
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
87869
87816
|
exports.Validation = exports.config = void 0;
|
|
87870
87817
|
const core_1 = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
87871
|
-
const keywords_1 = __webpack_require__(/*! ./keywords */ "./node_modules/@abaplint/transpiler/build/src/keywords.js");
|
|
87872
87818
|
const types_1 = __webpack_require__(/*! ./types */ "./node_modules/@abaplint/transpiler/build/src/types.js");
|
|
87873
87819
|
exports.config = {
|
|
87874
87820
|
"global": {
|
|
87875
87821
|
"files": "/**/*.*",
|
|
87876
|
-
"skipGeneratedGatewayClasses": true,
|
|
87877
|
-
"skipGeneratedPersistentClasses": true,
|
|
87878
|
-
"skipGeneratedFunctionGroups": true,
|
|
87879
87822
|
},
|
|
87880
87823
|
"syntax": {
|
|
87881
87824
|
"version": core_1.Version.OpenABAP,
|
|
@@ -87985,18 +87928,6 @@ class Validation {
|
|
|
87985
87928
|
exports.config.rules.check_syntax = true;
|
|
87986
87929
|
}
|
|
87987
87930
|
exports.config.rules.forbidden_identifier.check = ["^unique\\d+$"];
|
|
87988
|
-
if (this.options?.keywords === undefined) {
|
|
87989
|
-
for (const d of keywords_1.DEFAULT_KEYWORDS) {
|
|
87990
|
-
const add = "^" + d + "$";
|
|
87991
|
-
exports.config.rules["forbidden_identifier"]["check"].push(add);
|
|
87992
|
-
}
|
|
87993
|
-
}
|
|
87994
|
-
else {
|
|
87995
|
-
for (const d of this.options.keywords) {
|
|
87996
|
-
const add = "^" + d + "$";
|
|
87997
|
-
exports.config.rules["forbidden_identifier"]["check"].push(add);
|
|
87998
|
-
}
|
|
87999
|
-
}
|
|
88000
87931
|
if (this.options?.unknownTypes === types_1.UnknownTypesEnum.runtimeError) {
|
|
88001
87932
|
// this is not a constant, just a regex that happens to not match anything
|
|
88002
87933
|
exports.config.syntax.errorNamespace = "VOID_EVERYTHING";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.16",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"author": "abaplint",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@abaplint/transpiler": "^2.10.
|
|
29
|
+
"@abaplint/transpiler": "^2.10.16",
|
|
30
30
|
"@types/glob": "^8.1.0",
|
|
31
31
|
"glob": "=7.2.0",
|
|
32
32
|
"@types/progress": "^2.0.7",
|