@abaplint/transpiler-cli 2.10.13 → 2.10.15
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 +5 -112
- 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",
|
|
@@ -79371,98 +79368,10 @@ exports.DEFAULT_KEYWORDS = [
|
|
|
79371
79368
|
"switch", "synchronized", "this",
|
|
79372
79369
|
"throw", "throws", "transient", "true",
|
|
79373
79370
|
"try", "typeof", "var", "void",
|
|
79371
|
+
"delete",
|
|
79374
79372
|
"volatile", "while", "yield"
|
|
79375
79373
|
];
|
|
79376
79374
|
// "with"
|
|
79377
|
-
// "delete"
|
|
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 ")
|
|
@@ -87333,7 +87242,7 @@ class Traversal {
|
|
|
87333
87242
|
}
|
|
87334
87243
|
}
|
|
87335
87244
|
};
|
|
87336
|
-
handle(val, name);
|
|
87245
|
+
handle(val, Traversal.prefixVariable(name));
|
|
87337
87246
|
return ret;
|
|
87338
87247
|
}
|
|
87339
87248
|
buildInternalName(name, def) {
|
|
@@ -87868,14 +87777,10 @@ exports.UnitTest = UnitTest;
|
|
|
87868
87777
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
87869
87778
|
exports.Validation = exports.config = void 0;
|
|
87870
87779
|
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
87780
|
const types_1 = __webpack_require__(/*! ./types */ "./node_modules/@abaplint/transpiler/build/src/types.js");
|
|
87873
87781
|
exports.config = {
|
|
87874
87782
|
"global": {
|
|
87875
87783
|
"files": "/**/*.*",
|
|
87876
|
-
"skipGeneratedGatewayClasses": true,
|
|
87877
|
-
"skipGeneratedPersistentClasses": true,
|
|
87878
|
-
"skipGeneratedFunctionGroups": true,
|
|
87879
87784
|
},
|
|
87880
87785
|
"syntax": {
|
|
87881
87786
|
"version": core_1.Version.OpenABAP,
|
|
@@ -87985,18 +87890,6 @@ class Validation {
|
|
|
87985
87890
|
exports.config.rules.check_syntax = true;
|
|
87986
87891
|
}
|
|
87987
87892
|
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
87893
|
if (this.options?.unknownTypes === types_1.UnknownTypesEnum.runtimeError) {
|
|
88001
87894
|
// this is not a constant, just a regex that happens to not match anything
|
|
88002
87895
|
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.15",
|
|
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.15",
|
|
30
30
|
"@types/glob": "^8.1.0",
|
|
31
31
|
"glob": "=7.2.0",
|
|
32
32
|
"@types/progress": "^2.0.7",
|