@abaplint/transpiler-cli 2.12.24 → 2.12.26
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 +233 -47
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -130,6 +130,15 @@ class FileOperations {
|
|
|
130
130
|
console.log(skipped + " files skipped in source");
|
|
131
131
|
return files;
|
|
132
132
|
}
|
|
133
|
+
static async writeFiles(files) {
|
|
134
|
+
const limit = this.setupPLimit();
|
|
135
|
+
const promises = files.map((file) => {
|
|
136
|
+
return limit(async () => {
|
|
137
|
+
await fsPromises.writeFile(file.path, file.contents);
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
await Promise.all(promises);
|
|
141
|
+
}
|
|
133
142
|
}
|
|
134
143
|
exports.FileOperations = FileOperations;
|
|
135
144
|
//# sourceMappingURL=file_operations.js.map
|
|
@@ -22209,8 +22218,25 @@ class Procedural {
|
|
|
22209
22218
|
}
|
|
22210
22219
|
return undefined;
|
|
22211
22220
|
}
|
|
22221
|
+
findFunctionGroupScope(fg) {
|
|
22222
|
+
var _a, _b, _c;
|
|
22223
|
+
for (const module of fg.getModules()) {
|
|
22224
|
+
if (module.isGlobalParameters() === false) {
|
|
22225
|
+
continue;
|
|
22226
|
+
}
|
|
22227
|
+
// console.dir(fg.getSequencedFiles());
|
|
22228
|
+
const fmFile = fg.getSequencedFiles().find((f) => { return f.getFilename().endsWith(".fugr." + module.getName().toLowerCase().replace(/\//g, "#") + ".abap"); });
|
|
22229
|
+
if (fmFile === undefined) {
|
|
22230
|
+
continue;
|
|
22231
|
+
}
|
|
22232
|
+
const nameToken = (_c = (_b = (_a = fmFile.getStructure()) === null || _a === void 0 ? void 0 : _a.findFirstStatement(Statements.FunctionModule)) === null || _b === void 0 ? void 0 : _b.findFirstExpression(Expressions.Field)) === null || _c === void 0 ? void 0 : _c.getFirstToken();
|
|
22233
|
+
if (nameToken === undefined) {
|
|
22234
|
+
continue;
|
|
22235
|
+
}
|
|
22236
|
+
this.addFunctionScope(module, nameToken, fmFile.getFilename(), true);
|
|
22237
|
+
}
|
|
22238
|
+
}
|
|
22212
22239
|
findFunctionScope(obj, node, filename) {
|
|
22213
|
-
var _a, _b, _c, _d, _e;
|
|
22214
22240
|
if (!(obj instanceof objects_1.FunctionGroup)) {
|
|
22215
22241
|
throw new Error("findFunctionScope, expected function group input");
|
|
22216
22242
|
}
|
|
@@ -22221,6 +22247,13 @@ class Procedural {
|
|
|
22221
22247
|
if (definition === undefined) {
|
|
22222
22248
|
throw new Error("Function module definition \"" + name + "\" not found");
|
|
22223
22249
|
}
|
|
22250
|
+
if (definition.isGlobalParameters() === true) {
|
|
22251
|
+
return; // already added at global level
|
|
22252
|
+
}
|
|
22253
|
+
this.addFunctionScope(definition, nameToken, filename);
|
|
22254
|
+
}
|
|
22255
|
+
addFunctionScope(definition, nameToken, filename, ignoreIfAlreadyExists = false) {
|
|
22256
|
+
var _a, _b, _c, _d, _e;
|
|
22224
22257
|
const ddic = new ddic_1.DDIC(this.reg);
|
|
22225
22258
|
const allNames = new Set();
|
|
22226
22259
|
for (const param of definition.getParameters()) {
|
|
@@ -22306,7 +22339,15 @@ class Procedural {
|
|
|
22306
22339
|
}
|
|
22307
22340
|
else {
|
|
22308
22341
|
const type = new _typed_identifier_1.TypedIdentifier(nameToken, filename, found);
|
|
22309
|
-
|
|
22342
|
+
if (ignoreIfAlreadyExists === true) {
|
|
22343
|
+
const exists = this.scope.findVariable(param.name);
|
|
22344
|
+
if (exists === undefined) {
|
|
22345
|
+
this.scope.addNamedIdentifier(param.name, type);
|
|
22346
|
+
}
|
|
22347
|
+
}
|
|
22348
|
+
else {
|
|
22349
|
+
this.scope.addNamedIdentifier(param.name, type);
|
|
22350
|
+
}
|
|
22310
22351
|
allNames.add(param.name.toUpperCase());
|
|
22311
22352
|
}
|
|
22312
22353
|
}
|
|
@@ -22630,6 +22671,22 @@ class TypeUtils {
|
|
|
22630
22671
|
// todo
|
|
22631
22672
|
return true;
|
|
22632
22673
|
}
|
|
22674
|
+
isCompareable(source1, source2, node1, node2) {
|
|
22675
|
+
/*
|
|
22676
|
+
console.dir(source1);
|
|
22677
|
+
console.dir(source2);
|
|
22678
|
+
*/
|
|
22679
|
+
if (source1 === undefined || source2 === undefined) {
|
|
22680
|
+
return true;
|
|
22681
|
+
}
|
|
22682
|
+
if (source1 instanceof basic_1.HexType && this.isCalculated(node1) && source2 instanceof basic_1.IntegerType) {
|
|
22683
|
+
return false;
|
|
22684
|
+
}
|
|
22685
|
+
if (source2 instanceof basic_1.HexType && this.isCalculated(node2) && source1 instanceof basic_1.IntegerType) {
|
|
22686
|
+
return false;
|
|
22687
|
+
}
|
|
22688
|
+
return true;
|
|
22689
|
+
}
|
|
22633
22690
|
structureContainsString(structure) {
|
|
22634
22691
|
for (const c of structure.getComponents()) {
|
|
22635
22692
|
if (c.type instanceof basic_1.StringType) {
|
|
@@ -22659,6 +22716,13 @@ class TypeUtils {
|
|
|
22659
22716
|
|| node.findFirstExpression(Expressions.ArithOperator) !== undefined;
|
|
22660
22717
|
return calculated;
|
|
22661
22718
|
}
|
|
22719
|
+
isAssignableNew(source, target, node) {
|
|
22720
|
+
const calculated = (node === null || node === void 0 ? void 0 : node.findFirstExpression(Expressions.ArithOperator)) !== undefined;
|
|
22721
|
+
if (calculated && source instanceof basic_1.HexType && target instanceof basic_1.IntegerType) {
|
|
22722
|
+
return false;
|
|
22723
|
+
}
|
|
22724
|
+
return this.isAssignable(source, target);
|
|
22725
|
+
}
|
|
22662
22726
|
isAssignableStrict(source, target, node) {
|
|
22663
22727
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
22664
22728
|
const calculated = node ? this.isCalculated(node) : false;
|
|
@@ -24258,10 +24322,14 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
|
|
|
24258
24322
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
24259
24323
|
const method_call_chain_1 = __webpack_require__(/*! ./method_call_chain */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_call_chain.js");
|
|
24260
24324
|
const source_field_symbol_1 = __webpack_require__(/*! ./source_field_symbol */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source_field_symbol.js");
|
|
24325
|
+
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
24326
|
+
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
|
|
24261
24327
|
class Compare {
|
|
24262
24328
|
static runSyntax(node, input) {
|
|
24263
|
-
|
|
24264
|
-
|
|
24329
|
+
const sourceTypes = [];
|
|
24330
|
+
const sources = node.findDirectExpressions(Expressions.Source);
|
|
24331
|
+
for (const t of sources) {
|
|
24332
|
+
sourceTypes.push(source_1.Source.runSyntax(t, input));
|
|
24265
24333
|
}
|
|
24266
24334
|
for (const t of node.findDirectExpressions(Expressions.SourceFieldSymbolChain)) {
|
|
24267
24335
|
source_field_symbol_1.SourceFieldSymbol.runSyntax(t, input);
|
|
@@ -24269,6 +24337,12 @@ class Compare {
|
|
|
24269
24337
|
for (const t of node.findDirectExpressions(Expressions.MethodCallChain)) {
|
|
24270
24338
|
method_call_chain_1.MethodCallChain.runSyntax(t, input);
|
|
24271
24339
|
}
|
|
24340
|
+
if (node.findDirectExpression(Expressions.CompareOperator)
|
|
24341
|
+
&& new _type_utils_1.TypeUtils(input.scope).isCompareable(sourceTypes[0], sourceTypes[1], sources[0], sources[1]) === false
|
|
24342
|
+
&& sourceTypes.length === 2) {
|
|
24343
|
+
const message = "Incompatible types for comparison";
|
|
24344
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
24345
|
+
}
|
|
24272
24346
|
}
|
|
24273
24347
|
}
|
|
24274
24348
|
exports.Compare = Compare;
|
|
@@ -28051,53 +28125,84 @@ exports.SQLSource = SQLSource;
|
|
|
28051
28125
|
|
|
28052
28126
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
28053
28127
|
exports.StringTemplate = void 0;
|
|
28128
|
+
const nodes_1 = __webpack_require__(/*! ../../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
28054
28129
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
28055
28130
|
const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
28056
28131
|
const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js");
|
|
28057
28132
|
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
|
|
28058
28133
|
const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
|
|
28134
|
+
const Tokens = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
|
|
28059
28135
|
class StringTemplate {
|
|
28060
28136
|
static runSyntax(node, input) {
|
|
28061
28137
|
const typeUtils = new _type_utils_1.TypeUtils(input.scope);
|
|
28062
28138
|
const ret = basic_1.StringType.get();
|
|
28063
|
-
for (const
|
|
28064
|
-
|
|
28065
|
-
|
|
28066
|
-
|
|
28067
|
-
|
|
28068
|
-
|
|
28069
|
-
|
|
28070
|
-
|
|
28071
|
-
|
|
28072
|
-
|
|
28073
|
-
|
|
28074
|
-
|
|
28075
|
-
|
|
28076
|
-
|
|
28077
|
-
|
|
28139
|
+
for (const child of node.getChildren()) {
|
|
28140
|
+
if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.StringTemplateSource) {
|
|
28141
|
+
const s = child.findDirectExpression(Expressions.Source);
|
|
28142
|
+
const type = source_1.Source.runSyntax(s, input, ret);
|
|
28143
|
+
if (type === undefined) {
|
|
28144
|
+
const message = "No target type determined";
|
|
28145
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
28146
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
28147
|
+
}
|
|
28148
|
+
else if ((typeUtils.isCharLike(type) === false
|
|
28149
|
+
&& typeUtils.isHexLike(type) === false
|
|
28150
|
+
&& !(type instanceof basic_1.UTCLongType))
|
|
28151
|
+
|| type instanceof basic_1.StructureType) {
|
|
28152
|
+
const message = "String template, not character like, " + type.constructor.name;
|
|
28153
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
28154
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
28155
|
+
}
|
|
28156
|
+
const format = child.findDirectExpression(Expressions.StringTemplateFormatting);
|
|
28157
|
+
const formatConcat = format === null || format === void 0 ? void 0 : format.concatTokens();
|
|
28158
|
+
for (const formatSource of (format === null || format === void 0 ? void 0 : format.findAllExpressions(Expressions.Source)) || []) {
|
|
28159
|
+
source_1.Source.runSyntax(formatSource, input);
|
|
28160
|
+
}
|
|
28161
|
+
if (format
|
|
28162
|
+
&& (formatConcat === null || formatConcat === void 0 ? void 0 : formatConcat.includes("ALPHA = "))
|
|
28163
|
+
&& !(type instanceof basic_1.UnknownType)
|
|
28164
|
+
&& !(type instanceof basic_1.VoidType)
|
|
28165
|
+
&& !(type instanceof basic_1.StringType)
|
|
28166
|
+
&& !(type instanceof basic_1.CLikeType)
|
|
28167
|
+
&& !(type instanceof basic_1.CharacterType)
|
|
28168
|
+
&& !(type instanceof basic_1.NumericGenericType)
|
|
28169
|
+
&& !(type instanceof basic_1.NumericType)
|
|
28170
|
+
&& !(type instanceof basic_1.AnyType)) {
|
|
28171
|
+
const message = `Cannot apply ALPHA to this type (${type.constructor.name})`;
|
|
28172
|
+
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, format.getFirstToken(), message));
|
|
28173
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
28174
|
+
}
|
|
28078
28175
|
}
|
|
28079
|
-
|
|
28080
|
-
|
|
28081
|
-
|
|
28082
|
-
|
|
28083
|
-
|
|
28084
|
-
|
|
28085
|
-
|
|
28086
|
-
|
|
28087
|
-
|
|
28088
|
-
|
|
28089
|
-
|
|
28090
|
-
|
|
28091
|
-
&& !(type instanceof basic_1.NumericGenericType)
|
|
28092
|
-
&& !(type instanceof basic_1.NumericType)
|
|
28093
|
-
&& !(type instanceof basic_1.AnyType)) {
|
|
28094
|
-
const message = `Cannot apply ALPHA to this type (${type.constructor.name})`;
|
|
28095
|
-
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, format.getFirstToken(), message));
|
|
28096
|
-
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
28176
|
+
else if (child instanceof nodes_1.TokenNode) {
|
|
28177
|
+
const token = child.get();
|
|
28178
|
+
if (token instanceof Tokens.StringTemplate
|
|
28179
|
+
|| token instanceof Tokens.StringTemplateBegin
|
|
28180
|
+
|| token instanceof Tokens.StringTemplateMiddle
|
|
28181
|
+
|| token instanceof Tokens.StringTemplateEnd) {
|
|
28182
|
+
const issue = this.validateEscapeSequences(token.getStr(), input, child);
|
|
28183
|
+
if (issue) {
|
|
28184
|
+
input.issues.push(issue);
|
|
28185
|
+
return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
|
|
28186
|
+
}
|
|
28187
|
+
}
|
|
28097
28188
|
}
|
|
28098
28189
|
}
|
|
28099
28190
|
return ret;
|
|
28100
28191
|
}
|
|
28192
|
+
static validateEscapeSequences(str, input, node) {
|
|
28193
|
+
// Valid escape sequences in ABAP string templates: \|, \{, \}, \\, \n, \r, \t
|
|
28194
|
+
const validEscapes = new Set(["\\|", "\\{", "\\}", "\\\\", "\\n", "\\r", "\\t"]);
|
|
28195
|
+
for (let i = 0; i < str.length; i++) {
|
|
28196
|
+
if (str[i] === "\\") {
|
|
28197
|
+
const escape = str.substring(i, i + 2);
|
|
28198
|
+
if (!validEscapes.has(escape)) {
|
|
28199
|
+
return (0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), `Invalid escape sequence "${escape}" in string template`);
|
|
28200
|
+
}
|
|
28201
|
+
i++; // skip the next character as it's part of the escape sequence
|
|
28202
|
+
}
|
|
28203
|
+
}
|
|
28204
|
+
return undefined;
|
|
28205
|
+
}
|
|
28101
28206
|
}
|
|
28102
28207
|
exports.StringTemplate = StringTemplate;
|
|
28103
28208
|
//# sourceMappingURL=string_template.js.map
|
|
@@ -32475,7 +32580,7 @@ class Move {
|
|
|
32475
32580
|
return;
|
|
32476
32581
|
}
|
|
32477
32582
|
}
|
|
32478
|
-
else if (new _type_utils_1.TypeUtils(input.scope).
|
|
32583
|
+
else if (new _type_utils_1.TypeUtils(input.scope).isAssignableNew(sourceType, targetType, source) === false) {
|
|
32479
32584
|
const message = "Incompatible types";
|
|
32480
32585
|
input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
|
|
32481
32586
|
return;
|
|
@@ -35435,6 +35540,9 @@ class SyntaxLogic {
|
|
|
35435
35540
|
stype = _scope_type_1.ScopeType.FunctionGroup;
|
|
35436
35541
|
}
|
|
35437
35542
|
this.scope.push(stype, this.object.getName(), new position_1.Position(1, 1), main.getFilename());
|
|
35543
|
+
if (this.object instanceof objects_1.FunctionGroup) {
|
|
35544
|
+
this.helpers.proc.findFunctionGroupScope(this.object);
|
|
35545
|
+
}
|
|
35438
35546
|
}
|
|
35439
35547
|
}
|
|
35440
35548
|
else if (this.object instanceof objects_1.TypePool) {
|
|
@@ -39131,6 +39239,9 @@ class FunctionModuleDefinition {
|
|
|
39131
39239
|
getName() {
|
|
39132
39240
|
return this.name;
|
|
39133
39241
|
}
|
|
39242
|
+
isGlobalParameters() {
|
|
39243
|
+
return this.globalParameters;
|
|
39244
|
+
}
|
|
39134
39245
|
///////////////
|
|
39135
39246
|
parse(data) {
|
|
39136
39247
|
if (data.FUNCNAME === undefined) {
|
|
@@ -39139,6 +39250,7 @@ class FunctionModuleDefinition {
|
|
|
39139
39250
|
this.name = data.FUNCNAME;
|
|
39140
39251
|
this.description = data.SHORT_TEXT;
|
|
39141
39252
|
this.parameters = [];
|
|
39253
|
+
this.globalParameters = data.GLOBAL_FLAG === "X";
|
|
39142
39254
|
this.moduleType = FunctionModuleType.regular;
|
|
39143
39255
|
if (data.REMOTE_CALL === "R") {
|
|
39144
39256
|
this.moduleType = FunctionModuleType.remote;
|
|
@@ -54236,7 +54348,7 @@ class Registry {
|
|
|
54236
54348
|
}
|
|
54237
54349
|
static abaplintVersion() {
|
|
54238
54350
|
// magic, see build script "version.sh"
|
|
54239
|
-
return "2.115.
|
|
54351
|
+
return "2.115.17";
|
|
54240
54352
|
}
|
|
54241
54353
|
getDDICReferences() {
|
|
54242
54354
|
return this.ddicReferences;
|
|
@@ -54450,7 +54562,7 @@ class Registry {
|
|
|
54450
54562
|
return this;
|
|
54451
54563
|
}
|
|
54452
54564
|
ParsingPerformance.clear();
|
|
54453
|
-
(_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount().
|
|
54565
|
+
(_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount().total, "Lexing and parsing");
|
|
54454
54566
|
for (const o of this.getObjects()) {
|
|
54455
54567
|
await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick("Lexing and parsing(" + this.conf.getVersion() + ") - " + o.getType() + " " + o.getName()));
|
|
54456
54568
|
this.parsePrivate(o);
|
|
@@ -63290,6 +63402,68 @@ exports.Exporting = Exporting;
|
|
|
63290
63402
|
|
|
63291
63403
|
/***/ },
|
|
63292
63404
|
|
|
63405
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/fm_global_parameters_obsolete.js"
|
|
63406
|
+
/*!**************************************************************************************!*\
|
|
63407
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/fm_global_parameters_obsolete.js ***!
|
|
63408
|
+
\**************************************************************************************/
|
|
63409
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
63410
|
+
|
|
63411
|
+
"use strict";
|
|
63412
|
+
|
|
63413
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
63414
|
+
exports.FMGlobalParametersObsolete = exports.FMGlobalParametersObsoleteConf = void 0;
|
|
63415
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
63416
|
+
const Objects = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
63417
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
63418
|
+
const position_1 = __webpack_require__(/*! ../position */ "./node_modules/@abaplint/core/build/src/position.js");
|
|
63419
|
+
class FMGlobalParametersObsoleteConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
63420
|
+
}
|
|
63421
|
+
exports.FMGlobalParametersObsoleteConf = FMGlobalParametersObsoleteConf;
|
|
63422
|
+
class FMGlobalParametersObsolete {
|
|
63423
|
+
constructor() {
|
|
63424
|
+
this.conf = new FMGlobalParametersObsoleteConf();
|
|
63425
|
+
}
|
|
63426
|
+
getMetadata() {
|
|
63427
|
+
return {
|
|
63428
|
+
key: "fm_global_parameters_obsolete",
|
|
63429
|
+
title: "FM Global Parameters Obsolete",
|
|
63430
|
+
shortDescription: `Check for function modules with global parameteers`,
|
|
63431
|
+
extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenglobal_parameters_obsolete.htm`,
|
|
63432
|
+
tags: [],
|
|
63433
|
+
};
|
|
63434
|
+
}
|
|
63435
|
+
initialize(_reg) {
|
|
63436
|
+
return this;
|
|
63437
|
+
}
|
|
63438
|
+
getConfig() {
|
|
63439
|
+
return this.conf;
|
|
63440
|
+
}
|
|
63441
|
+
setConfig(conf) {
|
|
63442
|
+
this.conf = conf;
|
|
63443
|
+
}
|
|
63444
|
+
run(obj) {
|
|
63445
|
+
if (!(obj instanceof Objects.FunctionGroup)) {
|
|
63446
|
+
return [];
|
|
63447
|
+
}
|
|
63448
|
+
const issues = [];
|
|
63449
|
+
for (const module of obj.getModules()) {
|
|
63450
|
+
if (module.isGlobalParameters() === true) {
|
|
63451
|
+
const file = obj.getMainABAPFile();
|
|
63452
|
+
if (file === undefined) {
|
|
63453
|
+
continue;
|
|
63454
|
+
}
|
|
63455
|
+
const message = `Function Module "${module.getName()}" uses obsolete global parameters`;
|
|
63456
|
+
issues.push(issue_1.Issue.atPosition(file, new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity));
|
|
63457
|
+
}
|
|
63458
|
+
}
|
|
63459
|
+
return issues;
|
|
63460
|
+
}
|
|
63461
|
+
}
|
|
63462
|
+
exports.FMGlobalParametersObsolete = FMGlobalParametersObsolete;
|
|
63463
|
+
//# sourceMappingURL=fm_global_parameters_obsolete.js.map
|
|
63464
|
+
|
|
63465
|
+
/***/ },
|
|
63466
|
+
|
|
63293
63467
|
/***/ "./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js"
|
|
63294
63468
|
/*!*****************************************************************************!*\
|
|
63295
63469
|
!*** ./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js ***!
|
|
@@ -65660,6 +65834,7 @@ __exportStar(__webpack_require__(/*! ./empty_structure */ "./node_modules/@abapl
|
|
|
65660
65834
|
__exportStar(__webpack_require__(/*! ./exit_or_check */ "./node_modules/@abaplint/core/build/src/rules/exit_or_check.js"), exports);
|
|
65661
65835
|
__exportStar(__webpack_require__(/*! ./expand_macros */ "./node_modules/@abaplint/core/build/src/rules/expand_macros.js"), exports);
|
|
65662
65836
|
__exportStar(__webpack_require__(/*! ./exporting */ "./node_modules/@abaplint/core/build/src/rules/exporting.js"), exports);
|
|
65837
|
+
__exportStar(__webpack_require__(/*! ./fm_global_parameters_obsolete */ "./node_modules/@abaplint/core/build/src/rules/fm_global_parameters_obsolete.js"), exports);
|
|
65663
65838
|
__exportStar(__webpack_require__(/*! ./forbidden_identifier */ "./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js"), exports);
|
|
65664
65839
|
__exportStar(__webpack_require__(/*! ./forbidden_pseudo_and_pragma */ "./node_modules/@abaplint/core/build/src/rules/forbidden_pseudo_and_pragma.js"), exports);
|
|
65665
65840
|
__exportStar(__webpack_require__(/*! ./forbidden_void_type */ "./node_modules/@abaplint/core/build/src/rules/forbidden_void_type.js"), exports);
|
|
@@ -65673,6 +65848,7 @@ __exportStar(__webpack_require__(/*! ./identical_conditions */ "./node_modules/@
|
|
|
65673
65848
|
__exportStar(__webpack_require__(/*! ./identical_contents */ "./node_modules/@abaplint/core/build/src/rules/identical_contents.js"), exports);
|
|
65674
65849
|
__exportStar(__webpack_require__(/*! ./identical_descriptions */ "./node_modules/@abaplint/core/build/src/rules/identical_descriptions.js"), exports);
|
|
65675
65850
|
__exportStar(__webpack_require__(/*! ./identical_form_names */ "./node_modules/@abaplint/core/build/src/rules/identical_form_names.js"), exports);
|
|
65851
|
+
__exportStar(__webpack_require__(/*! ./identical_move */ "./node_modules/@abaplint/core/build/src/rules/identical_move.js"), exports);
|
|
65676
65852
|
__exportStar(__webpack_require__(/*! ./if_in_if */ "./node_modules/@abaplint/core/build/src/rules/if_in_if.js"), exports);
|
|
65677
65853
|
__exportStar(__webpack_require__(/*! ./implement_methods */ "./node_modules/@abaplint/core/build/src/rules/implement_methods.js"), exports);
|
|
65678
65854
|
__exportStar(__webpack_require__(/*! ./implicit_start_of_selection */ "./node_modules/@abaplint/core/build/src/rules/implicit_start_of_selection.js"), exports);
|
|
@@ -65684,7 +65860,6 @@ __exportStar(__webpack_require__(/*! ./intf_referencing_clas */ "./node_modules/
|
|
|
65684
65860
|
__exportStar(__webpack_require__(/*! ./invalid_table_index */ "./node_modules/@abaplint/core/build/src/rules/invalid_table_index.js"), exports);
|
|
65685
65861
|
__exportStar(__webpack_require__(/*! ./keep_single_parameter_on_one_line */ "./node_modules/@abaplint/core/build/src/rules/keep_single_parameter_on_one_line.js"), exports);
|
|
65686
65862
|
__exportStar(__webpack_require__(/*! ./keyword_case */ "./node_modules/@abaplint/core/build/src/rules/keyword_case.js"), exports);
|
|
65687
|
-
__exportStar(__webpack_require__(/*! ./identical_move */ "./node_modules/@abaplint/core/build/src/rules/identical_move.js"), exports);
|
|
65688
65863
|
__exportStar(__webpack_require__(/*! ./line_break_multiple_parameters */ "./node_modules/@abaplint/core/build/src/rules/line_break_multiple_parameters.js"), exports);
|
|
65689
65864
|
__exportStar(__webpack_require__(/*! ./line_break_style */ "./node_modules/@abaplint/core/build/src/rules/line_break_style.js"), exports);
|
|
65690
65865
|
__exportStar(__webpack_require__(/*! ./line_length */ "./node_modules/@abaplint/core/build/src/rules/line_length.js"), exports);
|
|
@@ -80075,7 +80250,10 @@ class ConstantTranspiler {
|
|
|
80075
80250
|
this.addGet = addGet;
|
|
80076
80251
|
}
|
|
80077
80252
|
handleInteger(int, traversal) {
|
|
80078
|
-
|
|
80253
|
+
let concat = int.concatTokens().trim().replace(/^0+/, "");
|
|
80254
|
+
if (concat === "") {
|
|
80255
|
+
concat = "0";
|
|
80256
|
+
}
|
|
80079
80257
|
const parsed = Number.parseInt(concat, 10);
|
|
80080
80258
|
let code = "";
|
|
80081
80259
|
if (concat.length > 18) {
|
|
@@ -93029,7 +93207,13 @@ this.INTERNAL_ID = abap.internalIdCounter++;\n`;
|
|
|
93029
93207
|
}
|
|
93030
93208
|
// handle aliases after initialization of carrier variables
|
|
93031
93209
|
for (const a of def.getAliases() || []) {
|
|
93032
|
-
|
|
93210
|
+
const thisName = `this.${a.getName().toLowerCase()}`;
|
|
93211
|
+
const aliasName = "this." + Traversal.escapeNamespace(a.getComponent().replace("~", "$").toLowerCase());
|
|
93212
|
+
ret += `if (${thisName} === undefined)\n`;
|
|
93213
|
+
ret += thisName + " = " + aliasName + ";\n";
|
|
93214
|
+
// or the method(if its a method) might be implemented as its aliased name
|
|
93215
|
+
ret += `else if (${aliasName} === undefined)\n`;
|
|
93216
|
+
ret += aliasName + " = " + thisName + ";\n";
|
|
93033
93217
|
}
|
|
93034
93218
|
// constants can be accessed both statically and via reference
|
|
93035
93219
|
for (const c of def.getAttributes()?.getConstants() || []) {
|
|
@@ -104817,8 +105001,9 @@ async function loadLib(config) {
|
|
|
104817
105001
|
}
|
|
104818
105002
|
return files;
|
|
104819
105003
|
}
|
|
104820
|
-
function writeObjects(outputFiles, config, outputFolder, files) {
|
|
105004
|
+
async function writeObjects(outputFiles, config, outputFolder, files) {
|
|
104821
105005
|
const writeSourceMaps = config.write_source_map || false;
|
|
105006
|
+
const filesToWrite = [];
|
|
104822
105007
|
for (const output of outputFiles) {
|
|
104823
105008
|
let contents = output.chunk.getCode();
|
|
104824
105009
|
if (writeSourceMaps === true
|
|
@@ -104839,14 +105024,15 @@ function writeObjects(outputFiles, config, outputFolder, files) {
|
|
|
104839
105024
|
map = map.replace(`"${f.filename}"`, withPath);
|
|
104840
105025
|
}
|
|
104841
105026
|
}
|
|
104842
|
-
|
|
105027
|
+
filesToWrite.push({ path: outputFolder + path.sep + name, contents: map });
|
|
104843
105028
|
}
|
|
104844
105029
|
if (output.object.type.toUpperCase() === "PROG") {
|
|
104845
105030
|
// hmm, will this work for INCLUDEs ?
|
|
104846
105031
|
contents = `if (!globalThis.abap) await import("./_init.mjs");\n` + contents;
|
|
104847
105032
|
}
|
|
104848
|
-
|
|
105033
|
+
filesToWrite.push({ path: outputFolder + path.sep + output.filename, contents });
|
|
104849
105034
|
}
|
|
105035
|
+
await file_operations_1.FileOperations.writeFiles(filesToWrite);
|
|
104850
105036
|
}
|
|
104851
105037
|
async function build(config, files) {
|
|
104852
105038
|
const libFiles = await loadLib(config);
|
|
@@ -104873,7 +105059,7 @@ async function run() {
|
|
|
104873
105059
|
if (!fs.existsSync(outputFolder)) {
|
|
104874
105060
|
fs.mkdirSync(outputFolder);
|
|
104875
105061
|
}
|
|
104876
|
-
writeObjects(output.objects, config, outputFolder, files);
|
|
105062
|
+
await writeObjects(output.objects, config, outputFolder, files);
|
|
104877
105063
|
console.log(output.objects.length + " objects written to disk");
|
|
104878
105064
|
if (config.write_unit_tests === true) {
|
|
104879
105065
|
// breaking change? rename this output file,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.26",
|
|
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.115.
|
|
31
|
-
"@abaplint/transpiler": "^2.12.
|
|
30
|
+
"@abaplint/core": "^2.115.17",
|
|
31
|
+
"@abaplint/transpiler": "^2.12.26",
|
|
32
32
|
"@types/glob": "^8.1.0",
|
|
33
|
-
"@types/node": "^24.10.
|
|
33
|
+
"@types/node": "^24.10.9",
|
|
34
34
|
"@types/progress": "^2.0.7",
|
|
35
35
|
"glob": "=7.2.0",
|
|
36
36
|
"progress": "^2.0.3",
|