@abaplint/core 2.106.1 → 2.106.3
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.
|
@@ -11,10 +11,10 @@ class TypeTable extends combi_1.Expression {
|
|
|
11
11
|
const header = "WITH HEADER LINE";
|
|
12
12
|
const initial = (0, combi_1.seq)("INITIAL SIZE", _1.Constant);
|
|
13
13
|
const generic = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE");
|
|
14
|
-
const normal1 = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.
|
|
14
|
+
const normal1 = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.optPrio)("REF TO"), _1.TypeName);
|
|
15
15
|
const likeType = (0, combi_1.seq)((0, combi_1.opt)((0, combi_1.alt)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY")), "TABLE OF", (0, combi_1.optPrio)("REF TO"), (0, combi_1.opt)(field_chain_1.FieldChain), (0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))));
|
|
16
|
-
const rangeType = (0, combi_1.seq)("RANGE OF", _1.TypeName, (0, combi_1.
|
|
17
|
-
const rangeLike = (0, combi_1.seq)("RANGE OF", _1.SimpleFieldChain, (0, combi_1.
|
|
16
|
+
const rangeType = (0, combi_1.seq)("RANGE OF", _1.TypeName, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial));
|
|
17
|
+
const rangeLike = (0, combi_1.seq)("RANGE OF", _1.SimpleFieldChain, (0, combi_1.optPrio)(header), (0, combi_1.optPrio)(initial));
|
|
18
18
|
// a maximum of 15 secondary table keys can be defined
|
|
19
19
|
// "WITH" is not allowed as a field name in keys
|
|
20
20
|
const typetable = (0, combi_1.alt)(generic, (0, combi_1.seq)(normal1, (0, combi_1.alt)((0, combi_1.opt)((0, combi_1.per)(header, initial, (0, combi_1.plusPrio)(type_table_key_1.TypeTableKey))), (0, combi_1.seq)((0, combi_1.plus)(type_table_key_1.TypeTableKey), (0, combi_1.optPrio)(initial)))));
|
|
@@ -36,13 +36,11 @@ class Concatenate {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
throw new Error("Source type not compatible");
|
|
45
|
-
}
|
|
39
|
+
for (const s of node.findDirectExpressions(Expressions.SimpleSource3)) {
|
|
40
|
+
const type = new source_1.Source().runSyntax(s, scope, filename);
|
|
41
|
+
const compatible = byteMode ? new _type_utils_1.TypeUtils(scope).isHexLike(type) : new _type_utils_1.TypeUtils(scope).isCharLikeStrict(type);
|
|
42
|
+
if (compatible === false) {
|
|
43
|
+
throw new Error("Source type not compatible");
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -11,17 +11,17 @@ class NoPrefixesConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
13
|
/** DATA, CLASS-DATA, DATA BEGIN OF, CLASS-DATA BEGIN OF, FINAL(), DATA(), case insensitive regex */
|
|
14
|
-
this.data = "^[
|
|
14
|
+
this.data = "^[LGM].?_";
|
|
15
15
|
/** STATICS, STATICS BEGIN OF, case insensitive regex */
|
|
16
|
-
this.statics = "";
|
|
16
|
+
this.statics = "^S.?_";
|
|
17
17
|
/** FIELD-SYMBOLS and inline FIELD-SYMBOLS(), case insensitive regex */
|
|
18
|
-
this.fieldSymbols = "^<
|
|
18
|
+
this.fieldSymbols = "^<[LGM].?_";
|
|
19
19
|
/** CONSTANTS, CONSTANTS BEGIN OF, case insensitive regex */
|
|
20
|
-
this.constants = "^[
|
|
20
|
+
this.constants = "^[LGM]?C.?_";
|
|
21
21
|
/** TYPES, ENUM, MESH, case insensitive regex */
|
|
22
|
-
this.types = "^
|
|
22
|
+
this.types = "^TY_";
|
|
23
23
|
/** importing, exporting, returning and changing parameters, case insensitive regex */
|
|
24
|
-
this.methodParameters = "^[
|
|
24
|
+
this.methodParameters = "^[ICER].?_";
|
|
25
25
|
// todo, public localClass: string = "";
|
|
26
26
|
// todo, public localInterface: string = "";
|
|
27
27
|
// todo, public functionModuleParameters: string = "";
|
|
@@ -3,16 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WhitespaceEnd = exports.WhitespaceEndConf = void 0;
|
|
4
4
|
const issue_1 = require("../issue");
|
|
5
5
|
const position_1 = require("../position");
|
|
6
|
-
const _abap_rule_1 = require("./_abap_rule");
|
|
7
6
|
const _basic_rule_config_1 = require("./_basic_rule_config");
|
|
8
7
|
const edit_helper_1 = require("../edit_helper");
|
|
9
8
|
const _irule_1 = require("./_irule");
|
|
9
|
+
const objects_1 = require("../objects");
|
|
10
10
|
class WhitespaceEndConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
11
11
|
}
|
|
12
12
|
exports.WhitespaceEndConf = WhitespaceEndConf;
|
|
13
|
-
class WhitespaceEnd
|
|
13
|
+
class WhitespaceEnd {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
15
|
this.conf = new WhitespaceEndConf();
|
|
17
16
|
}
|
|
18
17
|
getMetadata() {
|
|
@@ -20,7 +19,10 @@ class WhitespaceEnd extends _abap_rule_1.ABAPRule {
|
|
|
20
19
|
key: "whitespace_end",
|
|
21
20
|
title: "Whitespace at end of line",
|
|
22
21
|
shortDescription: `Checks for redundant whitespace at the end of each line.`,
|
|
22
|
+
extendedInformation: `SMIM and W3MI files are not checked.`,
|
|
23
23
|
tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],
|
|
24
|
+
badExample: `WRITE 'hello'. `,
|
|
25
|
+
goodExample: `WRITE 'hello'.`,
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
getMessage() {
|
|
@@ -32,17 +34,25 @@ class WhitespaceEnd extends _abap_rule_1.ABAPRule {
|
|
|
32
34
|
setConfig(conf) {
|
|
33
35
|
this.conf = conf;
|
|
34
36
|
}
|
|
35
|
-
|
|
37
|
+
initialize(_reg) {
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
run(obj) {
|
|
36
41
|
const issues = [];
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
for (const file of obj.getFiles()) {
|
|
43
|
+
if (obj instanceof objects_1.MIMEObject || obj instanceof objects_1.WebMIME) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const rows = file.getRawRows();
|
|
47
|
+
for (let i = 0; i < rows.length; i++) {
|
|
48
|
+
if (rows[i].endsWith(" ") || rows[i].endsWith(" \r")) {
|
|
49
|
+
const match = / +\r?$/.exec(rows[i]);
|
|
50
|
+
const start = new position_1.Position(i + 1, match.index + 1);
|
|
51
|
+
const end = new position_1.Position(i + 1, rows[i].length + 1);
|
|
52
|
+
const fix = edit_helper_1.EditHelper.deleteRange(file, start, end);
|
|
53
|
+
const issue = issue_1.Issue.atRange(file, start, end, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);
|
|
54
|
+
issues.push(issue);
|
|
55
|
+
}
|
|
46
56
|
}
|
|
47
57
|
}
|
|
48
58
|
return issues;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.106.
|
|
3
|
+
"version": "2.106.3",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -50,20 +50,20 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://abaplint.org",
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@microsoft/api-extractor": "^7.
|
|
54
|
-
"@types/chai": "^4.3.
|
|
53
|
+
"@microsoft/api-extractor": "^7.43.0",
|
|
54
|
+
"@types/chai": "^4.3.14",
|
|
55
55
|
"@types/mocha": "^10.0.6",
|
|
56
|
-
"@types/node": "^20.11.
|
|
56
|
+
"@types/node": "^20.11.30",
|
|
57
57
|
"chai": "^4.4.1",
|
|
58
58
|
"eslint": "^8.57.0",
|
|
59
59
|
"mocha": "^10.3.0",
|
|
60
60
|
"c8": "^9.1.0",
|
|
61
61
|
"source-map-support": "^0.5.21",
|
|
62
62
|
"ts-json-schema-generator": "^1.5.0",
|
|
63
|
-
"typescript": "^5.4.
|
|
63
|
+
"typescript": "^5.4.3"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"fast-xml-parser": "^4.3.
|
|
66
|
+
"fast-xml-parser": "^4.3.6",
|
|
67
67
|
"json5": "^2.2.3",
|
|
68
68
|
"vscode-languageserver-types": "^3.17.5"
|
|
69
69
|
}
|