@abaplint/core 2.110.6 → 2.110.8
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/attribute_name.js +1 -1
- package/build/src/abap/2_statements/expressions/source.js +3 -2
- package/build/src/abap/5_syntax/structures/data.js +4 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/macro_naming.js +4 -0
- package/package.json +3 -3
|
@@ -4,7 +4,7 @@ exports.AttributeName = void 0;
|
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
5
|
class AttributeName extends combi_1.Expression {
|
|
6
6
|
getRunnable() {
|
|
7
|
-
return (0, combi_1.regex)(/^(\/\w+\/)?[\w\d_\*\~%]+$/);
|
|
7
|
+
return (0, combi_1.regex)(/^(\/\w+\/)?(?!\*)[\w\d_\*\~%]+$/);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
exports.AttributeName = AttributeName;
|
|
@@ -14,7 +14,8 @@ class Source extends combi_1.Expression {
|
|
|
14
14
|
getRunnable() {
|
|
15
15
|
const comp = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), _1.ComponentChain);
|
|
16
16
|
const attr = (0, combi_1.seq)(_1.Arrow, attribute_chain_1.AttributeChain);
|
|
17
|
-
const
|
|
17
|
+
const deref = (0, combi_1.optPrio)((0, combi_1.ver)(version_1.Version.v756, dereference_1.Dereference));
|
|
18
|
+
const method = (0, combi_1.seq)(_1.MethodCallChain, (0, combi_1.optPrio)((0, combi_1.altPrio)(attr, comp)), deref);
|
|
18
19
|
const rparen = (0, combi_1.tok)(tokens_1.WParenRightW);
|
|
19
20
|
const rparenNoSpace = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.WParenRightW));
|
|
20
21
|
// paren used for eg. "( 2 + 1 ) * 4"
|
|
@@ -22,7 +23,7 @@ class Source extends combi_1.Expression {
|
|
|
22
23
|
const after = (0, combi_1.seq)((0, combi_1.altPrio)("&", "&&", _1.ArithOperator), Source);
|
|
23
24
|
const bool = (0, combi_1.seq)((0, combi_1.altPrio)((0, combi_1.ver)(version_1.Version.v702, (0, combi_1.regex)(/^BOOLC$/i)), (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.regex)(/^XSDBOOL$/i))), (0, combi_1.tok)(tokens_1.ParenLeftW), _1.Cond, ")");
|
|
24
25
|
const prefix = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WPlus), "BIT-NOT");
|
|
25
|
-
const old = (0, combi_1.seq)((0, combi_1.optPrio)(prefix), (0, combi_1.altPrio)(_1.Constant, _1.StringTemplate, text_element_1.TextElement, bool, method, (0, combi_1.seq)(_1.FieldChain,
|
|
26
|
+
const old = (0, combi_1.seq)((0, combi_1.optPrio)(prefix), (0, combi_1.altPrio)(_1.Constant, _1.StringTemplate, text_element_1.TextElement, bool, method, (0, combi_1.seq)(_1.FieldChain, deref), paren), (0, combi_1.optPrio)(after));
|
|
26
27
|
const corr = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CORRESPONDING", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.CorrespondingBody, rparen, (0, combi_1.optPrio)(after)));
|
|
27
28
|
const conv = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("CONV", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.ConvBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
|
|
28
29
|
const swit = (0, combi_1.ver)(version_1.Version.v740sp02, (0, combi_1.seq)("SWITCH", _1.TypeNameOrInfer, (0, combi_1.tok)(tokens_1.ParenLeftW), _1.SwitchBody, rparenNoSpace, (0, combi_1.optPrio)(after)));
|
|
@@ -42,7 +42,10 @@ class Data {
|
|
|
42
42
|
// INCLUDES
|
|
43
43
|
const typeToken = (_a = c.findFirstExpression(Expressions.TypeName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
|
|
44
44
|
const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();
|
|
45
|
-
|
|
45
|
+
let foundId = scope.findType(typeName);
|
|
46
|
+
if (foundId === undefined) {
|
|
47
|
+
foundId = scope.findVariable(typeName);
|
|
48
|
+
}
|
|
46
49
|
let found = foundId === null || foundId === void 0 ? void 0 : foundId.getType();
|
|
47
50
|
if (found === undefined) {
|
|
48
51
|
const f = scope.getDDIC().lookupTableOrView(typeName).type;
|
package/build/src/registry.js
CHANGED
|
@@ -28,6 +28,10 @@ class MacroNaming extends _abap_rule_1.ABAPRule {
|
|
|
28
28
|
shortDescription: `Allows you to enforce a pattern for macro definitions`,
|
|
29
29
|
extendedInformation: `Use rule "avoid_use" to avoid macros alotogether.`,
|
|
30
30
|
tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],
|
|
31
|
+
badExample: `DEFINE something.
|
|
32
|
+
END-OF-DEFINITION.`,
|
|
33
|
+
goodExample: `DEFINE _something.
|
|
34
|
+
END-OF-DEFINITION.`,
|
|
31
35
|
};
|
|
32
36
|
}
|
|
33
37
|
getConfig() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.110.
|
|
3
|
+
"version": "2.110.8",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"@microsoft/api-extractor": "^7.47.0",
|
|
54
54
|
"@types/chai": "^4.3.16",
|
|
55
55
|
"@types/mocha": "^10.0.7",
|
|
56
|
-
"@types/node": "^20.14.
|
|
56
|
+
"@types/node": "^20.14.10",
|
|
57
57
|
"chai": "^4.4.1",
|
|
58
58
|
"eslint": "^8.57.0",
|
|
59
59
|
"mocha": "^10.6.0",
|
|
60
60
|
"c8": "^10.1.2",
|
|
61
61
|
"source-map-support": "^0.5.21",
|
|
62
|
-
"ts-json-schema-generator": "
|
|
62
|
+
"ts-json-schema-generator": "^2.3.0",
|
|
63
63
|
"typescript": "^5.5.3"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|