@abaplint/core 2.115.19 → 2.115.21
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/src/abap/2_statements/expressions/abstract_methods.js +1 -1
- package/build/src/abap/2_statements/expressions/function_parameters.js +1 -1
- package/build/src/abap/2_statements/statements/interface_def.js +1 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/index.js +1 -0
- package/build/src/rules/parser_bad_exceptions.js +55 -0
- package/package.json +4 -4
|
@@ -5,7 +5,7 @@ const combi_1 = require("../combi");
|
|
|
5
5
|
const method_name_1 = require("./method_name");
|
|
6
6
|
class AbstractMethods extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
return (0, combi_1.seq)("ABSTRACT METHODS", (0, combi_1.
|
|
8
|
+
return (0, combi_1.seq)("ABSTRACT METHODS", (0, combi_1.plus)(method_name_1.MethodName));
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
exports.AbstractMethods = AbstractMethods;
|
|
@@ -9,7 +9,7 @@ class FunctionParameters extends combi_1.Expression {
|
|
|
9
9
|
const importing = (0, combi_1.seq)("IMPORTING", _1.ParameterListT);
|
|
10
10
|
const changing = (0, combi_1.seq)("CHANGING", _1.ParameterListT);
|
|
11
11
|
const tables = (0, combi_1.seq)("TABLES", _1.ParameterListT);
|
|
12
|
-
const exceptions = (0, combi_1.seq)("EXCEPTIONS", (0, combi_1.
|
|
12
|
+
const exceptions = (0, combi_1.seq)("EXCEPTIONS", (0, combi_1.altPrio)(_1.ParameterListExceptions, (0, combi_1.plus)(_1.Field)));
|
|
13
13
|
const long = (0, combi_1.seq)((0, combi_1.optPrio)(exporting), (0, combi_1.optPrio)(importing), (0, combi_1.optPrio)(tables), (0, combi_1.optPrio)(changing), (0, combi_1.optPrio)(exceptions));
|
|
14
14
|
return long;
|
|
15
15
|
}
|
|
@@ -8,7 +8,7 @@ class InterfaceDef {
|
|
|
8
8
|
getMatcher() {
|
|
9
9
|
const val = (0, combi_1.seq)(expressions_1.AttributeName, "=", expressions_1.Source);
|
|
10
10
|
const dataValues = (0, combi_1.seq)("DATA VALUES", (0, combi_1.plus)(val));
|
|
11
|
-
const options = (0, combi_1.alt)(expressions_1.AbstractMethods, expressions_1.FinalMethods, "ALL METHODS ABSTRACT", "ALL METHODS FINAL", (0, combi_1.ver)(version_1.Version.v740sp02, "PARTIALLY IMPLEMENTED", version_1.Version.OpenABAP));
|
|
11
|
+
const options = (0, combi_1.alt)((0, combi_1.seq)(expressions_1.AbstractMethods, (0, combi_1.opt)(expressions_1.FinalMethods)), expressions_1.FinalMethods, "ALL METHODS ABSTRACT", "ALL METHODS FINAL", (0, combi_1.ver)(version_1.Version.v740sp02, "PARTIALLY IMPLEMENTED", version_1.Version.OpenABAP));
|
|
12
12
|
return (0, combi_1.seq)("INTERFACES", expressions_1.InterfaceName, (0, combi_1.opt)(options), (0, combi_1.opt)(dataValues));
|
|
13
13
|
}
|
|
14
14
|
}
|
package/build/src/registry.js
CHANGED
package/build/src/rules/index.js
CHANGED
|
@@ -129,6 +129,7 @@ __exportStar(require("./omit_parameter_name"), exports);
|
|
|
129
129
|
__exportStar(require("./omit_preceding_zeros"), exports);
|
|
130
130
|
__exportStar(require("./omit_receiving"), exports);
|
|
131
131
|
__exportStar(require("./parser_702_chaining"), exports);
|
|
132
|
+
__exportStar(require("./parser_bad_exceptions"), exports);
|
|
132
133
|
__exportStar(require("./parser_error"), exports);
|
|
133
134
|
__exportStar(require("./parser_missing_space"), exports);
|
|
134
135
|
__exportStar(require("./pragma_style"), exports);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParserBadExceptions = exports.ParserBadExceptionsConf = void 0;
|
|
4
|
+
const Statements = require("../abap/2_statements/statements");
|
|
5
|
+
const Expressions = require("../abap/2_statements/expressions");
|
|
6
|
+
const issue_1 = require("../issue");
|
|
7
|
+
const _abap_rule_1 = require("./_abap_rule");
|
|
8
|
+
const _basic_rule_config_1 = require("./_basic_rule_config");
|
|
9
|
+
const _irule_1 = require("./_irule");
|
|
10
|
+
// todo: this rule needs refactoring
|
|
11
|
+
class ParserBadExceptionsConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
12
|
+
}
|
|
13
|
+
exports.ParserBadExceptionsConf = ParserBadExceptionsConf;
|
|
14
|
+
class ParserBadExceptions extends _abap_rule_1.ABAPRule {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.conf = new ParserBadExceptionsConf();
|
|
18
|
+
}
|
|
19
|
+
getMetadata() {
|
|
20
|
+
return {
|
|
21
|
+
key: "parser_bad_exceptions",
|
|
22
|
+
title: "Parser Error, bad EXCEPTIONS in CALL FUNCTION",
|
|
23
|
+
shortDescription: `Checks for syntax not recognized by abaplint, related to EXCEPTIONS in CALL FUNCTION.`,
|
|
24
|
+
tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],
|
|
25
|
+
/*
|
|
26
|
+
badExample: `IF ( foo = 'bar').`,
|
|
27
|
+
goodExample: `IF ( foo = 'bar' ).`,
|
|
28
|
+
*/
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
getConfig() {
|
|
32
|
+
return this.conf;
|
|
33
|
+
}
|
|
34
|
+
setConfig(conf) {
|
|
35
|
+
this.conf = conf;
|
|
36
|
+
}
|
|
37
|
+
runParsed(file) {
|
|
38
|
+
var _a;
|
|
39
|
+
const issues = [];
|
|
40
|
+
for (const statement of file.getStatements()) {
|
|
41
|
+
if (!(statement.get() instanceof Statements.CallFunction)) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const found = (_a = statement.findDirectExpression(Expressions.FunctionParameters)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Field);
|
|
45
|
+
if (found === undefined) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const message = "Bad EXCEPTIONS syntax in CALL FUNCTION";
|
|
49
|
+
issues.push(issue_1.Issue.atToken(file, found.getFirstToken(), message, this.getMetadata().key, this.conf.severity));
|
|
50
|
+
}
|
|
51
|
+
return issues;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.ParserBadExceptions = ParserBadExceptions;
|
|
55
|
+
//# sourceMappingURL=parser_bad_exceptions.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.115.
|
|
3
|
+
"version": "2.115.21",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -50,16 +50,16 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://abaplint.org",
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@microsoft/api-extractor": "^7.56.
|
|
53
|
+
"@microsoft/api-extractor": "^7.56.3",
|
|
54
54
|
"@types/chai": "^4.3.20",
|
|
55
55
|
"@types/mocha": "^10.0.10",
|
|
56
|
-
"@types/node": "^24.10.
|
|
56
|
+
"@types/node": "^24.10.12",
|
|
57
57
|
"chai": "^4.5.0",
|
|
58
58
|
"eslint": "^9.39.2",
|
|
59
59
|
"mocha": "^11.7.5",
|
|
60
60
|
"c8": "^10.1.3",
|
|
61
61
|
"source-map-support": "^0.5.21",
|
|
62
|
-
"ts-json-schema-generator": "
|
|
62
|
+
"ts-json-schema-generator": "=2.4.0",
|
|
63
63
|
"typescript": "^5.9.3"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|