@abaplint/transpiler-cli 2.5.4 → 2.5.6
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 +99 -30
- package/package.json +3 -3
package/build/bundle.js
CHANGED
|
@@ -4391,7 +4391,8 @@ class InlineData extends combi_1.Expression {
|
|
|
4391
4391
|
const right = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.ParenRight));
|
|
4392
4392
|
const left = (0, combi_1.tok)(tokens_1.ParenLeft);
|
|
4393
4393
|
const data = (0, combi_1.seq)("DATA", left, _1.TargetField, right);
|
|
4394
|
-
|
|
4394
|
+
const final = (0, combi_1.seq)("FINAL", left, _1.TargetField, right);
|
|
4395
|
+
return (0, combi_1.altPrio)((0, combi_1.ver)(version_1.Version.v740sp02, data), (0, combi_1.ver)(version_1.Version.v757, final));
|
|
4395
4396
|
}
|
|
4396
4397
|
}
|
|
4397
4398
|
exports.InlineData = InlineData;
|
|
@@ -8174,6 +8175,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
8174
8175
|
exports.Assign = void 0;
|
|
8175
8176
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
8176
8177
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
8178
|
+
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
8177
8179
|
class Assign {
|
|
8178
8180
|
getMatcher() {
|
|
8179
8181
|
const type = (0, combi_1.seq)("TYPE", (0, combi_1.altPrio)(expressions_1.Dynamic, expressions_1.TypeName));
|
|
@@ -8183,7 +8185,7 @@ class Assign {
|
|
|
8183
8185
|
const decimals = (0, combi_1.seq)("DECIMALS", expressions_1.Source);
|
|
8184
8186
|
const casting = (0, combi_1.seq)("CASTING", (0, combi_1.opt)((0, combi_1.alt)(like, handle, (0, combi_1.per)(type, decimals))));
|
|
8185
8187
|
const obsoleteType = (0, combi_1.seq)("TYPE", expressions_1.Source, (0, combi_1.optPrio)(decimals));
|
|
8186
|
-
const ret = (0, combi_1.seq)("ASSIGN", (0, combi_1.opt)((0, combi_1.seq)(expressions_1.Target, "INCREMENT")), expressions_1.AssignSource, "TO", expressions_1.FSTarget, (0, combi_1.opt)((0, combi_1.altPrio)(casting, obsoleteType)), (0, combi_1.opt)(range));
|
|
8188
|
+
const ret = (0, combi_1.seq)("ASSIGN", (0, combi_1.opt)((0, combi_1.seq)(expressions_1.Target, "INCREMENT")), expressions_1.AssignSource, "TO", expressions_1.FSTarget, (0, combi_1.opt)((0, combi_1.altPrio)(casting, obsoleteType)), (0, combi_1.opt)(range), (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v757, "ELSE UNASSIGN")));
|
|
8187
8189
|
return ret;
|
|
8188
8190
|
}
|
|
8189
8191
|
}
|
|
@@ -11699,7 +11701,6 @@ exports.Import = void 0;
|
|
|
11699
11701
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
11700
11702
|
const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
11701
11703
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
11702
|
-
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
11703
11704
|
class Import {
|
|
11704
11705
|
getMatcher() {
|
|
11705
11706
|
const dto = (0, combi_1.seq)("TO", expressions_1.Target);
|
|
@@ -11718,7 +11719,7 @@ class Import {
|
|
|
11718
11719
|
const target = (0, combi_1.alt)(toeq, to, expressions_1.Dynamic, (0, combi_1.plus)(expressions_1.Target));
|
|
11719
11720
|
const options = (0, combi_1.per)("ACCEPTING PADDING", "IGNORING CONVERSION ERRORS", "IN CHAR-TO-HEX MODE", "IGNORING STRUCTURE BOUNDARIES", "ACCEPTING TRUNCATION", (0, combi_1.seq)("REPLACEMENT CHARACTER", expressions_1.Source), (0, combi_1.seq)("CODE PAGE INTO", expressions_1.Source), (0, combi_1.seq)("ENDIAN INTO", expressions_1.Source));
|
|
11720
11721
|
const ret = (0, combi_1.seq)("IMPORT", target, "FROM", source, (0, combi_1.opt)(options));
|
|
11721
|
-
return
|
|
11722
|
+
return ret;
|
|
11722
11723
|
}
|
|
11723
11724
|
}
|
|
11724
11725
|
exports.Import = Import;
|
|
@@ -21570,9 +21571,31 @@ exports.ComponentChain = ComponentChain;
|
|
|
21570
21571
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
21571
21572
|
exports.ComponentCompare = void 0;
|
|
21572
21573
|
const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
21574
|
+
const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
21573
21575
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
21574
21576
|
class ComponentCompare {
|
|
21575
|
-
runSyntax(node, scope, filename) {
|
|
21577
|
+
runSyntax(node, scope, filename, type) {
|
|
21578
|
+
const chain = node.findDirectExpression(Expressions.ComponentChainSimple);
|
|
21579
|
+
if (chain === undefined) {
|
|
21580
|
+
throw new Error("ComponentCompare, chain not found");
|
|
21581
|
+
}
|
|
21582
|
+
// todo, handle deep chain
|
|
21583
|
+
if (chain.getChildren().length === 1
|
|
21584
|
+
&& type !== undefined
|
|
21585
|
+
&& !(type instanceof basic_1.VoidType)
|
|
21586
|
+
&& !(type instanceof basic_1.UnknownType)
|
|
21587
|
+
&& !(type instanceof basic_1.AnyType)) {
|
|
21588
|
+
const fieldName = chain.concatTokens();
|
|
21589
|
+
if (fieldName.toLowerCase() !== "table_line") {
|
|
21590
|
+
if (!(type instanceof basic_1.StructureType)) {
|
|
21591
|
+
throw new Error("ComponentCompare, source not structured");
|
|
21592
|
+
}
|
|
21593
|
+
if (type.getComponentByName(fieldName) === undefined) {
|
|
21594
|
+
throw new Error("Component \"" + fieldName + "\" not part of structure");
|
|
21595
|
+
}
|
|
21596
|
+
// todo, check type compatibility
|
|
21597
|
+
}
|
|
21598
|
+
}
|
|
21576
21599
|
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
21577
21600
|
new source_1.Source().runSyntax(s, scope, filename);
|
|
21578
21601
|
}
|
|
@@ -21636,15 +21659,15 @@ exports.ComponentCond = void 0;
|
|
|
21636
21659
|
const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
21637
21660
|
const component_compare_1 = __webpack_require__(/*! ./component_compare */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_compare.js");
|
|
21638
21661
|
class ComponentCond {
|
|
21639
|
-
runSyntax(node, scope, filename) {
|
|
21662
|
+
runSyntax(node, scope, filename, type) {
|
|
21640
21663
|
for (const t of node.findDirectExpressions(Expressions.ComponentCondSub)) {
|
|
21641
21664
|
const c = t.findDirectExpression(Expressions.ComponentCond);
|
|
21642
21665
|
if (c) {
|
|
21643
|
-
new ComponentCond().runSyntax(c, scope, filename);
|
|
21666
|
+
new ComponentCond().runSyntax(c, scope, filename, type);
|
|
21644
21667
|
}
|
|
21645
21668
|
}
|
|
21646
21669
|
for (const t of node.findDirectExpressions(Expressions.ComponentCompare)) {
|
|
21647
|
-
new component_compare_1.ComponentCompare().runSyntax(t, scope, filename);
|
|
21670
|
+
new component_compare_1.ComponentCompare().runSyntax(t, scope, filename, type);
|
|
21648
21671
|
}
|
|
21649
21672
|
}
|
|
21650
21673
|
}
|
|
@@ -27460,7 +27483,6 @@ const source_1 = __webpack_require__(/*! ../expressions/source */ "./node_module
|
|
|
27460
27483
|
const inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js");
|
|
27461
27484
|
const inline_fs_1 = __webpack_require__(/*! ../expressions/inline_fs */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_fs.js");
|
|
27462
27485
|
const fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js");
|
|
27463
|
-
const component_compare_1 = __webpack_require__(/*! ../expressions/component_compare */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_compare.js");
|
|
27464
27486
|
const component_cond_1 = __webpack_require__(/*! ../expressions/component_cond */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/component_cond.js");
|
|
27465
27487
|
const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/dynamic.js");
|
|
27466
27488
|
const loop_group_by_1 = __webpack_require__(/*! ../expressions/loop_group_by */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/loop_group_by.js");
|
|
@@ -27479,6 +27501,7 @@ class Loop {
|
|
|
27479
27501
|
firstSource = sources[0];
|
|
27480
27502
|
}
|
|
27481
27503
|
let sourceType = firstSource ? new source_1.Source().runSyntax(firstSource, scope, filename, targetType) : undefined;
|
|
27504
|
+
let rowType = undefined;
|
|
27482
27505
|
const concat = node.concatTokens().toUpperCase();
|
|
27483
27506
|
if (sourceType === undefined) {
|
|
27484
27507
|
throw new Error("No source type determined");
|
|
@@ -27500,7 +27523,8 @@ class Loop {
|
|
|
27500
27523
|
}
|
|
27501
27524
|
if (sourceType instanceof basic_1.TableType) {
|
|
27502
27525
|
const targetConcat = (_a = node.findDirectExpression(Expressions.LoopTarget)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
|
|
27503
|
-
|
|
27526
|
+
rowType = sourceType.getRowType();
|
|
27527
|
+
sourceType = rowType;
|
|
27504
27528
|
if (targetConcat === null || targetConcat === void 0 ? void 0 : targetConcat.startsWith("REFERENCE INTO ")) {
|
|
27505
27529
|
sourceType = new basic_1.DataReference(sourceType);
|
|
27506
27530
|
}
|
|
@@ -27525,11 +27549,8 @@ class Loop {
|
|
|
27525
27549
|
new fstarget_1.FSTarget().runSyntax(fstarget, scope, filename, sourceType);
|
|
27526
27550
|
}
|
|
27527
27551
|
}
|
|
27528
|
-
for (const t of node.findDirectExpressions(Expressions.ComponentCompare)) {
|
|
27529
|
-
new component_compare_1.ComponentCompare().runSyntax(t, scope, filename);
|
|
27530
|
-
}
|
|
27531
27552
|
for (const t of node.findDirectExpressions(Expressions.ComponentCond)) {
|
|
27532
|
-
new component_cond_1.ComponentCond().runSyntax(t, scope, filename);
|
|
27553
|
+
new component_cond_1.ComponentCond().runSyntax(t, scope, filename, rowType);
|
|
27533
27554
|
}
|
|
27534
27555
|
for (const t of node.findDirectExpressions(Expressions.Dynamic)) {
|
|
27535
27556
|
new dynamic_1.Dynamic().runSyntax(t, scope, filename);
|
|
@@ -46016,7 +46037,7 @@ class Registry {
|
|
|
46016
46037
|
}
|
|
46017
46038
|
static abaplintVersion() {
|
|
46018
46039
|
// magic, see build script "version.sh"
|
|
46019
|
-
return "2.95.
|
|
46040
|
+
return "2.95.25";
|
|
46020
46041
|
}
|
|
46021
46042
|
getDDICReferences() {
|
|
46022
46043
|
return this.references;
|
|
@@ -63392,6 +63413,7 @@ class UncaughtException extends _abap_rule_1.ABAPRule {
|
|
|
63392
63413
|
if (stru === undefined) {
|
|
63393
63414
|
return [];
|
|
63394
63415
|
}
|
|
63416
|
+
this.findLocalExceptions(obj);
|
|
63395
63417
|
this.syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();
|
|
63396
63418
|
if (this.syntax.issues.length > 0) {
|
|
63397
63419
|
return [];
|
|
@@ -63514,7 +63536,6 @@ class UncaughtException extends _abap_rule_1.ABAPRule {
|
|
|
63514
63536
|
def.getRaising().forEach(r => { var _a; return (_a = this.sinked) === null || _a === void 0 ? void 0 : _a.push(r); });
|
|
63515
63537
|
}
|
|
63516
63538
|
isSinked(name) {
|
|
63517
|
-
// todo: ignore dynamic and no_check exceptions
|
|
63518
63539
|
if (this.sinked === undefined || name === undefined) {
|
|
63519
63540
|
return true;
|
|
63520
63541
|
}
|
|
@@ -63522,9 +63543,13 @@ class UncaughtException extends _abap_rule_1.ABAPRule {
|
|
|
63522
63543
|
if (sup === "CX_DYNAMIC_CHECK" || sup === "CX_NO_CHECK") {
|
|
63523
63544
|
return true;
|
|
63524
63545
|
}
|
|
63525
|
-
|
|
63546
|
+
const lsup = this.localExceptions[name.toUpperCase()];
|
|
63547
|
+
if (lsup === "CX_DYNAMIC_CHECK" || lsup === "CX_NO_CHECK") {
|
|
63548
|
+
return true;
|
|
63549
|
+
}
|
|
63526
63550
|
return this.sinked.some(a => a.toUpperCase() === name.toUpperCase())
|
|
63527
|
-
|| (sup !== undefined && this.isSinked(sup) === true)
|
|
63551
|
+
|| (sup !== undefined && this.isSinked(sup) === true)
|
|
63552
|
+
|| (lsup !== undefined && this.isSinked(lsup) === true);
|
|
63528
63553
|
}
|
|
63529
63554
|
findGlobalExceptions() {
|
|
63530
63555
|
var _a, _b;
|
|
@@ -63541,6 +63566,17 @@ class UncaughtException extends _abap_rule_1.ABAPRule {
|
|
|
63541
63566
|
this.globalExceptions[o.getName().toUpperCase()] = (_b = def.superClassName) === null || _b === void 0 ? void 0 : _b.toUpperCase();
|
|
63542
63567
|
}
|
|
63543
63568
|
}
|
|
63569
|
+
findLocalExceptions(obj) {
|
|
63570
|
+
var _a;
|
|
63571
|
+
this.localExceptions = {};
|
|
63572
|
+
for (const file of obj.getABAPFiles()) {
|
|
63573
|
+
for (const def of file.getInfo().listClassDefinitions()) {
|
|
63574
|
+
if (def.isLocal === true && def.superClassName !== undefined) {
|
|
63575
|
+
this.localExceptions[def.name.toUpperCase()] = (_a = def.superClassName) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
|
63576
|
+
}
|
|
63577
|
+
}
|
|
63578
|
+
}
|
|
63579
|
+
}
|
|
63544
63580
|
}
|
|
63545
63581
|
exports.UncaughtException = UncaughtException;
|
|
63546
63582
|
//# sourceMappingURL=uncaught_exception.js.map
|
|
@@ -64304,6 +64340,7 @@ const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplin
|
|
|
64304
64340
|
const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
|
|
64305
64341
|
const visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ "./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js");
|
|
64306
64342
|
const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
|
|
64343
|
+
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
64307
64344
|
class UnusedMethodsConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
64308
64345
|
}
|
|
64309
64346
|
exports.UnusedMethodsConf = UnusedMethodsConf;
|
|
@@ -64351,6 +64388,8 @@ class UnusedMethods {
|
|
|
64351
64388
|
shortDescription: `Checks for unused methods`,
|
|
64352
64389
|
extendedInformation: `Checks private and protected methods.
|
|
64353
64390
|
|
|
64391
|
+
Unused methods are not reported if the object contains parser or syntax errors.
|
|
64392
|
+
|
|
64354
64393
|
Skips:
|
|
64355
64394
|
* methods FOR TESTING
|
|
64356
64395
|
* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses
|
|
@@ -64383,6 +64422,13 @@ Skips:
|
|
|
64383
64422
|
else if (obj instanceof objects_1.Program && obj.isInclude() === true) {
|
|
64384
64423
|
return [];
|
|
64385
64424
|
}
|
|
64425
|
+
for (const file of obj.getABAPFiles()) {
|
|
64426
|
+
for (const statement of file.getStatements()) {
|
|
64427
|
+
if (statement.get() instanceof _statement_1.Unknown) {
|
|
64428
|
+
return []; // contains parser errors
|
|
64429
|
+
}
|
|
64430
|
+
}
|
|
64431
|
+
}
|
|
64386
64432
|
// dont report anything when there are syntax errors
|
|
64387
64433
|
const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();
|
|
64388
64434
|
if (syntax.issues.length > 0) {
|
|
@@ -64495,6 +64541,7 @@ const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./nod
|
|
|
64495
64541
|
const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
|
|
64496
64542
|
const edit_helper_1 = __webpack_require__(/*! ../edit_helper */ "./node_modules/@abaplint/core/build/src/edit_helper.js");
|
|
64497
64543
|
const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
|
|
64544
|
+
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
64498
64545
|
class WorkArea {
|
|
64499
64546
|
constructor() {
|
|
64500
64547
|
this.workarea = [];
|
|
@@ -64541,6 +64588,7 @@ class UnusedTypes {
|
|
|
64541
64588
|
key: "unused_types",
|
|
64542
64589
|
title: "Unused types",
|
|
64543
64590
|
shortDescription: `Checks for unused TYPE definitions`,
|
|
64591
|
+
extendedInformation: `Unused types are not reported if the object contains parser or syntax errors.`,
|
|
64544
64592
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
64545
64593
|
pragma: "##NEEDED",
|
|
64546
64594
|
};
|
|
@@ -64562,6 +64610,13 @@ class UnusedTypes {
|
|
|
64562
64610
|
if (!(obj instanceof _abap_object_1.ABAPObject)) {
|
|
64563
64611
|
return [];
|
|
64564
64612
|
}
|
|
64613
|
+
for (const file of obj.getABAPFiles()) {
|
|
64614
|
+
for (const statement of file.getStatements()) {
|
|
64615
|
+
if (statement.get() instanceof _statement_1.Unknown) {
|
|
64616
|
+
return []; // contains parser errors
|
|
64617
|
+
}
|
|
64618
|
+
}
|
|
64619
|
+
}
|
|
64565
64620
|
// dont report unused variables when there are syntax errors
|
|
64566
64621
|
const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();
|
|
64567
64622
|
if (syntax.issues.length > 0) {
|
|
@@ -64733,7 +64788,9 @@ class UnusedVariables {
|
|
|
64733
64788
|
|
|
64734
64789
|
Note that this currently does not work if the source code uses macros.
|
|
64735
64790
|
|
|
64736
|
-
Unused variables are not reported if the object contains syntax errors.
|
|
64791
|
+
Unused variables are not reported if the object contains parser or syntax errors.
|
|
64792
|
+
|
|
64793
|
+
Errors found in INCLUDES are reported for the main program.`,
|
|
64737
64794
|
tags: [_irule_1.RuleTag.Quickfix],
|
|
64738
64795
|
pragma: "##NEEDED",
|
|
64739
64796
|
pseudoComment: "EC NEEDED",
|
|
@@ -64759,10 +64816,17 @@ Unused variables are not reported if the object contains syntax errors. Errors f
|
|
|
64759
64816
|
else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?
|
|
64760
64817
|
return [];
|
|
64761
64818
|
}
|
|
64819
|
+
for (const file of obj.getABAPFiles()) {
|
|
64820
|
+
for (const statement of file.getStatements()) {
|
|
64821
|
+
if (statement.get() instanceof _statement_1.Unknown) {
|
|
64822
|
+
return []; // contains parser errors
|
|
64823
|
+
}
|
|
64824
|
+
}
|
|
64825
|
+
}
|
|
64762
64826
|
// dont report unused variables when there are syntax errors
|
|
64763
64827
|
const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();
|
|
64764
64828
|
if (syntax.issues.length > 0) {
|
|
64765
|
-
return [];
|
|
64829
|
+
return []; // contains syntax errors
|
|
64766
64830
|
}
|
|
64767
64831
|
this.workarea = new WorkArea();
|
|
64768
64832
|
const top = syntax.spaghetti.getTop();
|
|
@@ -66327,9 +66391,10 @@ var Version;
|
|
|
66327
66391
|
Version["v754"] = "v754";
|
|
66328
66392
|
Version["v755"] = "v755";
|
|
66329
66393
|
Version["v756"] = "v756";
|
|
66394
|
+
Version["v757"] = "v757";
|
|
66330
66395
|
Version["Cloud"] = "Cloud";
|
|
66331
66396
|
})(Version = exports.Version || (exports.Version = {}));
|
|
66332
|
-
exports.defaultVersion = Version.
|
|
66397
|
+
exports.defaultVersion = Version.v757;
|
|
66333
66398
|
function getPreviousVersion(v) {
|
|
66334
66399
|
if (v === Version.OpenABAP) {
|
|
66335
66400
|
return Version.v702;
|
|
@@ -69187,7 +69252,7 @@ class HandleABAP {
|
|
|
69187
69252
|
this.options = options;
|
|
69188
69253
|
}
|
|
69189
69254
|
runObject(obj, reg) {
|
|
69190
|
-
var _a, _b
|
|
69255
|
+
var _a, _b;
|
|
69191
69256
|
let ret = [];
|
|
69192
69257
|
if (obj instanceof abaplint.Objects.Program && obj.isInclude() === true) {
|
|
69193
69258
|
// includes are only compiled along with the programs where its used?
|
|
@@ -69200,7 +69265,7 @@ class HandleABAP {
|
|
|
69200
69265
|
chunk.appendString("// " + file.getFilename() + "\n");
|
|
69201
69266
|
}
|
|
69202
69267
|
const rearranged = new rearranger_1.Rearranger().run(obj.getType(), file.getStructure());
|
|
69203
|
-
const contents = new traversal_1.Traversal(spaghetti, file, obj, reg,
|
|
69268
|
+
const contents = new traversal_1.Traversal(spaghetti, file, obj, reg, this.options).traverse(rearranged);
|
|
69204
69269
|
chunk.appendChunk(contents);
|
|
69205
69270
|
chunk.stripLastNewline();
|
|
69206
69271
|
chunk.runIndentationLogic();
|
|
@@ -69219,7 +69284,7 @@ class HandleABAP {
|
|
|
69219
69284
|
ret.push(output);
|
|
69220
69285
|
}
|
|
69221
69286
|
ret = this.rearrangeClassLocals(obj, ret);
|
|
69222
|
-
if (((
|
|
69287
|
+
if (((_b = this.options) === null || _b === void 0 ? void 0 : _b.addCommonJS) === true) {
|
|
69223
69288
|
ret.map(output => output.chunk = this.addImportsAndExports(output));
|
|
69224
69289
|
}
|
|
69225
69290
|
return ret;
|
|
@@ -71330,6 +71395,7 @@ class CreateObjectTranspiler {
|
|
|
71330
71395
|
return new chunk_1.Chunk(ret);
|
|
71331
71396
|
}
|
|
71332
71397
|
findClassName(node, traversal) {
|
|
71398
|
+
var _a;
|
|
71333
71399
|
const c = node.findDirectExpression(abaplint.Expressions.ClassName);
|
|
71334
71400
|
if (c) {
|
|
71335
71401
|
return c.concatTokens();
|
|
@@ -71350,7 +71416,7 @@ class CreateObjectTranspiler {
|
|
|
71350
71416
|
return "object";
|
|
71351
71417
|
}
|
|
71352
71418
|
else if (!(type instanceof abaplint.BasicTypes.ObjectReferenceType)) {
|
|
71353
|
-
if (traversal.
|
|
71419
|
+
if (((_a = traversal.options) === null || _a === void 0 ? void 0 : _a.unknownTypes) !== "runtimeError") {
|
|
71354
71420
|
throw new Error(`CreateObjectTranspiler, target variable "${target === null || target === void 0 ? void 0 : target.concatTokens()}" not a object reference`);
|
|
71355
71421
|
}
|
|
71356
71422
|
else {
|
|
@@ -75667,7 +75733,7 @@ class FunctionModuleTranspiler {
|
|
|
75667
75733
|
}
|
|
75668
75734
|
//////////////////////
|
|
75669
75735
|
findSignature(traversal, name, node) {
|
|
75670
|
-
var _a;
|
|
75736
|
+
var _a, _b, _c;
|
|
75671
75737
|
const group = traversal.getCurrentObject();
|
|
75672
75738
|
if (group === undefined) {
|
|
75673
75739
|
throw "FunctionModuleTranspilerGroupNotFound";
|
|
@@ -75688,10 +75754,13 @@ class FunctionModuleTranspiler {
|
|
|
75688
75754
|
direction = "importing";
|
|
75689
75755
|
}
|
|
75690
75756
|
// note: all directions are optional
|
|
75691
|
-
|
|
75757
|
+
let name = p.name.toLowerCase();
|
|
75758
|
+
if ((_b = (_a = traversal.options) === null || _a === void 0 ? void 0 : _a.keywords) === null || _b === void 0 ? void 0 : _b.some(a => a === name)) {
|
|
75759
|
+
name += "_";
|
|
75760
|
+
}
|
|
75692
75761
|
ret += `let ${name} = INPUT.${direction}?.${name};\n`;
|
|
75693
75762
|
if (direction === "exporting" || direction === "importing" || direction === "changing") {
|
|
75694
|
-
const type = (
|
|
75763
|
+
const type = (_c = scope === null || scope === void 0 ? void 0 : scope.findVariable(name)) === null || _c === void 0 ? void 0 : _c.getType();
|
|
75695
75764
|
if (type !== undefined) {
|
|
75696
75765
|
// todo, set DEFAULT value
|
|
75697
75766
|
// todo, check for OPTIONALness and raise exceptions and stuff
|
|
@@ -76244,13 +76313,13 @@ const transpile_types_1 = __webpack_require__(/*! ./transpile_types */ "./node_m
|
|
|
76244
76313
|
const chunk_1 = __webpack_require__(/*! ./chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
76245
76314
|
const expressions_1 = __webpack_require__(/*! ./expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
|
|
76246
76315
|
class Traversal {
|
|
76247
|
-
constructor(spaghetti, file, obj, reg,
|
|
76316
|
+
constructor(spaghetti, file, obj, reg, options) {
|
|
76248
76317
|
this.scopeCache = undefined;
|
|
76249
76318
|
this.spaghetti = spaghetti;
|
|
76250
76319
|
this.file = file;
|
|
76251
76320
|
this.obj = obj;
|
|
76252
76321
|
this.reg = reg;
|
|
76253
|
-
this.
|
|
76322
|
+
this.options = options;
|
|
76254
76323
|
}
|
|
76255
76324
|
static escapeNamespace(name) {
|
|
76256
76325
|
return name === null || name === void 0 ? void 0 : name.replace(/\//g, "$");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.6",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abap_transpile": "./abap_transpile"
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"author": "abaplint",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@abaplint/transpiler": "^2.5.
|
|
28
|
+
"@abaplint/transpiler": "^2.5.6",
|
|
29
29
|
"@types/glob": "^7.2.0",
|
|
30
30
|
"glob": "=7.2.0",
|
|
31
31
|
"@types/progress": "^2.0.5",
|
|
32
|
-
"@abaplint/core": "^2.95.
|
|
32
|
+
"@abaplint/core": "^2.95.25",
|
|
33
33
|
"progress": "^2.0.3",
|
|
34
34
|
"webpack": "^5.75.0",
|
|
35
35
|
"webpack-cli": "^5.0.1",
|