@abaplint/cli 2.120.49 → 2.120.51
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/cli.js +266 -14
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -27714,6 +27714,20 @@ class TypeUtils {
|
|
|
27714
27714
|
|| node.findFirstExpression(Expressions.ArithOperator) !== undefined;
|
|
27715
27715
|
return calculated;
|
|
27716
27716
|
}
|
|
27717
|
+
// a character constant is only assignable to a hexadecimal target if it can be
|
|
27718
|
+
// interpreted as a hexadecimal value
|
|
27719
|
+
isHexConstant(node) {
|
|
27720
|
+
const constant = node === null || node === void 0 ? void 0 : node.concatTokens();
|
|
27721
|
+
if (constant === undefined) {
|
|
27722
|
+
return true;
|
|
27723
|
+
}
|
|
27724
|
+
if ((constant.startsWith("'") && constant.endsWith("'"))
|
|
27725
|
+
|| (constant.startsWith("`") && constant.endsWith("`"))) {
|
|
27726
|
+
const value = constant.substring(1, constant.length - 1);
|
|
27727
|
+
return value.length > 0 && /^[0-9A-Fa-f]+$/.test(value);
|
|
27728
|
+
}
|
|
27729
|
+
return true;
|
|
27730
|
+
}
|
|
27717
27731
|
isAssignableNew(source, target, node) {
|
|
27718
27732
|
const calculated = (node === null || node === void 0 ? void 0 : node.findFirstExpression(Expressions.ArithOperator)) !== undefined;
|
|
27719
27733
|
if (calculated && source instanceof basic_1.HexType && target instanceof basic_1.IntegerType) {
|
|
@@ -27779,7 +27793,7 @@ class TypeUtils {
|
|
|
27779
27793
|
}
|
|
27780
27794
|
else if (target instanceof basic_1.XStringType) {
|
|
27781
27795
|
if (((_d = source.getAbstractTypeData()) === null || _d === void 0 ? void 0 : _d.derivedFromConstant) === true) {
|
|
27782
|
-
return (node
|
|
27796
|
+
return this.isHexConstant(node);
|
|
27783
27797
|
}
|
|
27784
27798
|
return false;
|
|
27785
27799
|
}
|
|
@@ -63509,16 +63523,21 @@ const _abstract_object_1 = __webpack_require__(/*! ./_abstract_object */ "../cor
|
|
|
63509
63523
|
const Types = __importStar(__webpack_require__(/*! ../abap/types/basic */ "../core/build/src/abap/types/basic/index.js"));
|
|
63510
63524
|
const ddic_1 = __webpack_require__(/*! ../ddic */ "../core/build/src/ddic.js");
|
|
63511
63525
|
const xml_utils_1 = __webpack_require__(/*! ../xml_utils */ "../core/build/src/xml_utils.js");
|
|
63526
|
+
const _identifier_1 = __webpack_require__(/*! ../abap/4_file_information/_identifier */ "../core/build/src/abap/4_file_information/_identifier.js");
|
|
63527
|
+
const identifier_1 = __webpack_require__(/*! ../abap/1_lexer/tokens/identifier */ "../core/build/src/abap/1_lexer/tokens/identifier.js");
|
|
63528
|
+
const position_1 = __webpack_require__(/*! ../position */ "../core/build/src/position.js");
|
|
63512
63529
|
class Domain extends _abstract_object_1.AbstractObject {
|
|
63513
63530
|
getType() {
|
|
63514
63531
|
return "DOMA";
|
|
63515
63532
|
}
|
|
63516
63533
|
getDescription() {
|
|
63517
63534
|
var _a;
|
|
63535
|
+
this.parse();
|
|
63518
63536
|
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.description;
|
|
63519
63537
|
}
|
|
63520
63538
|
getConversionExit() {
|
|
63521
63539
|
var _a;
|
|
63540
|
+
this.parse();
|
|
63522
63541
|
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.conversionExit;
|
|
63523
63542
|
}
|
|
63524
63543
|
getDataType() {
|
|
@@ -63532,6 +63551,17 @@ class Domain extends _abstract_object_1.AbstractObject {
|
|
|
63532
63551
|
allowNamespace: true,
|
|
63533
63552
|
};
|
|
63534
63553
|
}
|
|
63554
|
+
getIdentifier() {
|
|
63555
|
+
const xmlIdentifier = super.getIdentifier();
|
|
63556
|
+
if (xmlIdentifier) {
|
|
63557
|
+
return xmlIdentifier;
|
|
63558
|
+
}
|
|
63559
|
+
const file = this.getAFFFile();
|
|
63560
|
+
if (file === undefined) {
|
|
63561
|
+
return undefined;
|
|
63562
|
+
}
|
|
63563
|
+
return new _identifier_1.Identifier(new identifier_1.Identifier(new position_1.Position(1, 1), this.getName()), file.getFilename());
|
|
63564
|
+
}
|
|
63535
63565
|
setDirty() {
|
|
63536
63566
|
this.parsedXML = undefined;
|
|
63537
63567
|
super.setDirty();
|
|
@@ -63558,18 +63588,57 @@ class Domain extends _abstract_object_1.AbstractObject {
|
|
|
63558
63588
|
});
|
|
63559
63589
|
}
|
|
63560
63590
|
parse() {
|
|
63561
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
63591
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
63592
|
+
var _v, _w;
|
|
63562
63593
|
if (this.parsedXML) {
|
|
63563
63594
|
return { updated: false, runtime: 0 };
|
|
63564
63595
|
}
|
|
63565
63596
|
const start = Date.now();
|
|
63566
63597
|
this.parsedXML = {};
|
|
63598
|
+
const jsonFile = this.getAFFFile();
|
|
63599
|
+
if (jsonFile) {
|
|
63600
|
+
try {
|
|
63601
|
+
const parsed = JSON.parse(jsonFile.getRaw());
|
|
63602
|
+
const language = (_a = parsed.header) === null || _a === void 0 ? void 0 : _a.originalLanguage;
|
|
63603
|
+
const values = [];
|
|
63604
|
+
for (const fixedValue of (_v = parsed.fixedValues) !== null && _v !== void 0 ? _v : []) {
|
|
63605
|
+
values.push({
|
|
63606
|
+
low: fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.fixedValue,
|
|
63607
|
+
high: "",
|
|
63608
|
+
description: fixedValue === null || fixedValue === void 0 ? void 0 : fixedValue.description,
|
|
63609
|
+
language: language,
|
|
63610
|
+
});
|
|
63611
|
+
}
|
|
63612
|
+
for (const interval of (_w = parsed.fixedValueIntervals) !== null && _w !== void 0 ? _w : []) {
|
|
63613
|
+
values.push({
|
|
63614
|
+
low: interval === null || interval === void 0 ? void 0 : interval.lowLimit,
|
|
63615
|
+
high: interval === null || interval === void 0 ? void 0 : interval.highLimit,
|
|
63616
|
+
description: interval === null || interval === void 0 ? void 0 : interval.description,
|
|
63617
|
+
language: language,
|
|
63618
|
+
});
|
|
63619
|
+
}
|
|
63620
|
+
this.parsedXML = {
|
|
63621
|
+
description: (_b = parsed.header) === null || _b === void 0 ? void 0 : _b.description,
|
|
63622
|
+
datatype: (_c = parsed.format) === null || _c === void 0 ? void 0 : _c.dataType,
|
|
63623
|
+
length: (_e = (_d = parsed.format) === null || _d === void 0 ? void 0 : _d.length) === null || _e === void 0 ? void 0 : _e.toString(),
|
|
63624
|
+
decimals: (_g = (_f = parsed.format) === null || _f === void 0 ? void 0 : _f.decimals) === null || _g === void 0 ? void 0 : _g.toString(),
|
|
63625
|
+
conversionExit: (_h = parsed.outputCharacteristics) === null || _h === void 0 ? void 0 : _h.conversionRoutine,
|
|
63626
|
+
values: values,
|
|
63627
|
+
valuesTranslations: [],
|
|
63628
|
+
};
|
|
63629
|
+
}
|
|
63630
|
+
catch (_x) {
|
|
63631
|
+
// handled by parseType()
|
|
63632
|
+
}
|
|
63633
|
+
const end = Date.now();
|
|
63634
|
+
return { updated: true, runtime: end - start };
|
|
63635
|
+
}
|
|
63567
63636
|
const parsed = super.parseRaw2();
|
|
63568
63637
|
if (parsed === undefined) {
|
|
63569
63638
|
return { updated: false, runtime: 0 };
|
|
63570
63639
|
}
|
|
63571
|
-
const dd01v = (
|
|
63572
|
-
const dd07v_tab = (0, xml_utils_1.xmlToArray)((
|
|
63640
|
+
const dd01v = (_l = (_k = (_j = parsed.abapGit) === null || _j === void 0 ? void 0 : _j["asx:abap"]) === null || _k === void 0 ? void 0 : _k["asx:values"]) === null || _l === void 0 ? void 0 : _l.DD01V;
|
|
63641
|
+
const dd07v_tab = (0, xml_utils_1.xmlToArray)((_q = (_p = (_o = (_m = parsed.abapGit) === null || _m === void 0 ? void 0 : _m["asx:abap"]) === null || _o === void 0 ? void 0 : _o["asx:values"]) === null || _p === void 0 ? void 0 : _p.DD07V_TAB) === null || _q === void 0 ? void 0 : _q.DD07V);
|
|
63573
63642
|
const values = [];
|
|
63574
63643
|
for (const ddo7v of dd07v_tab) {
|
|
63575
63644
|
const value = {
|
|
@@ -63580,7 +63649,7 @@ class Domain extends _abstract_object_1.AbstractObject {
|
|
|
63580
63649
|
};
|
|
63581
63650
|
values.push(value);
|
|
63582
63651
|
}
|
|
63583
|
-
const dd07v_texts = (0, xml_utils_1.xmlToArray)((
|
|
63652
|
+
const dd07v_texts = (0, xml_utils_1.xmlToArray)((_u = (_t = (_s = (_r = parsed.abapGit) === null || _r === void 0 ? void 0 : _r["asx:abap"]) === null || _s === void 0 ? void 0 : _s["asx:values"]) === null || _t === void 0 ? void 0 : _t.DD07_TEXTS) === null || _u === void 0 ? void 0 : _u.item);
|
|
63584
63653
|
const translationValues = [];
|
|
63585
63654
|
for (const dd07v of dd07v_texts) {
|
|
63586
63655
|
const value = {
|
|
@@ -63611,6 +63680,9 @@ class Domain extends _abstract_object_1.AbstractObject {
|
|
|
63611
63680
|
var _b;
|
|
63612
63681
|
return (_b = (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.valuesTranslations) !== null && _b !== void 0 ? _b : [];
|
|
63613
63682
|
}
|
|
63683
|
+
getAFFFile() {
|
|
63684
|
+
return this.getFiles().find(file => file.getFilename().toLowerCase().endsWith(".doma.json"));
|
|
63685
|
+
}
|
|
63614
63686
|
}
|
|
63615
63687
|
exports.Domain = Domain;
|
|
63616
63688
|
//# sourceMappingURL=domain.js.map
|
|
@@ -70491,7 +70563,7 @@ class Registry {
|
|
|
70491
70563
|
}
|
|
70492
70564
|
static abaplintVersion() {
|
|
70493
70565
|
// magic, see build script "version.js"
|
|
70494
|
-
return "2.120.
|
|
70566
|
+
return "2.120.51";
|
|
70495
70567
|
}
|
|
70496
70568
|
getDDICReferences() {
|
|
70497
70569
|
return this.ddicReferences;
|
|
@@ -78628,15 +78700,19 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
|
|
|
78628
78700
|
continue;
|
|
78629
78701
|
}
|
|
78630
78702
|
const condition = this.tableCondition(tableExpression);
|
|
78631
|
-
|
|
78703
|
+
// ASSIGNING, not INTO: from v740 a table expression in a read position addresses the
|
|
78704
|
+
// row rather than copying it, so "REF #( tab[ i ]-comp )" and "ASSIGN tab[ i ]-comp"
|
|
78705
|
+
// hand back an address INTO a work area would not preserve. The write path
|
|
78706
|
+
// (moveWithTableTarget) already lowers to ASSIGNING for the same reason.
|
|
78707
|
+
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax, true);
|
|
78632
78708
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
78633
78709
|
const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
|
|
78634
78710
|
const firstToken = high.getFirstToken();
|
|
78635
78711
|
// note that the tabix restore should be done before throwing the exception
|
|
78636
|
-
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `
|
|
78712
|
+
const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${pre}.
|
|
78637
78713
|
${indentation}DATA ${tabixBackup} LIKE sy-tabix.
|
|
78638
78714
|
${indentation}${tabixBackup} = sy-tabix.
|
|
78639
|
-
${indentation}READ TABLE ${pre} ${condition}
|
|
78715
|
+
${indentation}READ TABLE ${pre} ${condition}ASSIGNING ${uniqueName}.
|
|
78640
78716
|
${indentation}sy-tabix = ${tabixBackup}.
|
|
78641
78717
|
${indentation}IF sy-subrc <> 0.
|
|
78642
78718
|
${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.
|
|
@@ -79390,8 +79466,7 @@ CONSTANTS: BEGIN OF ${structureName},\n`;
|
|
|
79390
79466
|
if (index === undefined) {
|
|
79391
79467
|
return undefined;
|
|
79392
79468
|
}
|
|
79393
|
-
|
|
79394
|
-
uniqueName = `<${uniqueName}>`;
|
|
79469
|
+
const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax, true);
|
|
79395
79470
|
const tName = target.concatTokens().split("[")[0];
|
|
79396
79471
|
const condition = this.tableCondition(tableExpression);
|
|
79397
79472
|
const tabixBackup = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
|
|
@@ -80403,12 +80478,16 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
80403
80478
|
}
|
|
80404
80479
|
return undefined;
|
|
80405
80480
|
}
|
|
80406
|
-
|
|
80481
|
+
/** a FIELD-SYMBOLS declaration is known to the scope under its bracketed spelling, so
|
|
80482
|
+
* the collision check has to use that spelling too - otherwise a second outline in the
|
|
80483
|
+
* same method is handed a name that is already taken and the result does not compile */
|
|
80484
|
+
uniqueName(position, filename, highSyntax, fieldSymbol = false) {
|
|
80485
|
+
const decorate = (name) => fieldSymbol === true ? `<${name}>` : name;
|
|
80407
80486
|
const spag = highSyntax.spaghetti.lookupPosition(position, filename);
|
|
80408
80487
|
if (spag === undefined) {
|
|
80409
80488
|
const name = "temprr" + this.counter;
|
|
80410
80489
|
this.counter++;
|
|
80411
|
-
return name;
|
|
80490
|
+
return decorate(name);
|
|
80412
80491
|
}
|
|
80413
80492
|
let postfix = "";
|
|
80414
80493
|
if (spag.getIdentifier().stype === _scope_type_1.ScopeType.ClassDefinition) {
|
|
@@ -80417,7 +80496,7 @@ ${indentation} output = ${uniqueName}.\n`;
|
|
|
80417
80496
|
postfix = "_" + hash.substring(0, 10);
|
|
80418
80497
|
}
|
|
80419
80498
|
while (true) {
|
|
80420
|
-
const name = "temp" + this.counter + postfix;
|
|
80499
|
+
const name = decorate("temp" + this.counter + postfix);
|
|
80421
80500
|
const exists = this.existsRecursive(spag, name);
|
|
80422
80501
|
this.counter++;
|
|
80423
80502
|
if (exists === false) {
|
|
@@ -84899,6 +84978,7 @@ __exportStar(__webpack_require__(/*! ./use_line_exists */ "../core/build/src/rul
|
|
|
84899
84978
|
__exportStar(__webpack_require__(/*! ./use_new */ "../core/build/src/rules/use_new.js"), exports);
|
|
84900
84979
|
__exportStar(__webpack_require__(/*! ./when_others_last */ "../core/build/src/rules/when_others_last.js"), exports);
|
|
84901
84980
|
__exportStar(__webpack_require__(/*! ./whitespace_end */ "../core/build/src/rules/whitespace_end.js"), exports);
|
|
84981
|
+
__exportStar(__webpack_require__(/*! ./wrong_abapdoc_position */ "../core/build/src/rules/wrong_abapdoc_position.js"), exports);
|
|
84902
84982
|
__exportStar(__webpack_require__(/*! ./xml_consistency */ "../core/build/src/rules/xml_consistency.js"), exports);
|
|
84903
84983
|
__exportStar(__webpack_require__(/*! ./no_exclamation_escape */ "../core/build/src/rules/no_exclamation_escape.js"), exports);
|
|
84904
84984
|
__exportStar(__webpack_require__(/*! ./xml_bom */ "../core/build/src/rules/xml_bom.js"), exports);
|
|
@@ -100381,6 +100461,178 @@ exports.WhitespaceEnd = WhitespaceEnd;
|
|
|
100381
100461
|
|
|
100382
100462
|
/***/ },
|
|
100383
100463
|
|
|
100464
|
+
/***/ "../core/build/src/rules/wrong_abapdoc_position.js"
|
|
100465
|
+
/*!*********************************************************!*\
|
|
100466
|
+
!*** ../core/build/src/rules/wrong_abapdoc_position.js ***!
|
|
100467
|
+
\*********************************************************/
|
|
100468
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
100469
|
+
|
|
100470
|
+
"use strict";
|
|
100471
|
+
|
|
100472
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
100473
|
+
if (k2 === undefined) k2 = k;
|
|
100474
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
100475
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
100476
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
100477
|
+
}
|
|
100478
|
+
Object.defineProperty(o, k2, desc);
|
|
100479
|
+
}) : (function(o, m, k, k2) {
|
|
100480
|
+
if (k2 === undefined) k2 = k;
|
|
100481
|
+
o[k2] = m[k];
|
|
100482
|
+
}));
|
|
100483
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
100484
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
100485
|
+
}) : function(o, v) {
|
|
100486
|
+
o["default"] = v;
|
|
100487
|
+
});
|
|
100488
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
100489
|
+
var ownKeys = function(o) {
|
|
100490
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
100491
|
+
var ar = [];
|
|
100492
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
100493
|
+
return ar;
|
|
100494
|
+
};
|
|
100495
|
+
return ownKeys(o);
|
|
100496
|
+
};
|
|
100497
|
+
return function (mod) {
|
|
100498
|
+
if (mod && mod.__esModule) return mod;
|
|
100499
|
+
var result = {};
|
|
100500
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
100501
|
+
__setModuleDefault(result, mod);
|
|
100502
|
+
return result;
|
|
100503
|
+
};
|
|
100504
|
+
})();
|
|
100505
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
100506
|
+
exports.WrongAbapdocPosition = exports.WrongAbapdocPositionConf = void 0;
|
|
100507
|
+
const Statements = __importStar(__webpack_require__(/*! ../abap/2_statements/statements */ "../core/build/src/abap/2_statements/statements/index.js"));
|
|
100508
|
+
const issue_1 = __webpack_require__(/*! ../issue */ "../core/build/src/issue.js");
|
|
100509
|
+
const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "../core/build/src/rules/_abap_rule.js");
|
|
100510
|
+
const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "../core/build/src/rules/_basic_rule_config.js");
|
|
100511
|
+
const _irule_1 = __webpack_require__(/*! ./_irule */ "../core/build/src/rules/_irule.js");
|
|
100512
|
+
const _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ "../core/build/src/abap/2_statements/statements/_statement.js");
|
|
100513
|
+
class WrongAbapdocPositionConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
100514
|
+
}
|
|
100515
|
+
exports.WrongAbapdocPositionConf = WrongAbapdocPositionConf;
|
|
100516
|
+
class WrongAbapdocPosition extends _abap_rule_1.ABAPRule {
|
|
100517
|
+
constructor() {
|
|
100518
|
+
super(...arguments);
|
|
100519
|
+
this.conf = new WrongAbapdocPositionConf();
|
|
100520
|
+
}
|
|
100521
|
+
getMetadata() {
|
|
100522
|
+
return {
|
|
100523
|
+
key: "wrong_abapdoc_position",
|
|
100524
|
+
title: "Wrong ABAP Doc position",
|
|
100525
|
+
shortDescription: `ABAP Doc must be placed directly in front of the declaration it documents.`,
|
|
100526
|
+
extendedInformation: `ABAP Doc documents the single declaration following it, an ABAP Doc block placed
|
|
100527
|
+
elsewhere is silently ignored, leaving the declaration undocumented.
|
|
100528
|
+
|
|
100529
|
+
The following positions are reported,
|
|
100530
|
+
* in front of a chained keyword, ie. before "CONSTANTS:" instead of after the colon,
|
|
100531
|
+
* in the middle of a statement, ie. between the parameters of a METHODS definition,
|
|
100532
|
+
* directly in front of ENDCLASS, ENDINTERFACE or a SECTION statement.
|
|
100533
|
+
|
|
100534
|
+
Only checks ABAP Doc inside class definitions and interfaces.`,
|
|
100535
|
+
tags: [_irule_1.RuleTag.SingleFile],
|
|
100536
|
+
badExample: `CLASS zcl_foo DEFINITION PUBLIC.
|
|
100537
|
+
PUBLIC SECTION.
|
|
100538
|
+
"! Navigation modes
|
|
100539
|
+
CONSTANTS:
|
|
100540
|
+
BEGIN OF cs_nav_mode,
|
|
100541
|
+
back TYPE i VALUE 1,
|
|
100542
|
+
END OF cs_nav_mode.
|
|
100543
|
+
ENDCLASS.`,
|
|
100544
|
+
goodExample: `CLASS zcl_foo DEFINITION PUBLIC.
|
|
100545
|
+
PUBLIC SECTION.
|
|
100546
|
+
CONSTANTS:
|
|
100547
|
+
"! Navigation modes
|
|
100548
|
+
BEGIN OF cs_nav_mode,
|
|
100549
|
+
back TYPE i VALUE 1,
|
|
100550
|
+
END OF cs_nav_mode.
|
|
100551
|
+
ENDCLASS.`,
|
|
100552
|
+
};
|
|
100553
|
+
}
|
|
100554
|
+
getConfig() {
|
|
100555
|
+
return this.conf;
|
|
100556
|
+
}
|
|
100557
|
+
setConfig(conf) {
|
|
100558
|
+
this.conf = conf;
|
|
100559
|
+
}
|
|
100560
|
+
runParsed(file) {
|
|
100561
|
+
const issues = [];
|
|
100562
|
+
const statements = file.getStatements();
|
|
100563
|
+
let definition = false;
|
|
100564
|
+
for (let i = 0; i < statements.length; i++) {
|
|
100565
|
+
const statement = statements[i];
|
|
100566
|
+
const type = statement.get();
|
|
100567
|
+
if (type instanceof Statements.ClassDefinition || type instanceof Statements.Interface) {
|
|
100568
|
+
definition = true;
|
|
100569
|
+
continue;
|
|
100570
|
+
}
|
|
100571
|
+
else if (type instanceof Statements.EndClass || type instanceof Statements.EndInterface) {
|
|
100572
|
+
definition = false;
|
|
100573
|
+
continue;
|
|
100574
|
+
}
|
|
100575
|
+
else if (definition === false || this.isAbapdoc(statement) === false) {
|
|
100576
|
+
continue;
|
|
100577
|
+
}
|
|
100578
|
+
else if (this.isAbapdoc(statements[i - 1]) === true
|
|
100579
|
+
&& statements[i - 1].getStart().getRow() + 1 === statement.getStart().getRow()) {
|
|
100580
|
+
continue; // only report the first row of each block
|
|
100581
|
+
}
|
|
100582
|
+
let next = undefined;
|
|
100583
|
+
for (let j = i + 1; j < statements.length; j++) {
|
|
100584
|
+
if (statements[j].get() instanceof _statement_1.Comment) {
|
|
100585
|
+
continue;
|
|
100586
|
+
}
|
|
100587
|
+
next = statements[j];
|
|
100588
|
+
break;
|
|
100589
|
+
}
|
|
100590
|
+
if (next === undefined) {
|
|
100591
|
+
continue;
|
|
100592
|
+
}
|
|
100593
|
+
const message = this.check(statement, next);
|
|
100594
|
+
if (message !== undefined) {
|
|
100595
|
+
issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));
|
|
100596
|
+
}
|
|
100597
|
+
}
|
|
100598
|
+
return issues;
|
|
100599
|
+
}
|
|
100600
|
+
isAbapdoc(statement) {
|
|
100601
|
+
return (statement === null || statement === void 0 ? void 0 : statement.get()) instanceof _statement_1.Comment
|
|
100602
|
+
&& statement.getFirstToken().getStr().startsWith(`"!`);
|
|
100603
|
+
}
|
|
100604
|
+
check(abapdoc, next) {
|
|
100605
|
+
const type = next.get();
|
|
100606
|
+
if (type instanceof Statements.EndClass
|
|
100607
|
+
|| type instanceof Statements.EndInterface
|
|
100608
|
+
|| type instanceof Statements.Public
|
|
100609
|
+
|| type instanceof Statements.Protected
|
|
100610
|
+
|| type instanceof Statements.Private) {
|
|
100611
|
+
return "ABAP Doc does not document anything, move or delete it";
|
|
100612
|
+
}
|
|
100613
|
+
const position = abapdoc.getStart();
|
|
100614
|
+
const colon = next.getColon();
|
|
100615
|
+
if (colon === undefined) {
|
|
100616
|
+
if (position.isAfter(next.getStart()) === true) {
|
|
100617
|
+
return "ABAP Doc inside statement, move it in front of the statement";
|
|
100618
|
+
}
|
|
100619
|
+
return undefined;
|
|
100620
|
+
}
|
|
100621
|
+
if (position.isBefore(colon.getStart()) === true) {
|
|
100622
|
+
return "ABAP Doc in front of chained statement, move it after the colon";
|
|
100623
|
+
}
|
|
100624
|
+
const member = next.getTokens().find(t => t.getStart().isAfter(colon.getStart()));
|
|
100625
|
+
if (member !== undefined && position.isAfter(member.getStart()) === true) {
|
|
100626
|
+
return "ABAP Doc inside statement, move it in front of the chained declaration";
|
|
100627
|
+
}
|
|
100628
|
+
return undefined;
|
|
100629
|
+
}
|
|
100630
|
+
}
|
|
100631
|
+
exports.WrongAbapdocPosition = WrongAbapdocPosition;
|
|
100632
|
+
//# sourceMappingURL=wrong_abapdoc_position.js.map
|
|
100633
|
+
|
|
100634
|
+
/***/ },
|
|
100635
|
+
|
|
100384
100636
|
/***/ "../core/build/src/rules/xml_bom.js"
|
|
100385
100637
|
/*!******************************************!*\
|
|
100386
100638
|
!*** ../core/build/src/rules/xml_bom.js ***!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.120.
|
|
3
|
+
"version": "2.120.51",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://abaplint.org",
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@abaplint/core": "^2.120.
|
|
42
|
+
"@abaplint/core": "^2.120.51",
|
|
43
43
|
"@types/chai": "^4.3.20",
|
|
44
44
|
"@types/minimist": "^1.2.5",
|
|
45
45
|
"@types/mocha": "^10.0.10",
|