@abaplint/transpiler-cli 2.7.96 → 2.7.98
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 +123 -39
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -3692,7 +3692,7 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
|
|
|
3692
3692
|
const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
|
|
3693
3693
|
class FindType extends combi_1.Expression {
|
|
3694
3694
|
getRunnable() {
|
|
3695
|
-
return (0, combi_1.opt)((0, combi_1.alt)("REGEX", "SUBSTRING", (0, combi_1.ver)(version_1.Version.v755, "PCRE")));
|
|
3695
|
+
return (0, combi_1.opt)((0, combi_1.alt)("REGEX", "SUBSTRING", (0, combi_1.ver)(version_1.Version.v755, "PCRE", version_1.Version.OpenABAP)));
|
|
3696
3696
|
}
|
|
3697
3697
|
}
|
|
3698
3698
|
exports.FindType = FindType;
|
|
@@ -13221,7 +13221,7 @@ const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/
|
|
|
13221
13221
|
const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
|
|
13222
13222
|
class OpenCursor {
|
|
13223
13223
|
getMatcher() {
|
|
13224
|
-
const ret = (0, combi_1.seq)("OPEN CURSOR", (0, combi_1.optPrio)("WITH HOLD"), expressions_1.SQLTarget, "FOR", expressions_1.Select
|
|
13224
|
+
const ret = (0, combi_1.seq)("OPEN CURSOR", (0, combi_1.optPrio)("WITH HOLD"), expressions_1.SQLTarget, "FOR", expressions_1.Select);
|
|
13225
13225
|
return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
|
|
13226
13226
|
}
|
|
13227
13227
|
}
|
|
@@ -20846,7 +20846,8 @@ class TypeUtils {
|
|
|
20846
20846
|
}
|
|
20847
20847
|
}
|
|
20848
20848
|
else if (source instanceof basic_1.IntegerType) {
|
|
20849
|
-
if (target instanceof basic_1.StringType
|
|
20849
|
+
if (target instanceof basic_1.StringType
|
|
20850
|
+
|| target instanceof basic_1.PackedType) {
|
|
20850
20851
|
return false;
|
|
20851
20852
|
}
|
|
20852
20853
|
else if (target instanceof basic_1.Integer8Type) {
|
|
@@ -25881,6 +25882,15 @@ class SpaghettiScopeNode extends ScopeData {
|
|
|
25881
25882
|
}
|
|
25882
25883
|
return ret;
|
|
25883
25884
|
}
|
|
25885
|
+
listInterfaceDefinitions() {
|
|
25886
|
+
let search = this;
|
|
25887
|
+
const ret = [];
|
|
25888
|
+
while (search !== undefined) {
|
|
25889
|
+
ret.push(...Object.values(search.getData().idefs));
|
|
25890
|
+
search = search.getParent();
|
|
25891
|
+
}
|
|
25892
|
+
return ret;
|
|
25893
|
+
}
|
|
25884
25894
|
findFormDefinition(name) {
|
|
25885
25895
|
let search = this;
|
|
25886
25896
|
const upper = name.toUpperCase();
|
|
@@ -35855,7 +35865,7 @@ class MethodDefinition extends _identifier_1.Identifier {
|
|
|
35855
35865
|
this.exceptions.push(name);
|
|
35856
35866
|
}
|
|
35857
35867
|
this.visibility = visibility;
|
|
35858
|
-
this.parameters = new method_parameters_1.MethodParameters(node, this.filename, scope);
|
|
35868
|
+
this.parameters = new method_parameters_1.MethodParameters(node, this.filename, scope, this.abstract);
|
|
35859
35869
|
}
|
|
35860
35870
|
getVisibility() {
|
|
35861
35871
|
return this.visibility;
|
|
@@ -36013,7 +36023,7 @@ const _scope_type_1 = __webpack_require__(/*! ../5_syntax/_scope_type */ "./node
|
|
|
36013
36023
|
// this.exceptions = [];
|
|
36014
36024
|
// also consider RAISING vs EXCEPTIONS
|
|
36015
36025
|
class MethodParameters {
|
|
36016
|
-
constructor(node, filename, scope) {
|
|
36026
|
+
constructor(node, filename, scope, abstractMethod) {
|
|
36017
36027
|
if (!(node.get() instanceof method_def_1.MethodDef)) {
|
|
36018
36028
|
throw new Error("MethodDefinition, expected MethodDef as part of input node");
|
|
36019
36029
|
}
|
|
@@ -36029,7 +36039,7 @@ class MethodParameters {
|
|
|
36029
36039
|
// need the scope for LIKE typing inside method parameters
|
|
36030
36040
|
const parentName = scope.getName();
|
|
36031
36041
|
scope.push(_scope_type_1.ScopeType.MethodDefinition, "method definition", node.getStart(), filename);
|
|
36032
|
-
this.parse(node, scope, filename, parentName);
|
|
36042
|
+
this.parse(node, scope, filename, parentName, abstractMethod);
|
|
36033
36043
|
scope.pop(node.getEnd());
|
|
36034
36044
|
}
|
|
36035
36045
|
getFilename() {
|
|
@@ -36105,7 +36115,7 @@ class MethodParameters {
|
|
|
36105
36115
|
return this.defaults[parameter.toUpperCase()];
|
|
36106
36116
|
}
|
|
36107
36117
|
///////////////////
|
|
36108
|
-
parse(node, scope, filename, parentName) {
|
|
36118
|
+
parse(node, scope, filename, parentName, abstractMethod) {
|
|
36109
36119
|
var _a, _b;
|
|
36110
36120
|
const handler = node.findFirstExpression(Expressions.EventHandler);
|
|
36111
36121
|
if (handler) {
|
|
@@ -36145,7 +36155,7 @@ class MethodParameters {
|
|
|
36145
36155
|
}
|
|
36146
36156
|
const importing = node.findFirstExpression(Expressions.MethodDefImporting);
|
|
36147
36157
|
if (importing) {
|
|
36148
|
-
this.add(this.importing, importing, scope, ["importing" /* IdentifierMeta.MethodImporting */]);
|
|
36158
|
+
this.add(this.importing, importing, scope, ["importing" /* IdentifierMeta.MethodImporting */], abstractMethod);
|
|
36149
36159
|
if (importing.concatTokens().toUpperCase().includes(" PREFERRED PARAMETER")) {
|
|
36150
36160
|
this.preferred = importing.getLastToken().getStr().toUpperCase();
|
|
36151
36161
|
if (this.preferred.startsWith("!")) {
|
|
@@ -36155,11 +36165,11 @@ class MethodParameters {
|
|
|
36155
36165
|
}
|
|
36156
36166
|
const exporting = node.findFirstExpression(Expressions.MethodDefExporting);
|
|
36157
36167
|
if (exporting) {
|
|
36158
|
-
this.add(this.exporting, exporting, scope, ["exporting" /* IdentifierMeta.MethodExporting */]);
|
|
36168
|
+
this.add(this.exporting, exporting, scope, ["exporting" /* IdentifierMeta.MethodExporting */], abstractMethod);
|
|
36159
36169
|
}
|
|
36160
36170
|
const changing = node.findFirstExpression(Expressions.MethodDefChanging);
|
|
36161
36171
|
if (changing) {
|
|
36162
|
-
this.add(this.changing, changing, scope, ["changing" /* IdentifierMeta.MethodChanging */]);
|
|
36172
|
+
this.add(this.changing, changing, scope, ["changing" /* IdentifierMeta.MethodChanging */], abstractMethod);
|
|
36163
36173
|
}
|
|
36164
36174
|
const returning = node.findFirstExpression(Expressions.MethodDefReturning);
|
|
36165
36175
|
if (returning) {
|
|
@@ -36205,7 +36215,7 @@ class MethodParameters {
|
|
|
36205
36215
|
this.importing.push(...tempImporting);
|
|
36206
36216
|
}
|
|
36207
36217
|
}
|
|
36208
|
-
add(target, source, scope, meta) {
|
|
36218
|
+
add(target, source, scope, meta, abstractMethod) {
|
|
36209
36219
|
var _a;
|
|
36210
36220
|
for (const opt of source.findAllExpressions(Expressions.MethodParamOptional)) {
|
|
36211
36221
|
const p = opt.findDirectExpression(Expressions.MethodParam);
|
|
@@ -36219,6 +36229,9 @@ class MethodParameters {
|
|
|
36219
36229
|
else if (meta.includes("importing" /* IdentifierMeta.MethodImporting */)) {
|
|
36220
36230
|
extraMeta.push("read_only" /* IdentifierMeta.ReadOnly */);
|
|
36221
36231
|
}
|
|
36232
|
+
if (abstractMethod === true) {
|
|
36233
|
+
extraMeta.push("abstract" /* IdentifierMeta.Abstract */);
|
|
36234
|
+
}
|
|
36222
36235
|
const id = new method_param_1.MethodParam().runSyntax(p, scope, this.filename, [...meta, ...extraMeta]);
|
|
36223
36236
|
scope.addIdentifier(id);
|
|
36224
36237
|
target.push(id);
|
|
@@ -39116,6 +39129,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
39116
39129
|
|
|
39117
39130
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
39118
39131
|
exports.LSPLookup = void 0;
|
|
39132
|
+
/* eslint-disable max-len */
|
|
39119
39133
|
const LServer = __webpack_require__(/*! vscode-languageserver-types */ "./node_modules/vscode-languageserver-types/lib/esm/main.js");
|
|
39120
39134
|
const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
39121
39135
|
const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
@@ -39198,13 +39212,14 @@ class LSPLookup {
|
|
|
39198
39212
|
}
|
|
39199
39213
|
return { hover: hoverValue, definition: location, implementation: location, definitionId: variable, scope: bottomScope };
|
|
39200
39214
|
}
|
|
39201
|
-
|
|
39215
|
+
// TODO: this can be optimized, no need to loop through all the defintions, the scope knows the name of the object?
|
|
39216
|
+
for (const c of [...bottomScope.listClassDefinitions(), ...bottomScope.listInterfaceDefinitions()]) {
|
|
39202
39217
|
for (const m of ((_a = c.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {
|
|
39203
39218
|
for (const p of ((_b = m.getParameters()) === null || _b === void 0 ? void 0 : _b.getAll()) || []) {
|
|
39204
39219
|
if (p.getStart().equals(cursor.token.getStart())) {
|
|
39205
39220
|
const found = _lsp_utils_1.LSPUtils.identiferToLocation(p);
|
|
39206
39221
|
return {
|
|
39207
|
-
hover: "Method Parameter
|
|
39222
|
+
hover: "Method Parameter: " + cursor.token.getStr().replace("!", ""),
|
|
39208
39223
|
definition: found,
|
|
39209
39224
|
definitionId: p,
|
|
39210
39225
|
implementation: undefined,
|
|
@@ -39386,11 +39401,12 @@ class LSPLookup {
|
|
|
39386
39401
|
};
|
|
39387
39402
|
}
|
|
39388
39403
|
static findMethodDefinition(found, scope) {
|
|
39389
|
-
var _a, _b, _c, _d;
|
|
39404
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
39390
39405
|
if (scope === undefined) {
|
|
39391
39406
|
return undefined;
|
|
39392
39407
|
}
|
|
39393
|
-
if (scope.getIdentifier().stype !== _scope_type_1.ScopeType.ClassDefinition
|
|
39408
|
+
if ((scope.getIdentifier().stype !== _scope_type_1.ScopeType.ClassDefinition
|
|
39409
|
+
&& scope.getIdentifier().stype !== _scope_type_1.ScopeType.Interface)
|
|
39394
39410
|
|| !(found.snode.get() instanceof Statements.MethodDef)) {
|
|
39395
39411
|
return undefined;
|
|
39396
39412
|
}
|
|
@@ -39406,8 +39422,14 @@ class LSPLookup {
|
|
|
39406
39422
|
|| nameToken.getStart().getRow() !== found.token.getStart().getRow()) {
|
|
39407
39423
|
return undefined;
|
|
39408
39424
|
}
|
|
39409
|
-
|
|
39410
|
-
|
|
39425
|
+
if (scope.getIdentifier().stype === _scope_type_1.ScopeType.ClassDefinition) {
|
|
39426
|
+
const def = (_d = (_c = (_b = scope.getParent()) === null || _b === void 0 ? void 0 : _b.findClassDefinition(scope.getIdentifier().sname)) === null || _c === void 0 ? void 0 : _c.getMethodDefinitions()) === null || _d === void 0 ? void 0 : _d.getByName(nameToken.getStr());
|
|
39427
|
+
return def;
|
|
39428
|
+
}
|
|
39429
|
+
else {
|
|
39430
|
+
const def = (_g = (_f = (_e = scope.getParent()) === null || _e === void 0 ? void 0 : _e.findInterfaceDefinition(scope.getIdentifier().sname)) === null || _f === void 0 ? void 0 : _f.getMethodDefinitions()) === null || _g === void 0 ? void 0 : _g.getByName(nameToken.getStr());
|
|
39431
|
+
return def;
|
|
39432
|
+
}
|
|
39411
39433
|
}
|
|
39412
39434
|
static findFunctionModule(found) {
|
|
39413
39435
|
if (!(found.snode.get() instanceof Statements.CallFunction)) {
|
|
@@ -47947,7 +47969,7 @@ class Registry {
|
|
|
47947
47969
|
}
|
|
47948
47970
|
static abaplintVersion() {
|
|
47949
47971
|
// magic, see build script "version.sh"
|
|
47950
|
-
return "2.102.
|
|
47972
|
+
return "2.102.44";
|
|
47951
47973
|
}
|
|
47952
47974
|
getDDICReferences() {
|
|
47953
47975
|
return this.ddicReferences;
|
|
@@ -50615,7 +50637,8 @@ FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
|
50615
50637
|
if (statement.get() instanceof _statement_1.Comment) {
|
|
50616
50638
|
continue;
|
|
50617
50639
|
}
|
|
50618
|
-
else if (statement.get() instanceof Statements.EndIf
|
|
50640
|
+
else if (statement.get() instanceof Statements.EndIf
|
|
50641
|
+
|| statement.get() instanceof Statements.EndTestSeam) {
|
|
50619
50642
|
continue;
|
|
50620
50643
|
}
|
|
50621
50644
|
else {
|
|
@@ -50642,7 +50665,8 @@ FIND statement with MATCH COUNT is considered okay if subrc is not checked`,
|
|
|
50642
50665
|
return true;
|
|
50643
50666
|
}
|
|
50644
50667
|
}
|
|
50645
|
-
else if (statement.get() instanceof Statements.EndIf
|
|
50668
|
+
else if (statement.get() instanceof Statements.EndIf
|
|
50669
|
+
|| statement.get() instanceof Statements.EndTestSeam) {
|
|
50646
50670
|
continue;
|
|
50647
50671
|
}
|
|
50648
50672
|
else {
|
|
@@ -51149,7 +51173,12 @@ class CloudTypes {
|
|
|
51149
51173
|
}
|
|
51150
51174
|
run(obj) {
|
|
51151
51175
|
if (this.reg.getConfig().getVersion() !== version_1.Version.Cloud
|
|
51176
|
+
|| obj instanceof Objects.ApplicationJobCatalogEntry
|
|
51177
|
+
|| obj instanceof Objects.ApplicationJobTemplate
|
|
51152
51178
|
|| obj instanceof Objects.AssignmentServiceToAuthorizationGroup
|
|
51179
|
+
|| obj instanceof Objects.ATCCheckCategory
|
|
51180
|
+
|| obj instanceof Objects.ATCCheckObject
|
|
51181
|
+
|| obj instanceof Objects.ATCCheckVariant
|
|
51153
51182
|
|| obj instanceof Objects.AuthorizationCheckField
|
|
51154
51183
|
|| obj instanceof Objects.AuthorizationObject
|
|
51155
51184
|
|| obj instanceof Objects.AuthorizationObjectExtension
|
|
@@ -51157,11 +51186,7 @@ class CloudTypes {
|
|
|
51157
51186
|
|| obj instanceof Objects.BusinessCatalog
|
|
51158
51187
|
|| obj instanceof Objects.BusinessCatalogAppAssignment
|
|
51159
51188
|
|| obj instanceof Objects.CDSMetadataExtension
|
|
51160
|
-
|| obj instanceof Objects.RestrictionField
|
|
51161
51189
|
|| obj instanceof Objects.Class
|
|
51162
|
-
|| obj instanceof Objects.OutboundService
|
|
51163
|
-
|| obj instanceof Objects.ApplicationJobCatalogEntry
|
|
51164
|
-
|| obj instanceof Objects.ApplicationJobTemplate
|
|
51165
51190
|
|| obj instanceof Objects.CommunicationScenario
|
|
51166
51191
|
|| obj instanceof Objects.DataControl
|
|
51167
51192
|
|| obj instanceof Objects.DataDefinition
|
|
@@ -51173,11 +51198,11 @@ class CloudTypes {
|
|
|
51173
51198
|
|| obj instanceof Objects.InboundService
|
|
51174
51199
|
|| obj instanceof Objects.Interface
|
|
51175
51200
|
|| obj instanceof Objects.LockObject
|
|
51176
|
-
|| obj instanceof Objects.ATCCheckCategory
|
|
51177
|
-
|| obj instanceof Objects.ATCCheckObject
|
|
51178
|
-
|| obj instanceof Objects.ATCCheckVariant
|
|
51179
51201
|
|| obj instanceof Objects.MessageClass
|
|
51202
|
+
|| obj instanceof Objects.NumberRange
|
|
51203
|
+
|| obj instanceof Objects.OutboundService
|
|
51180
51204
|
|| obj instanceof Objects.Package
|
|
51205
|
+
|| obj instanceof Objects.RestrictionField
|
|
51181
51206
|
|| obj instanceof Objects.RestrictionType
|
|
51182
51207
|
|| obj instanceof Objects.ServiceBinding
|
|
51183
51208
|
|| obj instanceof Objects.ServiceDefinition
|
|
@@ -60236,7 +60261,9 @@ class MethodLength {
|
|
|
60236
60261
|
key: "method_length",
|
|
60237
60262
|
title: "Method/Form Length",
|
|
60238
60263
|
shortDescription: `Checks relating to method/form length.`,
|
|
60239
|
-
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
60264
|
+
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-methods-small
|
|
60265
|
+
|
|
60266
|
+
Abstract methods without statements are considered okay.`,
|
|
60240
60267
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],
|
|
60241
60268
|
};
|
|
60242
60269
|
}
|
|
@@ -60281,6 +60308,9 @@ class MethodLength {
|
|
|
60281
60308
|
continue;
|
|
60282
60309
|
}
|
|
60283
60310
|
if (s.count === 0 && this.conf.errorWhenEmpty === true) {
|
|
60311
|
+
if (this.isAbstract(s)) {
|
|
60312
|
+
continue;
|
|
60313
|
+
}
|
|
60284
60314
|
const issue = issue_1.Issue.atPosition(s.file, s.pos, this.getDescription(IssueType.EmptyMethod, "0", type), this.getMetadata().key, this.conf.severity);
|
|
60285
60315
|
issues.push(issue);
|
|
60286
60316
|
continue;
|
|
@@ -60293,6 +60323,10 @@ class MethodLength {
|
|
|
60293
60323
|
}
|
|
60294
60324
|
return issues;
|
|
60295
60325
|
}
|
|
60326
|
+
isAbstract(result) {
|
|
60327
|
+
const cdef = result.file.getInfo().getClassDefinitionByName(result.className);
|
|
60328
|
+
return (cdef === null || cdef === void 0 ? void 0 : cdef.isAbstract) === true;
|
|
60329
|
+
}
|
|
60296
60330
|
}
|
|
60297
60331
|
exports.MethodLength = MethodLength;
|
|
60298
60332
|
//# sourceMappingURL=method_length.js.map
|
|
@@ -67863,6 +67897,8 @@ class UnusedVariablesConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
67863
67897
|
* @uniqueItems true
|
|
67864
67898
|
*/
|
|
67865
67899
|
this.skipNames = [];
|
|
67900
|
+
/** skip parameters from abstract methods */
|
|
67901
|
+
this.skipAbstract = false;
|
|
67866
67902
|
}
|
|
67867
67903
|
}
|
|
67868
67904
|
exports.UnusedVariablesConf = UnusedVariablesConf;
|
|
@@ -68005,6 +68041,9 @@ Errors found in INCLUDES are reported for the main program.`,
|
|
|
68005
68041
|
&& this.conf.skipNames.some((a) => a.toUpperCase() === name)) {
|
|
68006
68042
|
continue;
|
|
68007
68043
|
}
|
|
68044
|
+
else if (this.conf.skipAbstract === true && meta.includes("abstract" /* IdentifierMeta.Abstract */)) {
|
|
68045
|
+
continue;
|
|
68046
|
+
}
|
|
68008
68047
|
else if (name === "ME"
|
|
68009
68048
|
|| name === "SUPER"
|
|
68010
68049
|
|| meta.includes("selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */)
|
|
@@ -69150,7 +69189,7 @@ class FormLengthStats {
|
|
|
69150
69189
|
}
|
|
69151
69190
|
else if (type instanceof Statements.EndForm) {
|
|
69152
69191
|
if (pos) {
|
|
69153
|
-
res.push({ name, count, file, pos });
|
|
69192
|
+
res.push({ name: name, className: "", count, file, pos });
|
|
69154
69193
|
}
|
|
69155
69194
|
else {
|
|
69156
69195
|
continue;
|
|
@@ -69403,31 +69442,37 @@ exports.IncludeGraph = IncludeGraph;
|
|
|
69403
69442
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
69404
69443
|
exports.MethodLengthStats = void 0;
|
|
69405
69444
|
const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
69445
|
+
const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
69406
69446
|
const expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
69407
69447
|
const _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
|
|
69408
69448
|
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
69409
69449
|
class MethodLengthStats {
|
|
69410
69450
|
static run(obj) {
|
|
69451
|
+
var _a;
|
|
69411
69452
|
const res = [];
|
|
69412
69453
|
let pos = undefined;
|
|
69413
|
-
let
|
|
69454
|
+
let methodName = "";
|
|
69414
69455
|
let count = 0;
|
|
69415
69456
|
let method = false;
|
|
69416
69457
|
if (!(obj instanceof _abap_object_1.ABAPObject)) {
|
|
69417
69458
|
return [];
|
|
69418
69459
|
}
|
|
69419
69460
|
for (const file of obj.getABAPFiles()) {
|
|
69461
|
+
let className = "";
|
|
69420
69462
|
for (const stat of file.getStatements()) {
|
|
69421
69463
|
const type = stat.get();
|
|
69422
69464
|
if (type instanceof Statements.MethodImplementation) {
|
|
69423
69465
|
pos = stat.getFirstToken().getStart();
|
|
69424
|
-
|
|
69466
|
+
methodName = this.findName(stat);
|
|
69425
69467
|
method = true;
|
|
69426
69468
|
count = 0;
|
|
69427
69469
|
}
|
|
69470
|
+
else if (type instanceof Statements.ClassImplementation) {
|
|
69471
|
+
className = ((_a = stat.findFirstExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || "INTERNAL_ERROR";
|
|
69472
|
+
}
|
|
69428
69473
|
else if (type instanceof Statements.EndMethod) {
|
|
69429
69474
|
if (pos) {
|
|
69430
|
-
res.push({ name, count, file, pos });
|
|
69475
|
+
res.push({ name: methodName, className, count, file, pos });
|
|
69431
69476
|
}
|
|
69432
69477
|
else {
|
|
69433
69478
|
continue;
|
|
@@ -75322,6 +75367,9 @@ class CreateDataTranspiler {
|
|
|
75322
75367
|
if (concat.includes(" TYPE LINE OF ")) {
|
|
75323
75368
|
options.push(`"typeLineOf": true`);
|
|
75324
75369
|
}
|
|
75370
|
+
if (concat.includes(" REF TO ")) {
|
|
75371
|
+
options.push(`"refTo": true`);
|
|
75372
|
+
}
|
|
75325
75373
|
const handle = node.findExpressionAfterToken("HANDLE");
|
|
75326
75374
|
if (handle) {
|
|
75327
75375
|
const so = traversal.traverse(node.findDirectExpression(abaplint.Expressions.Source));
|
|
@@ -76291,7 +76339,7 @@ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abap
|
|
|
76291
76339
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
76292
76340
|
class FindTranspiler {
|
|
76293
76341
|
transpile(node, traversal) {
|
|
76294
|
-
var _a;
|
|
76342
|
+
var _a, _b;
|
|
76295
76343
|
const options = [];
|
|
76296
76344
|
let index = 1;
|
|
76297
76345
|
const sources = node.findDirectExpressions(abaplint.Expressions.Source);
|
|
@@ -76299,6 +76347,9 @@ class FindTranspiler {
|
|
|
76299
76347
|
if ((_a = node.findFirstExpression(abaplint.Expressions.FindType)) === null || _a === void 0 ? void 0 : _a.findDirectTokenByText("REGEX")) {
|
|
76300
76348
|
options.push("regex: " + source0);
|
|
76301
76349
|
}
|
|
76350
|
+
else if ((_b = node.findFirstExpression(abaplint.Expressions.FindType)) === null || _b === void 0 ? void 0 : _b.findDirectTokenByText("PCRE")) {
|
|
76351
|
+
options.push("pcre: " + source0);
|
|
76352
|
+
}
|
|
76302
76353
|
else {
|
|
76303
76354
|
options.push("find: " + source0);
|
|
76304
76355
|
}
|
|
@@ -76941,7 +76992,7 @@ exports.InitializationTranspiler = InitializationTranspiler;
|
|
|
76941
76992
|
"use strict";
|
|
76942
76993
|
|
|
76943
76994
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
76944
|
-
exports.InsertDatabaseTranspiler = void 0;
|
|
76995
|
+
exports.findConnection = exports.InsertDatabaseTranspiler = void 0;
|
|
76945
76996
|
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
76946
76997
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
76947
76998
|
const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/transpiler/build/src/expressions/index.js");
|
|
@@ -76968,10 +77019,24 @@ class InsertDatabaseTranspiler {
|
|
|
76968
77019
|
const tvalues = traversal.traverse(fromTable);
|
|
76969
77020
|
options.push(`"table": ` + tvalues.getCode());
|
|
76970
77021
|
}
|
|
77022
|
+
const connection = node.findDirectExpression(abaplint.Expressions.DatabaseConnection);
|
|
77023
|
+
if (connection) {
|
|
77024
|
+
const con = findConnection(connection);
|
|
77025
|
+
options.push(`"connection": "${con}"`);
|
|
77026
|
+
}
|
|
76971
77027
|
return new chunk_1.Chunk(`await abap.statements.insertDatabase(${table.getCode()}, {${options.join(", ")}});`);
|
|
76972
77028
|
}
|
|
76973
77029
|
}
|
|
76974
77030
|
exports.InsertDatabaseTranspiler = InsertDatabaseTranspiler;
|
|
77031
|
+
function findConnection(connection) {
|
|
77032
|
+
let con = connection.getLastToken().getStr().toUpperCase();
|
|
77033
|
+
if (con === "DEFAULT_") {
|
|
77034
|
+
// todo, workaround for replacing of keywords,
|
|
77035
|
+
con = "DEFAULT";
|
|
77036
|
+
}
|
|
77037
|
+
return con;
|
|
77038
|
+
}
|
|
77039
|
+
exports.findConnection = findConnection;
|
|
76975
77040
|
//# sourceMappingURL=insert_database.js.map
|
|
76976
77041
|
|
|
76977
77042
|
/***/ }),
|
|
@@ -77774,6 +77839,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
77774
77839
|
exports.OpenCursorTranspiler = void 0;
|
|
77775
77840
|
const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
|
|
77776
77841
|
const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
|
|
77842
|
+
const insert_database_1 = __webpack_require__(/*! ./insert_database */ "./node_modules/@abaplint/transpiler/build/src/statements/insert_database.js");
|
|
77777
77843
|
class OpenCursorTranspiler {
|
|
77778
77844
|
transpile(node, traversal) {
|
|
77779
77845
|
const target = traversal.traverse(node.findDirectExpression(abaplint.Expressions.SQLTarget)).getCode();
|
|
@@ -77789,7 +77855,13 @@ class OpenCursorTranspiler {
|
|
|
77789
77855
|
if (orderBy) {
|
|
77790
77856
|
select += "ORDER BY " + traversal.traverse(node).getCode();
|
|
77791
77857
|
}
|
|
77792
|
-
|
|
77858
|
+
const options = [];
|
|
77859
|
+
const connection = node.findDirectExpression(abaplint.Expressions.DatabaseConnection);
|
|
77860
|
+
if (connection) {
|
|
77861
|
+
const con = (0, insert_database_1.findConnection)(connection);
|
|
77862
|
+
options.push(`"connection": "${con}"`);
|
|
77863
|
+
}
|
|
77864
|
+
return new chunk_1.Chunk().append(`await abap.statements.openCursor(${target}, "${select}", {${options.join(", ")}});`, node, traversal);
|
|
77793
77865
|
}
|
|
77794
77866
|
}
|
|
77795
77867
|
exports.OpenCursorTranspiler = OpenCursorTranspiler;
|
|
@@ -78326,7 +78398,10 @@ class ReplaceTranspiler {
|
|
|
78326
78398
|
if (type === "REGEX") {
|
|
78327
78399
|
extra.push("regex: " + new expressions_1.SourceTranspiler().transpile(sources[0], traversal).getCode());
|
|
78328
78400
|
}
|
|
78329
|
-
if (
|
|
78401
|
+
else if (type === "PCRE") {
|
|
78402
|
+
extra.push("pcre: " + new expressions_1.SourceTranspiler().transpile(sources[0], traversal).getCode());
|
|
78403
|
+
}
|
|
78404
|
+
if (o === undefined && o === undefined && type !== "REGEX" && type !== "PCRE") {
|
|
78330
78405
|
extra.push("of: " + new expressions_1.SourceTranspiler().transpile(sources[0], traversal).getCode());
|
|
78331
78406
|
}
|
|
78332
78407
|
if (concat.includes(" IGNORING CASE")) {
|
|
@@ -81703,15 +81778,24 @@ globalThis.abap = new runtime.ABAP();\n`;
|
|
|
81703
81778
|
export async function initializeABAP() {\n`;
|
|
81704
81779
|
ret += ` const sqlite = [];\n`;
|
|
81705
81780
|
for (const i of dbSetup.schemas.sqlite) {
|
|
81706
|
-
ret += `sqlite.push(\`${i}\`);\n`;
|
|
81781
|
+
ret += ` sqlite.push(\`${i}\`);\n`;
|
|
81707
81782
|
}
|
|
81708
81783
|
ret += ` const hdb = \`${dbSetup.schemas.hdb}\`;\n`;
|
|
81709
|
-
ret += ` const pg =
|
|
81710
|
-
|
|
81784
|
+
ret += ` const pg = [];\n`;
|
|
81785
|
+
for (const i of dbSetup.schemas.pg) {
|
|
81786
|
+
ret += ` pg.push(\`${i}\`);\n`;
|
|
81787
|
+
}
|
|
81788
|
+
ret += ` const snowflake = [];\n`;
|
|
81789
|
+
for (const i of dbSetup.schemas.snowflake) {
|
|
81790
|
+
ret += ` snowflake.push(\`${i}\`);\n`;
|
|
81791
|
+
}
|
|
81792
|
+
ret += ` const schemas = {sqlite, hdb, pg, snowflake};\n`;
|
|
81793
|
+
ret += `\n`;
|
|
81711
81794
|
ret += ` const insert = [];\n`;
|
|
81712
81795
|
for (const i of dbSetup.insert) {
|
|
81713
81796
|
ret += ` insert.push(\`${i}\`);\n`;
|
|
81714
81797
|
}
|
|
81798
|
+
ret += `\n`;
|
|
81715
81799
|
if (extraSetup === undefined) {
|
|
81716
81800
|
ret += `// no setup logic specified in config\n`;
|
|
81717
81801
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.98",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"author": "abaplint",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@abaplint/transpiler": "^2.7.
|
|
29
|
+
"@abaplint/transpiler": "^2.7.98",
|
|
30
30
|
"@types/glob": "^7.2.0",
|
|
31
31
|
"glob": "=7.2.0",
|
|
32
32
|
"@types/progress": "^2.0.5",
|
|
33
|
-
"@types/node": "^20.6.
|
|
34
|
-
"@abaplint/core": "^2.102.
|
|
33
|
+
"@types/node": "^20.6.3",
|
|
34
|
+
"@abaplint/core": "^2.102.44",
|
|
35
35
|
"progress": "^2.0.3",
|
|
36
36
|
"webpack": "^5.88.2",
|
|
37
37
|
"webpack-cli": "^5.1.4",
|