@abaplint/transpiler-cli 2.10.10 → 2.10.11
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 +519 -92
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -6428,7 +6428,7 @@ class SelectLoop extends combi_1.Expression {
|
|
|
6428
6428
|
const packTab = (0, combi_1.seq)(pack, _1.SQLIntoTable);
|
|
6429
6429
|
const into = (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList);
|
|
6430
6430
|
const perm = (0, combi_1.per)(_1.SQLFrom, where, sql_up_to_1.SQLUpTo, sql_order_by_1.SQLOrderBy, sql_having_1.SQLHaving, _1.SQLClient, bypass, _1.SQLGroupBy, _1.SQLForAllEntries, (0, combi_1.alt)(tab, into, packTab));
|
|
6431
|
-
const strict = (0, combi_1.seq)(_1.SQLFrom, (0, combi_1.ver)(version_1.Version.v750, _1.SQLFields), where, into, sql_up_to_1.SQLUpTo);
|
|
6431
|
+
const strict = (0, combi_1.seq)(_1.SQLFrom, (0, combi_1.ver)(version_1.Version.v750, _1.SQLFields), (0, combi_1.optPrio)((0, combi_1.seq)(where, into, sql_up_to_1.SQLUpTo)));
|
|
6432
6432
|
const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), sql_field_list_loop_1.SQLFieldListLoop, perm), strict), (0, combi_1.optPrio)(sql_hints_1.SQLHints));
|
|
6433
6433
|
return ret;
|
|
6434
6434
|
}
|
|
@@ -34140,36 +34140,18 @@ exports.FlowGraph = FlowGraph;
|
|
|
34140
34140
|
|
|
34141
34141
|
/***/ }),
|
|
34142
34142
|
|
|
34143
|
-
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/
|
|
34144
|
-
|
|
34145
|
-
!*** ./node_modules/@abaplint/core/build/src/abap/flow/
|
|
34146
|
-
|
|
34143
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js":
|
|
34144
|
+
/*!*****************************************************************************!*\
|
|
34145
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js ***!
|
|
34146
|
+
\*****************************************************************************/
|
|
34147
34147
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
34148
34148
|
|
|
34149
34149
|
"use strict";
|
|
34150
34150
|
|
|
34151
34151
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
34152
|
-
exports.
|
|
34153
|
-
const nodes_1 = __webpack_require__(/*! ../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
34154
|
-
const Structures = __webpack_require__(/*! ../3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
34152
|
+
exports.DECLARATION_STUFF = exports.SELECTION_EVENTS = void 0;
|
|
34155
34153
|
const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
34156
|
-
|
|
34157
|
-
const flow_graph_1 = __webpack_require__(/*! ./flow_graph */ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js");
|
|
34158
|
-
// Levels: top, FORM, METHOD, FUNCTION-MODULE, (MODULE, AT, END-OF-*, GET, START-OF-SELECTION, TOP-OF-PAGE)
|
|
34159
|
-
//
|
|
34160
|
-
// Loop branching: LOOP, DO, WHILE, SELECT(loop), WITH, PROVIDE
|
|
34161
|
-
//
|
|
34162
|
-
// Branching: IF, CASE, CASE TYPE OF, TRY, ON, CATCH SYSTEM-EXCEPTIONS, AT
|
|
34163
|
-
//
|
|
34164
|
-
// Conditional exits: CHECK, ASSERT
|
|
34165
|
-
//
|
|
34166
|
-
// Exits: RETURN, EXIT, RAISE(not RESUMABLE), MESSAGE(type E and A?), CONTINUE, REJECT, RESUME, STOP
|
|
34167
|
-
//
|
|
34168
|
-
// Not handled? INCLUDE + malplaced macro calls
|
|
34169
|
-
/////////////////////////////////////
|
|
34170
|
-
// TODO: handling static exceptions(only static), refactor some logic from UncaughtException to common file
|
|
34171
|
-
// TODO: RAISE
|
|
34172
|
-
const FLOW_EVENTS = [
|
|
34154
|
+
exports.SELECTION_EVENTS = [
|
|
34173
34155
|
Statements.StartOfSelection,
|
|
34174
34156
|
Statements.AtSelectionScreen,
|
|
34175
34157
|
Statements.AtLineSelection,
|
|
@@ -34177,17 +34159,51 @@ const FLOW_EVENTS = [
|
|
|
34177
34159
|
Statements.EndOfSelection,
|
|
34178
34160
|
Statements.Initialization,
|
|
34179
34161
|
Statements.TopOfPage,
|
|
34162
|
+
Statements.LoadOfProgram,
|
|
34180
34163
|
Statements.EndOfPage,
|
|
34181
34164
|
];
|
|
34165
|
+
exports.DECLARATION_STUFF = [
|
|
34166
|
+
Statements.Data,
|
|
34167
|
+
Statements.DataBegin,
|
|
34168
|
+
Statements.Constant,
|
|
34169
|
+
Statements.Tables,
|
|
34170
|
+
Statements.Include, // this is not super correct, but anyhow
|
|
34171
|
+
Statements.Parameter,
|
|
34172
|
+
Statements.SelectionScreen,
|
|
34173
|
+
Statements.ConstantBegin,
|
|
34174
|
+
];
|
|
34175
|
+
//# sourceMappingURL=selection_events.js.map
|
|
34176
|
+
|
|
34177
|
+
/***/ }),
|
|
34178
|
+
|
|
34179
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js":
|
|
34180
|
+
/*!***************************************************************************!*\
|
|
34181
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/flow/statement_flow.js ***!
|
|
34182
|
+
\***************************************************************************/
|
|
34183
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
34184
|
+
|
|
34185
|
+
"use strict";
|
|
34186
|
+
|
|
34187
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
34188
|
+
exports.StatementFlow = void 0;
|
|
34189
|
+
const nodes_1 = __webpack_require__(/*! ../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
34190
|
+
const Structures = __webpack_require__(/*! ../3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
34191
|
+
const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
34192
|
+
const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
|
|
34193
|
+
const flow_graph_1 = __webpack_require__(/*! ./flow_graph */ "./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js");
|
|
34194
|
+
const objects_1 = __webpack_require__(/*! ../../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
34195
|
+
const selection_events_1 = __webpack_require__(/*! ./selection_events */ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js");
|
|
34182
34196
|
class StatementFlow {
|
|
34183
34197
|
constructor() {
|
|
34184
34198
|
this.counter = 0;
|
|
34185
34199
|
}
|
|
34186
|
-
build(stru) {
|
|
34200
|
+
build(stru, obj) {
|
|
34187
34201
|
var _a, _b, _c, _d;
|
|
34188
34202
|
const ret = [];
|
|
34189
34203
|
let name = "";
|
|
34190
|
-
const structures = stru.findAllStructuresMulti([
|
|
34204
|
+
const structures = stru.findAllStructuresMulti([
|
|
34205
|
+
Structures.Form, Structures.ClassImplementation, Structures.FunctionModule, Structures.Module
|
|
34206
|
+
]);
|
|
34191
34207
|
for (const s of structures) {
|
|
34192
34208
|
if (s.get() instanceof Structures.Form) {
|
|
34193
34209
|
name = "FORM " + ((_a = s.findFirstExpression(Expressions.FormName)) === null || _a === void 0 ? void 0 : _a.concatTokens());
|
|
@@ -34205,40 +34221,46 @@ class StatementFlow {
|
|
|
34205
34221
|
name = "FUNCTION " + ((_d = s.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens());
|
|
34206
34222
|
ret.push(this.run(s, name));
|
|
34207
34223
|
}
|
|
34224
|
+
else if (s.get() instanceof Structures.Module) {
|
|
34225
|
+
name = s.getFirstStatement().concatTokens().toUpperCase();
|
|
34226
|
+
ret.push(this.run(s, name));
|
|
34227
|
+
}
|
|
34208
34228
|
else {
|
|
34209
34229
|
throw new Error("StatementFlow, unknown structure");
|
|
34210
34230
|
}
|
|
34211
34231
|
}
|
|
34212
|
-
|
|
34213
|
-
|
|
34214
|
-
|
|
34215
|
-
|
|
34216
|
-
|
|
34217
|
-
if (
|
|
34218
|
-
|
|
34232
|
+
if (obj instanceof objects_1.Program) {
|
|
34233
|
+
// find the top level events
|
|
34234
|
+
let inEvent = false;
|
|
34235
|
+
let collected = [];
|
|
34236
|
+
for (const s of stru.getChildren() || []) {
|
|
34237
|
+
if (selection_events_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
34238
|
+
if (inEvent === true) {
|
|
34239
|
+
ret.push(this.runEvent(collected, name));
|
|
34240
|
+
}
|
|
34241
|
+
collected = [];
|
|
34242
|
+
inEvent = true;
|
|
34243
|
+
name = s.concatTokens();
|
|
34244
|
+
}
|
|
34245
|
+
else if (s.get() instanceof Structures.Normal) {
|
|
34246
|
+
collected.push(s);
|
|
34247
|
+
}
|
|
34248
|
+
else {
|
|
34249
|
+
if (inEvent === true) {
|
|
34250
|
+
ret.push(this.runEvent(collected, name));
|
|
34251
|
+
inEvent = false;
|
|
34252
|
+
}
|
|
34253
|
+
collected = [];
|
|
34219
34254
|
}
|
|
34220
|
-
collected = [];
|
|
34221
|
-
inFlow = true;
|
|
34222
|
-
name = s.concatTokens();
|
|
34223
34255
|
}
|
|
34224
|
-
|
|
34225
|
-
|
|
34256
|
+
if (inEvent === true) {
|
|
34257
|
+
ret.push(this.runEvent(collected, name));
|
|
34226
34258
|
}
|
|
34227
|
-
else {
|
|
34228
|
-
|
|
34229
|
-
|
|
34230
|
-
inFlow = false;
|
|
34231
|
-
}
|
|
34232
|
-
collected = [];
|
|
34259
|
+
else if (collected.length > 0) {
|
|
34260
|
+
// implicit START-OF-SELECTION
|
|
34261
|
+
ret.push(this.runEvent(collected, "START-OF-SELECTION."));
|
|
34233
34262
|
}
|
|
34234
34263
|
}
|
|
34235
|
-
if (inFlow === true) {
|
|
34236
|
-
ret.push(this.runEvent(collected, name));
|
|
34237
|
-
}
|
|
34238
|
-
else if (collected.length > 0) {
|
|
34239
|
-
// implicit START-OF-SELECTION
|
|
34240
|
-
ret.push(this.runEvent(collected, "START-OF-SELECTION."));
|
|
34241
|
-
}
|
|
34242
34264
|
return ret.map(f => f.reduce());
|
|
34243
34265
|
}
|
|
34244
34266
|
////////////////////
|
|
@@ -34385,6 +34407,7 @@ class StatementFlow {
|
|
|
34385
34407
|
graph.addEdge(loopName, graph.getEnd(), flow_graph_1.FLOW_EDGE_TYPE.false);
|
|
34386
34408
|
}
|
|
34387
34409
|
else if (type instanceof Structures.Data
|
|
34410
|
+
|| type instanceof Structures.Constants
|
|
34388
34411
|
|| type instanceof Structures.Types) {
|
|
34389
34412
|
// these doesnt affect control flow, so just take the first statement
|
|
34390
34413
|
const statement = n.getFirstStatement();
|
|
@@ -41397,8 +41420,10 @@ const _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identif
|
|
|
41397
41420
|
const _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
|
|
41398
41421
|
const _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js");
|
|
41399
41422
|
const _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js");
|
|
41423
|
+
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
41400
41424
|
const types_1 = __webpack_require__(/*! ../abap/types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
|
|
41401
41425
|
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js");
|
|
41426
|
+
const include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ "./node_modules/@abaplint/core/build/src/utils/include_graph.js");
|
|
41402
41427
|
class LSPLookup {
|
|
41403
41428
|
static lookup(cursor, reg, obj) {
|
|
41404
41429
|
var _a, _b;
|
|
@@ -41411,7 +41436,17 @@ class LSPLookup {
|
|
|
41411
41436
|
if (fm) {
|
|
41412
41437
|
return { hover: "Function Module " + fm };
|
|
41413
41438
|
}
|
|
41414
|
-
|
|
41439
|
+
let main = obj;
|
|
41440
|
+
if (obj instanceof objects_1.Program && obj.isInclude()) {
|
|
41441
|
+
// todo: this is slow
|
|
41442
|
+
const ig = new include_graph_1.IncludeGraph(reg);
|
|
41443
|
+
const mains = ig.listMainForInclude(cursor.identifier.getFilename());
|
|
41444
|
+
if (mains.length === 1) {
|
|
41445
|
+
// yea, well, or it has to be a popup
|
|
41446
|
+
main = reg.findObjectForFile(reg.getFileByName(mains[0])) || obj;
|
|
41447
|
+
}
|
|
41448
|
+
}
|
|
41449
|
+
const bottomScope = new syntax_1.SyntaxLogic(reg, main).run().spaghetti.lookupPosition(cursor.identifier.getStart(), cursor.identifier.getFilename());
|
|
41415
41450
|
if (bottomScope === undefined) {
|
|
41416
41451
|
return undefined;
|
|
41417
41452
|
}
|
|
@@ -42945,11 +42980,15 @@ class LanguageServer {
|
|
|
42945
42980
|
if (file === undefined) {
|
|
42946
42981
|
return "file not found";
|
|
42947
42982
|
}
|
|
42983
|
+
const obj = this.reg.findObjectForFile(file);
|
|
42984
|
+
if (obj === undefined) {
|
|
42985
|
+
return "obj not found";
|
|
42986
|
+
}
|
|
42948
42987
|
const stru = file.getStructure();
|
|
42949
42988
|
if (stru === undefined) {
|
|
42950
42989
|
return "empty structure";
|
|
42951
42990
|
}
|
|
42952
|
-
const graphs = new statement_flow_1.StatementFlow().build(stru);
|
|
42991
|
+
const graphs = new statement_flow_1.StatementFlow().build(stru, obj);
|
|
42953
42992
|
const wiz = graphs.map(g => g.toDigraph());
|
|
42954
42993
|
return JSON.stringify(wiz);
|
|
42955
42994
|
}
|
|
@@ -43814,6 +43853,45 @@ exports.AbstractObject = AbstractObject;
|
|
|
43814
43853
|
|
|
43815
43854
|
/***/ }),
|
|
43816
43855
|
|
|
43856
|
+
/***/ "./node_modules/@abaplint/core/build/src/objects/_dynpros.js":
|
|
43857
|
+
/*!*******************************************************************!*\
|
|
43858
|
+
!*** ./node_modules/@abaplint/core/build/src/objects/_dynpros.js ***!
|
|
43859
|
+
\*******************************************************************/
|
|
43860
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
43861
|
+
|
|
43862
|
+
"use strict";
|
|
43863
|
+
|
|
43864
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
43865
|
+
exports.parseDynpros = parseDynpros;
|
|
43866
|
+
const xml_utils_1 = __webpack_require__(/*! ../xml_utils */ "./node_modules/@abaplint/core/build/src/xml_utils.js");
|
|
43867
|
+
function parseDynpros(parsed) {
|
|
43868
|
+
var _a, _b, _c, _d;
|
|
43869
|
+
const dynpros = [];
|
|
43870
|
+
const xmlDynpros = (_c = (_b = (_a = parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.DYNPROS;
|
|
43871
|
+
if (xmlDynpros !== undefined) {
|
|
43872
|
+
for (const d of (0, xml_utils_1.xmlToArray)(xmlDynpros.item)) {
|
|
43873
|
+
const fields = [];
|
|
43874
|
+
for (const f of (0, xml_utils_1.xmlToArray)((_d = d.FIELDS) === null || _d === void 0 ? void 0 : _d.RPY_DYFATC)) {
|
|
43875
|
+
fields.push({
|
|
43876
|
+
name: f.NAME,
|
|
43877
|
+
type: f.TYPE,
|
|
43878
|
+
length: f.LENGTH,
|
|
43879
|
+
});
|
|
43880
|
+
}
|
|
43881
|
+
dynpros.push({
|
|
43882
|
+
number: d.HEADER.SCREEN,
|
|
43883
|
+
description: d.HEADER.DESCRIPT,
|
|
43884
|
+
nextScreen: d.HEADER.NEXTSCREEN,
|
|
43885
|
+
fields: fields,
|
|
43886
|
+
});
|
|
43887
|
+
}
|
|
43888
|
+
}
|
|
43889
|
+
return dynpros;
|
|
43890
|
+
}
|
|
43891
|
+
//# sourceMappingURL=_dynpros.js.map
|
|
43892
|
+
|
|
43893
|
+
/***/ }),
|
|
43894
|
+
|
|
43817
43895
|
/***/ "./node_modules/@abaplint/core/build/src/objects/_unknown_object.js":
|
|
43818
43896
|
/*!**************************************************************************!*\
|
|
43819
43897
|
!*** ./node_modules/@abaplint/core/build/src/objects/_unknown_object.js ***!
|
|
@@ -45505,6 +45583,7 @@ class DataElement extends _abstract_object_1.AbstractObject {
|
|
|
45505
45583
|
}
|
|
45506
45584
|
getDescription() {
|
|
45507
45585
|
var _a;
|
|
45586
|
+
this.parse();
|
|
45508
45587
|
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.description;
|
|
45509
45588
|
}
|
|
45510
45589
|
getAllowedNaming() {
|
|
@@ -45522,6 +45601,11 @@ class DataElement extends _abstract_object_1.AbstractObject {
|
|
|
45522
45601
|
this.parse();
|
|
45523
45602
|
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.domname;
|
|
45524
45603
|
}
|
|
45604
|
+
getTexts() {
|
|
45605
|
+
var _a;
|
|
45606
|
+
this.parse();
|
|
45607
|
+
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.texts;
|
|
45608
|
+
}
|
|
45525
45609
|
parseType(reg) {
|
|
45526
45610
|
const references = [];
|
|
45527
45611
|
let lookup = undefined;
|
|
@@ -45580,6 +45664,12 @@ class DataElement extends _abstract_object_1.AbstractObject {
|
|
|
45580
45664
|
datatype: dd04v === null || dd04v === void 0 ? void 0 : dd04v.DATATYPE,
|
|
45581
45665
|
leng: dd04v === null || dd04v === void 0 ? void 0 : dd04v.LENG,
|
|
45582
45666
|
decimals: dd04v === null || dd04v === void 0 ? void 0 : dd04v.DECIMALS,
|
|
45667
|
+
texts: {
|
|
45668
|
+
short: dd04v === null || dd04v === void 0 ? void 0 : dd04v.SCRTEXT_S,
|
|
45669
|
+
medium: dd04v === null || dd04v === void 0 ? void 0 : dd04v.SCRTEXT_M,
|
|
45670
|
+
long: dd04v === null || dd04v === void 0 ? void 0 : dd04v.SCRTEXT_L,
|
|
45671
|
+
heading: dd04v === null || dd04v === void 0 ? void 0 : dd04v.REPTEXT,
|
|
45672
|
+
},
|
|
45583
45673
|
};
|
|
45584
45674
|
const end = Date.now();
|
|
45585
45675
|
return { updated: true, runtime: end - start };
|
|
@@ -46217,18 +46307,23 @@ const _abap_object_1 = __webpack_require__(/*! ./_abap_object */ "./node_modules
|
|
|
46217
46307
|
const types_1 = __webpack_require__(/*! ../abap/types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
|
|
46218
46308
|
const xml_utils_1 = __webpack_require__(/*! ../xml_utils */ "./node_modules/@abaplint/core/build/src/xml_utils.js");
|
|
46219
46309
|
const fast_xml_parser_1 = __webpack_require__(/*! fast-xml-parser */ "./node_modules/fast-xml-parser/src/fxp.js");
|
|
46310
|
+
const _dynpros_1 = __webpack_require__(/*! ./_dynpros */ "./node_modules/@abaplint/core/build/src/objects/_dynpros.js");
|
|
46220
46311
|
class FunctionGroup extends _abap_object_1.ABAPObject {
|
|
46221
46312
|
constructor() {
|
|
46222
46313
|
super(...arguments);
|
|
46223
46314
|
this.includes = undefined;
|
|
46224
46315
|
this.modules = undefined;
|
|
46316
|
+
this.description = undefined;
|
|
46317
|
+
this.dynpros = undefined;
|
|
46225
46318
|
}
|
|
46226
46319
|
getType() {
|
|
46227
46320
|
return "FUGR";
|
|
46228
46321
|
}
|
|
46229
46322
|
getDescription() {
|
|
46230
|
-
|
|
46231
|
-
|
|
46323
|
+
if (this.description === undefined) {
|
|
46324
|
+
this.parseXML();
|
|
46325
|
+
}
|
|
46326
|
+
return this.description;
|
|
46232
46327
|
}
|
|
46233
46328
|
setDirty() {
|
|
46234
46329
|
super.setDirty();
|
|
@@ -46241,6 +46336,12 @@ class FunctionGroup extends _abap_object_1.ABAPObject {
|
|
|
46241
46336
|
allowNamespace: true,
|
|
46242
46337
|
};
|
|
46243
46338
|
}
|
|
46339
|
+
getDynpros() {
|
|
46340
|
+
if (this.dynpros === undefined) {
|
|
46341
|
+
this.parseXML();
|
|
46342
|
+
}
|
|
46343
|
+
return this.dynpros || [];
|
|
46344
|
+
}
|
|
46244
46345
|
getSequencedFiles() {
|
|
46245
46346
|
const main = this.getMainABAPFile();
|
|
46246
46347
|
if (main === undefined) {
|
|
@@ -46342,22 +46443,24 @@ class FunctionGroup extends _abap_object_1.ABAPObject {
|
|
|
46342
46443
|
}
|
|
46343
46444
|
/////////////////////////////////
|
|
46344
46445
|
parseXML() {
|
|
46345
|
-
var _a, _b;
|
|
46446
|
+
var _a, _b, _c;
|
|
46346
46447
|
this.includes = [];
|
|
46347
46448
|
this.modules = [];
|
|
46348
46449
|
const parsed = this.parseRaw2();
|
|
46349
46450
|
if (parsed === undefined) {
|
|
46350
46451
|
return;
|
|
46351
46452
|
}
|
|
46453
|
+
this.description = (_a = parsed.abapGit["asx:abap"]["asx:values"]) === null || _a === void 0 ? void 0 : _a.AREAT;
|
|
46454
|
+
this.dynpros = (0, _dynpros_1.parseDynpros)(parsed);
|
|
46352
46455
|
// INCLUDES
|
|
46353
|
-
const includes = (
|
|
46456
|
+
const includes = (_b = parsed.abapGit["asx:abap"]["asx:values"]) === null || _b === void 0 ? void 0 : _b.INCLUDES;
|
|
46354
46457
|
if (includes !== undefined) {
|
|
46355
46458
|
for (const i of (0, xml_utils_1.xmlToArray)(includes.SOBJ_NAME)) {
|
|
46356
46459
|
this.includes.push(i);
|
|
46357
46460
|
}
|
|
46358
46461
|
}
|
|
46359
46462
|
// FUNCTION MODULES
|
|
46360
|
-
const functions = (
|
|
46463
|
+
const functions = (_c = parsed.abapGit["asx:abap"]["asx:values"]) === null || _c === void 0 ? void 0 : _c.FUNCTIONS;
|
|
46361
46464
|
for (const module of (0, xml_utils_1.xmlToArray)(functions === null || functions === void 0 ? void 0 : functions.item)) {
|
|
46362
46465
|
this.modules.push(new types_1.FunctionModuleDefinition(module));
|
|
46363
46466
|
}
|
|
@@ -48716,7 +48819,7 @@ exports.PersonalizationObject = PersonalizationObject;
|
|
|
48716
48819
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
48717
48820
|
exports.Program = void 0;
|
|
48718
48821
|
const _abap_object_1 = __webpack_require__(/*! ./_abap_object */ "./node_modules/@abaplint/core/build/src/objects/_abap_object.js");
|
|
48719
|
-
const
|
|
48822
|
+
const _dynpros_1 = __webpack_require__(/*! ./_dynpros */ "./node_modules/@abaplint/core/build/src/objects/_dynpros.js");
|
|
48720
48823
|
class Program extends _abap_object_1.ABAPObject {
|
|
48721
48824
|
getType() {
|
|
48722
48825
|
return "PROG";
|
|
@@ -48752,11 +48855,10 @@ class Program extends _abap_object_1.ABAPObject {
|
|
|
48752
48855
|
}
|
|
48753
48856
|
getDynpros() {
|
|
48754
48857
|
this.parseXML();
|
|
48755
|
-
return this.parsedXML.dynpros;
|
|
48858
|
+
return this.parsedXML.dynpros || [];
|
|
48756
48859
|
}
|
|
48757
48860
|
////////////////////////////
|
|
48758
48861
|
parseXML() {
|
|
48759
|
-
var _a, _b, _c, _d;
|
|
48760
48862
|
if (this.parsedXML !== undefined) {
|
|
48761
48863
|
return;
|
|
48762
48864
|
}
|
|
@@ -48770,24 +48872,7 @@ class Program extends _abap_object_1.ABAPObject {
|
|
|
48770
48872
|
};
|
|
48771
48873
|
return;
|
|
48772
48874
|
}
|
|
48773
|
-
const dynpros =
|
|
48774
|
-
const xmlDynpros = (_c = (_b = (_a = parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.DYNPROS;
|
|
48775
|
-
if (xmlDynpros !== undefined) {
|
|
48776
|
-
for (const d of (0, xml_utils_1.xmlToArray)(xmlDynpros.item)) {
|
|
48777
|
-
const fields = [];
|
|
48778
|
-
for (const f of (0, xml_utils_1.xmlToArray)((_d = d.FIELDS) === null || _d === void 0 ? void 0 : _d.RPY_DYFATC)) {
|
|
48779
|
-
fields.push({
|
|
48780
|
-
name: f.NAME,
|
|
48781
|
-
type: f.TYPE,
|
|
48782
|
-
length: f.LENGTH,
|
|
48783
|
-
});
|
|
48784
|
-
}
|
|
48785
|
-
dynpros.push({
|
|
48786
|
-
number: d.HEADER.SCREEN,
|
|
48787
|
-
fields: fields,
|
|
48788
|
-
});
|
|
48789
|
-
}
|
|
48790
|
-
}
|
|
48875
|
+
const dynpros = (0, _dynpros_1.parseDynpros)(parsed);
|
|
48791
48876
|
this.parsedXML = {
|
|
48792
48877
|
isInclude: file ? file.getRaw().includes("<SUBC>I</SUBC>") : false,
|
|
48793
48878
|
isModulePool: file ? file.getRaw().includes("<SUBC>M</SUBC>") : false,
|
|
@@ -51564,7 +51649,7 @@ class Registry {
|
|
|
51564
51649
|
}
|
|
51565
51650
|
static abaplintVersion() {
|
|
51566
51651
|
// magic, see build script "version.sh"
|
|
51567
|
-
return "2.
|
|
51652
|
+
return "2.113.6";
|
|
51568
51653
|
}
|
|
51569
51654
|
getDDICReferences() {
|
|
51570
51655
|
return this.ddicReferences;
|
|
@@ -52202,6 +52287,111 @@ exports.Abapdoc = Abapdoc;
|
|
|
52202
52287
|
|
|
52203
52288
|
/***/ }),
|
|
52204
52289
|
|
|
52290
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/add_test_attributes.js":
|
|
52291
|
+
/*!****************************************************************************!*\
|
|
52292
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/add_test_attributes.js ***!
|
|
52293
|
+
\****************************************************************************/
|
|
52294
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
52295
|
+
|
|
52296
|
+
"use strict";
|
|
52297
|
+
|
|
52298
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
52299
|
+
exports.AddTestAttributes = exports.AddTestAttributesConf = void 0;
|
|
52300
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
52301
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
52302
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
52303
|
+
const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
|
|
52304
|
+
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
52305
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
52306
|
+
class AddTestAttributesConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
52307
|
+
}
|
|
52308
|
+
exports.AddTestAttributesConf = AddTestAttributesConf;
|
|
52309
|
+
class AddTestAttributes extends _abap_rule_1.ABAPRule {
|
|
52310
|
+
constructor() {
|
|
52311
|
+
super(...arguments);
|
|
52312
|
+
this.conf = new AddTestAttributesConf();
|
|
52313
|
+
}
|
|
52314
|
+
getMetadata() {
|
|
52315
|
+
return {
|
|
52316
|
+
key: "add_test_attributes",
|
|
52317
|
+
title: "Add test attributes for tests classes with test methods",
|
|
52318
|
+
shortDescription: `Add test attributes DURATION and RISK LEVEL for tests classes with test methods`,
|
|
52319
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
52320
|
+
badExample: `CLASS ltcl_test1 DEFINITION FINAL FOR TESTING.
|
|
52321
|
+
PUBLIC SECTION.
|
|
52322
|
+
PROTECTED SECTION.
|
|
52323
|
+
PRIVATE SECTION.
|
|
52324
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
52325
|
+
ENDCLASS.
|
|
52326
|
+
|
|
52327
|
+
CLASS ltcl_test1 IMPLEMENTATION.
|
|
52328
|
+
METHOD test.
|
|
52329
|
+
ENDMETHOD.
|
|
52330
|
+
ENDCLASS.`,
|
|
52331
|
+
goodExample: `CLASS ltcl_test2 DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
|
52332
|
+
PUBLIC SECTION.
|
|
52333
|
+
PROTECTED SECTION.
|
|
52334
|
+
PRIVATE SECTION.
|
|
52335
|
+
METHODS test FOR TESTING RAISING cx_static_check.
|
|
52336
|
+
ENDCLASS.
|
|
52337
|
+
|
|
52338
|
+
CLASS ltcl_test2 IMPLEMENTATION.
|
|
52339
|
+
METHOD test.
|
|
52340
|
+
ENDMETHOD.
|
|
52341
|
+
ENDCLASS.`,
|
|
52342
|
+
};
|
|
52343
|
+
}
|
|
52344
|
+
getConfig() {
|
|
52345
|
+
return this.conf;
|
|
52346
|
+
}
|
|
52347
|
+
setConfig(conf) {
|
|
52348
|
+
this.conf = conf;
|
|
52349
|
+
}
|
|
52350
|
+
runParsed(file) {
|
|
52351
|
+
const issues = [];
|
|
52352
|
+
const stru = file.getStructure();
|
|
52353
|
+
if (stru === undefined) {
|
|
52354
|
+
return [];
|
|
52355
|
+
}
|
|
52356
|
+
for (const classStructure of stru.findAllStructures(Structures.ClassDefinition)) {
|
|
52357
|
+
const cdef = classStructure.findFirstStatement(Statements.ClassDefinition);
|
|
52358
|
+
if (cdef === undefined) {
|
|
52359
|
+
continue;
|
|
52360
|
+
}
|
|
52361
|
+
const cdefConcat = cdef === null || cdef === void 0 ? void 0 : cdef.concatTokens().toUpperCase();
|
|
52362
|
+
if ((cdefConcat === null || cdefConcat === void 0 ? void 0 : cdefConcat.includes(" FOR TESTING")) === false) {
|
|
52363
|
+
continue;
|
|
52364
|
+
}
|
|
52365
|
+
const hasDuration = cdefConcat === null || cdefConcat === void 0 ? void 0 : cdefConcat.includes(" DURATION ");
|
|
52366
|
+
const hasRiskLevel = cdefConcat === null || cdefConcat === void 0 ? void 0 : cdefConcat.includes(" RISK LEVEL ");
|
|
52367
|
+
if (hasDuration === true && hasRiskLevel === true) {
|
|
52368
|
+
continue;
|
|
52369
|
+
}
|
|
52370
|
+
let hasTestMethod = false;
|
|
52371
|
+
for (const mdef of classStructure.findAllStatements(Statements.MethodDef)) {
|
|
52372
|
+
const concat = mdef.concatTokens().toUpperCase();
|
|
52373
|
+
if (concat.includes(" FOR TESTING")) {
|
|
52374
|
+
hasTestMethod = true;
|
|
52375
|
+
}
|
|
52376
|
+
}
|
|
52377
|
+
if (hasTestMethod === false) {
|
|
52378
|
+
continue;
|
|
52379
|
+
}
|
|
52380
|
+
if (hasDuration === false) {
|
|
52381
|
+
issues.push(issue_1.Issue.atStatement(file, cdef, "Add DURATION", this.getMetadata().key, this.getConfig().severity));
|
|
52382
|
+
}
|
|
52383
|
+
if (hasRiskLevel === false) {
|
|
52384
|
+
issues.push(issue_1.Issue.atStatement(file, cdef, "Add RISK LEVEL", this.getMetadata().key, this.getConfig().severity));
|
|
52385
|
+
}
|
|
52386
|
+
}
|
|
52387
|
+
return issues;
|
|
52388
|
+
}
|
|
52389
|
+
}
|
|
52390
|
+
exports.AddTestAttributes = AddTestAttributes;
|
|
52391
|
+
//# sourceMappingURL=add_test_attributes.js.map
|
|
52392
|
+
|
|
52393
|
+
/***/ }),
|
|
52394
|
+
|
|
52205
52395
|
/***/ "./node_modules/@abaplint/core/build/src/rules/align_parameters.js":
|
|
52206
52396
|
/*!*************************************************************************!*\
|
|
52207
52397
|
!*** ./node_modules/@abaplint/core/build/src/rules/align_parameters.js ***!
|
|
@@ -59625,6 +59815,100 @@ exports.EasyToFindMessages = EasyToFindMessages;
|
|
|
59625
59815
|
|
|
59626
59816
|
/***/ }),
|
|
59627
59817
|
|
|
59818
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/empty_event.js":
|
|
59819
|
+
/*!********************************************************************!*\
|
|
59820
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/empty_event.js ***!
|
|
59821
|
+
\********************************************************************/
|
|
59822
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
59823
|
+
|
|
59824
|
+
"use strict";
|
|
59825
|
+
|
|
59826
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
59827
|
+
exports.EmptyEvent = exports.EmptyEventConf = void 0;
|
|
59828
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
59829
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
59830
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
59831
|
+
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
59832
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
59833
|
+
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
59834
|
+
const selection_events_1 = __webpack_require__(/*! ../abap/flow/selection_events */ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js");
|
|
59835
|
+
class EmptyEventConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
59836
|
+
}
|
|
59837
|
+
exports.EmptyEventConf = EmptyEventConf;
|
|
59838
|
+
class EmptyEvent extends _abap_rule_1.ABAPRule {
|
|
59839
|
+
constructor() {
|
|
59840
|
+
super(...arguments);
|
|
59841
|
+
this.conf = new EmptyEventConf();
|
|
59842
|
+
}
|
|
59843
|
+
getMetadata() {
|
|
59844
|
+
return {
|
|
59845
|
+
key: "empty_event",
|
|
59846
|
+
title: "Empty selection screen or list processing event block",
|
|
59847
|
+
shortDescription: `Empty selection screen or list processing event block`,
|
|
59848
|
+
extendedInformation: ``,
|
|
59849
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
59850
|
+
badExample: `
|
|
59851
|
+
INITIALIZATION.
|
|
59852
|
+
WRITE 'hello'.
|
|
59853
|
+
END-OF-SELECTION.`,
|
|
59854
|
+
goodExample: `
|
|
59855
|
+
START-OF-SELECTION.
|
|
59856
|
+
PERFORM sdf.
|
|
59857
|
+
COMMIT WORK.`,
|
|
59858
|
+
};
|
|
59859
|
+
}
|
|
59860
|
+
getConfig() {
|
|
59861
|
+
return this.conf;
|
|
59862
|
+
}
|
|
59863
|
+
setConfig(conf) {
|
|
59864
|
+
this.conf = conf;
|
|
59865
|
+
}
|
|
59866
|
+
runParsed(file, obj) {
|
|
59867
|
+
const issues = [];
|
|
59868
|
+
if (!(obj instanceof objects_1.Program) || obj.isInclude()) {
|
|
59869
|
+
return issues;
|
|
59870
|
+
}
|
|
59871
|
+
const stru = file.getStructure();
|
|
59872
|
+
if (stru === undefined) {
|
|
59873
|
+
return [];
|
|
59874
|
+
}
|
|
59875
|
+
let currentEvent = undefined;
|
|
59876
|
+
let children = [];
|
|
59877
|
+
for (const s of stru.getChildren() || []) {
|
|
59878
|
+
if (selection_events_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
59879
|
+
if (currentEvent !== undefined && children.length === 0) {
|
|
59880
|
+
issues.push(issue_1.Issue.atStatement(file, currentEvent, "Empty event", this.getMetadata().key, this.getConfig().severity));
|
|
59881
|
+
}
|
|
59882
|
+
children = [];
|
|
59883
|
+
currentEvent = s;
|
|
59884
|
+
}
|
|
59885
|
+
else if (s.get() instanceof Structures.Normal) {
|
|
59886
|
+
const stru = s;
|
|
59887
|
+
// ignore declaration stuff
|
|
59888
|
+
if (selection_events_1.DECLARATION_STUFF.some(d => { var _a; return ((_a = stru.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.get()) instanceof d; })) {
|
|
59889
|
+
continue;
|
|
59890
|
+
}
|
|
59891
|
+
children.push(s);
|
|
59892
|
+
}
|
|
59893
|
+
else {
|
|
59894
|
+
if (currentEvent !== undefined && children.length === 0) {
|
|
59895
|
+
issues.push(issue_1.Issue.atStatement(file, currentEvent, "Empty event", this.getMetadata().key, this.getConfig().severity));
|
|
59896
|
+
}
|
|
59897
|
+
children = [];
|
|
59898
|
+
currentEvent = undefined;
|
|
59899
|
+
}
|
|
59900
|
+
}
|
|
59901
|
+
if (currentEvent !== undefined && children.length === 0) {
|
|
59902
|
+
issues.push(issue_1.Issue.atStatement(file, currentEvent, "Empty event", this.getMetadata().key, this.getConfig().severity));
|
|
59903
|
+
}
|
|
59904
|
+
return issues;
|
|
59905
|
+
}
|
|
59906
|
+
}
|
|
59907
|
+
exports.EmptyEvent = EmptyEvent;
|
|
59908
|
+
//# sourceMappingURL=empty_event.js.map
|
|
59909
|
+
|
|
59910
|
+
/***/ }),
|
|
59911
|
+
|
|
59628
59912
|
/***/ "./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js":
|
|
59629
59913
|
/*!********************************************************************************!*\
|
|
59630
59914
|
!*** ./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js ***!
|
|
@@ -61991,6 +62275,109 @@ exports.ImplementMethods = ImplementMethods;
|
|
|
61991
62275
|
|
|
61992
62276
|
/***/ }),
|
|
61993
62277
|
|
|
62278
|
+
/***/ "./node_modules/@abaplint/core/build/src/rules/implicit_start_of_selection.js":
|
|
62279
|
+
/*!************************************************************************************!*\
|
|
62280
|
+
!*** ./node_modules/@abaplint/core/build/src/rules/implicit_start_of_selection.js ***!
|
|
62281
|
+
\************************************************************************************/
|
|
62282
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
62283
|
+
|
|
62284
|
+
"use strict";
|
|
62285
|
+
|
|
62286
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
62287
|
+
exports.ImplicitStartOfSelection = exports.ImplicitStartOfSelectionConf = void 0;
|
|
62288
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
|
|
62289
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
|
|
62290
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
|
|
62291
|
+
const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
|
|
62292
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
|
|
62293
|
+
const objects_1 = __webpack_require__(/*! ../objects */ "./node_modules/@abaplint/core/build/src/objects/index.js");
|
|
62294
|
+
const nodes_1 = __webpack_require__(/*! ../abap/nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
|
|
62295
|
+
const selection_events_1 = __webpack_require__(/*! ../abap/flow/selection_events */ "./node_modules/@abaplint/core/build/src/abap/flow/selection_events.js");
|
|
62296
|
+
class ImplicitStartOfSelectionConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
62297
|
+
}
|
|
62298
|
+
exports.ImplicitStartOfSelectionConf = ImplicitStartOfSelectionConf;
|
|
62299
|
+
class ImplicitStartOfSelection extends _abap_rule_1.ABAPRule {
|
|
62300
|
+
constructor() {
|
|
62301
|
+
super(...arguments);
|
|
62302
|
+
this.conf = new ImplicitStartOfSelectionConf();
|
|
62303
|
+
}
|
|
62304
|
+
getMetadata() {
|
|
62305
|
+
return {
|
|
62306
|
+
key: "implicit_start_of_selection",
|
|
62307
|
+
title: "Implicit START-OF-SELECTION",
|
|
62308
|
+
shortDescription: `Add explicit selection screen event handling`,
|
|
62309
|
+
extendedInformation: `Only runs for executable programs
|
|
62310
|
+
|
|
62311
|
+
https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapstart-of-selection.htm`,
|
|
62312
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
62313
|
+
badExample: `REPORT zfoo.
|
|
62314
|
+
WRITE 'hello'.`,
|
|
62315
|
+
goodExample: `
|
|
62316
|
+
START-OF-SELECTION.
|
|
62317
|
+
WRITE 'hello'.`,
|
|
62318
|
+
};
|
|
62319
|
+
}
|
|
62320
|
+
getConfig() {
|
|
62321
|
+
return this.conf;
|
|
62322
|
+
}
|
|
62323
|
+
setConfig(conf) {
|
|
62324
|
+
this.conf = conf;
|
|
62325
|
+
}
|
|
62326
|
+
runParsed(file, obj) {
|
|
62327
|
+
const issues = [];
|
|
62328
|
+
if (!(obj instanceof objects_1.Program) || obj.isInclude()) {
|
|
62329
|
+
return issues;
|
|
62330
|
+
}
|
|
62331
|
+
const stru = file.getStructure();
|
|
62332
|
+
if (stru === undefined) {
|
|
62333
|
+
return [];
|
|
62334
|
+
}
|
|
62335
|
+
let inEvent = false;
|
|
62336
|
+
let collected = [];
|
|
62337
|
+
for (const s of stru.getChildren() || []) {
|
|
62338
|
+
if (selection_events_1.SELECTION_EVENTS.some(f => s.get() instanceof f)) {
|
|
62339
|
+
if (inEvent === false && collected.length > 0) {
|
|
62340
|
+
// implicit START-OF-SELECTION
|
|
62341
|
+
let first = collected[0];
|
|
62342
|
+
if (first instanceof nodes_1.StructureNode) {
|
|
62343
|
+
first = first.getFirstStatement();
|
|
62344
|
+
}
|
|
62345
|
+
issues.push(issue_1.Issue.atStatement(file, first, "Implicit START-OF-SELECTION", this.getMetadata().key, this.getConfig().severity));
|
|
62346
|
+
}
|
|
62347
|
+
collected = [];
|
|
62348
|
+
inEvent = true;
|
|
62349
|
+
}
|
|
62350
|
+
else if (s.get() instanceof Structures.Normal) {
|
|
62351
|
+
const stru = s;
|
|
62352
|
+
// ignore declaration stuff
|
|
62353
|
+
if (selection_events_1.DECLARATION_STUFF.some(d => { var _a; return ((_a = stru.getFirstStatement()) === null || _a === void 0 ? void 0 : _a.get()) instanceof d; })) {
|
|
62354
|
+
continue;
|
|
62355
|
+
}
|
|
62356
|
+
collected.push(s);
|
|
62357
|
+
}
|
|
62358
|
+
else {
|
|
62359
|
+
if (inEvent === true) {
|
|
62360
|
+
inEvent = false;
|
|
62361
|
+
}
|
|
62362
|
+
collected = [];
|
|
62363
|
+
}
|
|
62364
|
+
}
|
|
62365
|
+
if (inEvent === false && collected.length > 0) {
|
|
62366
|
+
// implicit START-OF-SELECTION
|
|
62367
|
+
let first = collected[0];
|
|
62368
|
+
if (first instanceof nodes_1.StructureNode) {
|
|
62369
|
+
first = first.getFirstStatement();
|
|
62370
|
+
}
|
|
62371
|
+
issues.push(issue_1.Issue.atStatement(file, first, "Implicit START-OF-SELECTION", this.getMetadata().key, this.getConfig().severity));
|
|
62372
|
+
}
|
|
62373
|
+
return issues;
|
|
62374
|
+
}
|
|
62375
|
+
}
|
|
62376
|
+
exports.ImplicitStartOfSelection = ImplicitStartOfSelection;
|
|
62377
|
+
//# sourceMappingURL=implicit_start_of_selection.js.map
|
|
62378
|
+
|
|
62379
|
+
/***/ }),
|
|
62380
|
+
|
|
61994
62381
|
/***/ "./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js":
|
|
61995
62382
|
/*!*********************************************************************************!*\
|
|
61996
62383
|
!*** ./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js ***!
|
|
@@ -62294,6 +62681,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
62294
62681
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
62295
62682
|
__exportStar(__webpack_require__(/*! ./7bit_ascii */ "./node_modules/@abaplint/core/build/src/rules/7bit_ascii.js"), exports);
|
|
62296
62683
|
__exportStar(__webpack_require__(/*! ./abapdoc */ "./node_modules/@abaplint/core/build/src/rules/abapdoc.js"), exports);
|
|
62684
|
+
__exportStar(__webpack_require__(/*! ./add_test_attributes */ "./node_modules/@abaplint/core/build/src/rules/add_test_attributes.js"), exports);
|
|
62297
62685
|
__exportStar(__webpack_require__(/*! ./align_parameters */ "./node_modules/@abaplint/core/build/src/rules/align_parameters.js"), exports);
|
|
62298
62686
|
__exportStar(__webpack_require__(/*! ./align_pseudo_comments */ "./node_modules/@abaplint/core/build/src/rules/align_pseudo_comments.js"), exports);
|
|
62299
62687
|
__exportStar(__webpack_require__(/*! ./align_type_expressions */ "./node_modules/@abaplint/core/build/src/rules/align_type_expressions.js"), exports);
|
|
@@ -62335,6 +62723,7 @@ __exportStar(__webpack_require__(/*! ./double_space */ "./node_modules/@abaplint
|
|
|
62335
62723
|
__exportStar(__webpack_require__(/*! ./downport */ "./node_modules/@abaplint/core/build/src/rules/downport.js"), exports);
|
|
62336
62724
|
__exportStar(__webpack_require__(/*! ./dynpro_checks */ "./node_modules/@abaplint/core/build/src/rules/dynpro_checks.js"), exports);
|
|
62337
62725
|
__exportStar(__webpack_require__(/*! ./easy_to_find_messages */ "./node_modules/@abaplint/core/build/src/rules/easy_to_find_messages.js"), exports);
|
|
62726
|
+
__exportStar(__webpack_require__(/*! ./empty_event */ "./node_modules/@abaplint/core/build/src/rules/empty_event.js"), exports);
|
|
62338
62727
|
__exportStar(__webpack_require__(/*! ./empty_line_in_statement */ "./node_modules/@abaplint/core/build/src/rules/empty_line_in_statement.js"), exports);
|
|
62339
62728
|
__exportStar(__webpack_require__(/*! ./empty_statement */ "./node_modules/@abaplint/core/build/src/rules/empty_statement.js"), exports);
|
|
62340
62729
|
__exportStar(__webpack_require__(/*! ./empty_structure */ "./node_modules/@abaplint/core/build/src/rules/empty_structure.js"), exports);
|
|
@@ -62356,6 +62745,7 @@ __exportStar(__webpack_require__(/*! ./identical_descriptions */ "./node_modules
|
|
|
62356
62745
|
__exportStar(__webpack_require__(/*! ./identical_form_names */ "./node_modules/@abaplint/core/build/src/rules/identical_form_names.js"), exports);
|
|
62357
62746
|
__exportStar(__webpack_require__(/*! ./if_in_if */ "./node_modules/@abaplint/core/build/src/rules/if_in_if.js"), exports);
|
|
62358
62747
|
__exportStar(__webpack_require__(/*! ./implement_methods */ "./node_modules/@abaplint/core/build/src/rules/implement_methods.js"), exports);
|
|
62748
|
+
__exportStar(__webpack_require__(/*! ./implicit_start_of_selection */ "./node_modules/@abaplint/core/build/src/rules/implicit_start_of_selection.js"), exports);
|
|
62359
62749
|
__exportStar(__webpack_require__(/*! ./in_statement_indentation */ "./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js"), exports);
|
|
62360
62750
|
__exportStar(__webpack_require__(/*! ./indentation */ "./node_modules/@abaplint/core/build/src/rules/indentation.js"), exports);
|
|
62361
62751
|
__exportStar(__webpack_require__(/*! ./inline_data_old_versions */ "./node_modules/@abaplint/core/build/src/rules/inline_data_old_versions.js"), exports);
|
|
@@ -87932,6 +88322,35 @@ module.exports = {
|
|
|
87932
88322
|
|
|
87933
88323
|
/***/ }),
|
|
87934
88324
|
|
|
88325
|
+
/***/ "./node_modules/fast-xml-parser/src/ignoreAttributes.js":
|
|
88326
|
+
/*!**************************************************************!*\
|
|
88327
|
+
!*** ./node_modules/fast-xml-parser/src/ignoreAttributes.js ***!
|
|
88328
|
+
\**************************************************************/
|
|
88329
|
+
/***/ ((module) => {
|
|
88330
|
+
|
|
88331
|
+
function getIgnoreAttributesFn(ignoreAttributes) {
|
|
88332
|
+
if (typeof ignoreAttributes === 'function') {
|
|
88333
|
+
return ignoreAttributes
|
|
88334
|
+
}
|
|
88335
|
+
if (Array.isArray(ignoreAttributes)) {
|
|
88336
|
+
return (attrName) => {
|
|
88337
|
+
for (const pattern of ignoreAttributes) {
|
|
88338
|
+
if (typeof pattern === 'string' && attrName === pattern) {
|
|
88339
|
+
return true
|
|
88340
|
+
}
|
|
88341
|
+
if (pattern instanceof RegExp && pattern.test(attrName)) {
|
|
88342
|
+
return true
|
|
88343
|
+
}
|
|
88344
|
+
}
|
|
88345
|
+
}
|
|
88346
|
+
}
|
|
88347
|
+
return () => false
|
|
88348
|
+
}
|
|
88349
|
+
|
|
88350
|
+
module.exports = getIgnoreAttributesFn
|
|
88351
|
+
|
|
88352
|
+
/***/ }),
|
|
88353
|
+
|
|
87935
88354
|
/***/ "./node_modules/fast-xml-parser/src/util.js":
|
|
87936
88355
|
/*!**************************************************!*\
|
|
87937
88356
|
!*** ./node_modules/fast-xml-parser/src/util.js ***!
|
|
@@ -88461,6 +88880,7 @@ function getPositionFromMatch(match) {
|
|
|
88461
88880
|
|
|
88462
88881
|
//parse Empty Node as self closing node
|
|
88463
88882
|
const buildFromOrderedJs = __webpack_require__(/*! ./orderedJs2Xml */ "./node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js");
|
|
88883
|
+
const getIgnoreAttributesFn = __webpack_require__(/*! ../ignoreAttributes */ "./node_modules/fast-xml-parser/src/ignoreAttributes.js")
|
|
88464
88884
|
|
|
88465
88885
|
const defaultOptions = {
|
|
88466
88886
|
attributeNamePrefix: '@_',
|
|
@@ -88498,11 +88918,12 @@ const defaultOptions = {
|
|
|
88498
88918
|
|
|
88499
88919
|
function Builder(options) {
|
|
88500
88920
|
this.options = Object.assign({}, defaultOptions, options);
|
|
88501
|
-
if (this.options.ignoreAttributes || this.options.attributesGroupName) {
|
|
88921
|
+
if (this.options.ignoreAttributes === true || this.options.attributesGroupName) {
|
|
88502
88922
|
this.isAttribute = function(/*a*/) {
|
|
88503
88923
|
return false;
|
|
88504
88924
|
};
|
|
88505
88925
|
} else {
|
|
88926
|
+
this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes)
|
|
88506
88927
|
this.attrPrefixLen = this.options.attributeNamePrefix.length;
|
|
88507
88928
|
this.isAttribute = isAttribute;
|
|
88508
88929
|
}
|
|
@@ -88531,13 +88952,14 @@ Builder.prototype.build = function(jObj) {
|
|
|
88531
88952
|
[this.options.arrayNodeName] : jObj
|
|
88532
88953
|
}
|
|
88533
88954
|
}
|
|
88534
|
-
return this.j2x(jObj, 0).val;
|
|
88955
|
+
return this.j2x(jObj, 0, []).val;
|
|
88535
88956
|
}
|
|
88536
88957
|
};
|
|
88537
88958
|
|
|
88538
|
-
Builder.prototype.j2x = function(jObj, level) {
|
|
88959
|
+
Builder.prototype.j2x = function(jObj, level, ajPath) {
|
|
88539
88960
|
let attrStr = '';
|
|
88540
88961
|
let val = '';
|
|
88962
|
+
const jPath = ajPath.join('.')
|
|
88541
88963
|
for (let key in jObj) {
|
|
88542
88964
|
if(!Object.prototype.hasOwnProperty.call(jObj, key)) continue;
|
|
88543
88965
|
if (typeof jObj[key] === 'undefined') {
|
|
@@ -88560,9 +88982,9 @@ Builder.prototype.j2x = function(jObj, level) {
|
|
|
88560
88982
|
} else if (typeof jObj[key] !== 'object') {
|
|
88561
88983
|
//premitive type
|
|
88562
88984
|
const attr = this.isAttribute(key);
|
|
88563
|
-
if (attr) {
|
|
88985
|
+
if (attr && !this.ignoreAttributesFn(attr, jPath)) {
|
|
88564
88986
|
attrStr += this.buildAttrPairStr(attr, '' + jObj[key]);
|
|
88565
|
-
}else {
|
|
88987
|
+
} else if (!attr) {
|
|
88566
88988
|
//tag value
|
|
88567
88989
|
if (key === this.options.textNodeName) {
|
|
88568
88990
|
let newval = this.options.tagValueProcessor(key, '' + jObj[key]);
|
|
@@ -88586,13 +89008,13 @@ Builder.prototype.j2x = function(jObj, level) {
|
|
|
88586
89008
|
// val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
|
|
88587
89009
|
} else if (typeof item === 'object') {
|
|
88588
89010
|
if(this.options.oneListGroup){
|
|
88589
|
-
const result = this.j2x(item, level + 1);
|
|
89011
|
+
const result = this.j2x(item, level + 1, ajPath.concat(key));
|
|
88590
89012
|
listTagVal += result.val;
|
|
88591
89013
|
if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) {
|
|
88592
89014
|
listTagAttr += result.attrStr
|
|
88593
89015
|
}
|
|
88594
89016
|
}else{
|
|
88595
|
-
listTagVal += this.processTextOrObjNode(item, key, level)
|
|
89017
|
+
listTagVal += this.processTextOrObjNode(item, key, level, ajPath)
|
|
88596
89018
|
}
|
|
88597
89019
|
} else {
|
|
88598
89020
|
if (this.options.oneListGroup) {
|
|
@@ -88617,7 +89039,7 @@ Builder.prototype.j2x = function(jObj, level) {
|
|
|
88617
89039
|
attrStr += this.buildAttrPairStr(Ks[j], '' + jObj[key][Ks[j]]);
|
|
88618
89040
|
}
|
|
88619
89041
|
} else {
|
|
88620
|
-
val += this.processTextOrObjNode(jObj[key], key, level)
|
|
89042
|
+
val += this.processTextOrObjNode(jObj[key], key, level, ajPath)
|
|
88621
89043
|
}
|
|
88622
89044
|
}
|
|
88623
89045
|
}
|
|
@@ -88632,8 +89054,8 @@ Builder.prototype.buildAttrPairStr = function(attrName, val){
|
|
|
88632
89054
|
} else return ' ' + attrName + '="' + val + '"';
|
|
88633
89055
|
}
|
|
88634
89056
|
|
|
88635
|
-
function processTextOrObjNode (object, key, level) {
|
|
88636
|
-
const result = this.j2x(object, level + 1);
|
|
89057
|
+
function processTextOrObjNode (object, key, level, ajPath) {
|
|
89058
|
+
const result = this.j2x(object, level + 1, ajPath.concat(key));
|
|
88637
89059
|
if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {
|
|
88638
89060
|
return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level);
|
|
88639
89061
|
} else {
|
|
@@ -89121,6 +89543,7 @@ const util = __webpack_require__(/*! ../util */ "./node_modules/fast-xml-parser/
|
|
|
89121
89543
|
const xmlNode = __webpack_require__(/*! ./xmlNode */ "./node_modules/fast-xml-parser/src/xmlparser/xmlNode.js");
|
|
89122
89544
|
const readDocType = __webpack_require__(/*! ./DocTypeReader */ "./node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js");
|
|
89123
89545
|
const toNumber = __webpack_require__(/*! strnum */ "./node_modules/strnum/strnum.js");
|
|
89546
|
+
const getIgnoreAttributesFn = __webpack_require__(/*! ../ignoreAttributes */ "./node_modules/fast-xml-parser/src/ignoreAttributes.js")
|
|
89124
89547
|
|
|
89125
89548
|
// const regx =
|
|
89126
89549
|
// '<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)'
|
|
@@ -89169,6 +89592,7 @@ class OrderedObjParser{
|
|
|
89169
89592
|
this.readStopNodeData = readStopNodeData;
|
|
89170
89593
|
this.saveTextToParentTag = saveTextToParentTag;
|
|
89171
89594
|
this.addChild = addChild;
|
|
89595
|
+
this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes)
|
|
89172
89596
|
}
|
|
89173
89597
|
|
|
89174
89598
|
}
|
|
@@ -89241,7 +89665,7 @@ function resolveNameSpace(tagname) {
|
|
|
89241
89665
|
const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm');
|
|
89242
89666
|
|
|
89243
89667
|
function buildAttributesMap(attrStr, jPath, tagName) {
|
|
89244
|
-
if (
|
|
89668
|
+
if (this.options.ignoreAttributes !== true && typeof attrStr === 'string') {
|
|
89245
89669
|
// attrStr = attrStr.replace(/\r?\n/g, ' ');
|
|
89246
89670
|
//attrStr = attrStr || attrStr.trim();
|
|
89247
89671
|
|
|
@@ -89250,6 +89674,9 @@ function buildAttributesMap(attrStr, jPath, tagName) {
|
|
|
89250
89674
|
const attrs = {};
|
|
89251
89675
|
for (let i = 0; i < len; i++) {
|
|
89252
89676
|
const attrName = this.resolveNameSpace(matches[i][1]);
|
|
89677
|
+
if (this.ignoreAttributesFn(attrName, jPath)) {
|
|
89678
|
+
continue
|
|
89679
|
+
}
|
|
89253
89680
|
let oldVal = matches[i][4];
|
|
89254
89681
|
let aName = this.options.attributeNamePrefix + attrName;
|
|
89255
89682
|
if (attrName.length) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.11",
|
|
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.10.
|
|
29
|
+
"@abaplint/transpiler": "^2.10.11",
|
|
30
30
|
"@types/glob": "^8.1.0",
|
|
31
31
|
"glob": "=7.2.0",
|
|
32
32
|
"@types/progress": "^2.0.7",
|
|
33
|
-
"@types/node": "^22.5.
|
|
34
|
-
"@abaplint/core": "^2.
|
|
33
|
+
"@types/node": "^22.5.4",
|
|
34
|
+
"@abaplint/core": "^2.113.6",
|
|
35
35
|
"progress": "^2.0.3",
|
|
36
36
|
"webpack": "^5.94.0",
|
|
37
37
|
"webpack-cli": "^5.1.4",
|