@abaplint/core 2.112.6 → 2.112.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/abaplint.d.ts +11 -1
- package/build/src/abap/5_syntax/_object_oriented.js +2 -2
- package/build/src/abap/5_syntax/basic_types.js +1 -1
- package/build/src/abap/types/interface_definition.js +3 -22
- package/build/src/cds/cds_parser.js +3 -0
- package/build/src/cds/expressions/cds_extend_view.js +15 -0
- package/build/src/cds/expressions/cds_having.js +12 -0
- package/build/src/cds/expressions/cds_select.js +1 -1
- package/build/src/cds/expressions/index.js +3 -1
- package/build/src/registry.js +1 -1
- package/build/src/rules/cyclic_oo.js +1 -1
- package/package.json +6 -6
package/build/abaplint.d.ts
CHANGED
|
@@ -807,6 +807,10 @@ declare class CDSElement extends Expression {
|
|
|
807
807
|
getRunnable(): IStatementRunnable;
|
|
808
808
|
}
|
|
809
809
|
|
|
810
|
+
declare class CDSExtendView extends Expression {
|
|
811
|
+
getRunnable(): IStatementRunnable;
|
|
812
|
+
}
|
|
813
|
+
|
|
810
814
|
declare class CDSFunction extends Expression {
|
|
811
815
|
getRunnable(): IStatementRunnable;
|
|
812
816
|
}
|
|
@@ -815,6 +819,10 @@ declare class CDSGroupBy extends Expression {
|
|
|
815
819
|
getRunnable(): IStatementRunnable;
|
|
816
820
|
}
|
|
817
821
|
|
|
822
|
+
declare class CDSHaving extends Expression {
|
|
823
|
+
getRunnable(): IStatementRunnable;
|
|
824
|
+
}
|
|
825
|
+
|
|
818
826
|
declare class CDSInteger extends Expression {
|
|
819
827
|
getRunnable(): IStatementRunnable;
|
|
820
828
|
}
|
|
@@ -2351,14 +2359,16 @@ declare namespace ExpressionsCDS {
|
|
|
2351
2359
|
CDSDefineProjection,
|
|
2352
2360
|
CDSDefineView,
|
|
2353
2361
|
CDSElement,
|
|
2362
|
+
CDSExtendView,
|
|
2354
2363
|
CDSFunction,
|
|
2355
2364
|
CDSGroupBy,
|
|
2356
|
-
|
|
2365
|
+
CDSHaving,
|
|
2357
2366
|
CDSInteger,
|
|
2358
2367
|
CDSJoin,
|
|
2359
2368
|
CDSName,
|
|
2360
2369
|
CDSParametersSelect,
|
|
2361
2370
|
CDSParameters,
|
|
2371
|
+
CDSProviderContract,
|
|
2362
2372
|
CDSRelation,
|
|
2363
2373
|
CDSSelect,
|
|
2364
2374
|
CDSSource,
|
|
@@ -316,9 +316,9 @@ class ObjectOriented {
|
|
|
316
316
|
return ignore;
|
|
317
317
|
}
|
|
318
318
|
// returns list of interfaces implemented
|
|
319
|
-
fromInterfaces(
|
|
319
|
+
fromInterfaces(definition, skip) {
|
|
320
320
|
const ignore = [];
|
|
321
|
-
for (const i of
|
|
321
|
+
for (const i of definition.getImplementing()) {
|
|
322
322
|
ignore.push(...this.fromInterfaceByName(i.name, ignore.concat(skip || [])));
|
|
323
323
|
}
|
|
324
324
|
return ignore;
|
|
@@ -796,7 +796,7 @@ class BasicTypes {
|
|
|
796
796
|
const attr = token.getStr();
|
|
797
797
|
const c = new _object_oriented_1.ObjectOriented(this.input.scope).searchConstantName(obj, attr);
|
|
798
798
|
if (c instanceof class_constant_1.ClassConstant) {
|
|
799
|
-
this.input.scope.addReference(firstToken, obj, _reference_1.ReferenceType.ObjectOrientedReference, this.input.filename);
|
|
799
|
+
this.input.scope.addReference(firstToken, obj, _reference_1.ReferenceType.ObjectOrientedReference, this.input.filename, { ooName: obj.getName() });
|
|
800
800
|
this.input.scope.addReference(token, c, _reference_1.ReferenceType.DataReadReference, this.input.filename);
|
|
801
801
|
const val = c.getValue();
|
|
802
802
|
if (typeof val === "string") {
|
|
@@ -11,6 +11,7 @@ const _scope_type_1 = require("../5_syntax/_scope_type");
|
|
|
11
11
|
const event_definition_1 = require("./event_definition");
|
|
12
12
|
const method_definitions_1 = require("./method_definitions");
|
|
13
13
|
const _reference_1 = require("../5_syntax/_reference");
|
|
14
|
+
const _object_oriented_1 = require("../5_syntax/_object_oriented");
|
|
14
15
|
class InterfaceDefinition extends _identifier_1.Identifier {
|
|
15
16
|
constructor(node, input) {
|
|
16
17
|
if (!(node.get() instanceof Structures.Interface)) {
|
|
@@ -76,32 +77,12 @@ class InterfaceDefinition extends _identifier_1.Identifier {
|
|
|
76
77
|
}
|
|
77
78
|
parse(input, node) {
|
|
78
79
|
this.checkInterfacesExists(input, node);
|
|
80
|
+
const helper = new _object_oriented_1.ObjectOriented(input.scope);
|
|
81
|
+
helper.fromInterfaces(this);
|
|
79
82
|
// todo, proper sequencing, the statements should be processed line by line
|
|
80
83
|
this.attributes = new class_attributes_1.Attributes(node, input);
|
|
81
84
|
this.typeDefinitions = this.attributes.getTypes();
|
|
82
85
|
this.aliases = this.attributes.getAliases();
|
|
83
|
-
// todo, cleanup aliases, vs "object_oriented.ts" vs "class_implementation.ts"
|
|
84
|
-
// this adds the aliased types to scope?
|
|
85
|
-
/*
|
|
86
|
-
for (const a of this.aliases) {
|
|
87
|
-
const [objName, fieldName] = a.getComponent().split("~");
|
|
88
|
-
const idef = input.scope.findInterfaceDefinition(objName);
|
|
89
|
-
if (idef) {
|
|
90
|
-
const foundType = idef.getTypeDefinitions().getByName(fieldName);
|
|
91
|
-
if (foundType) {
|
|
92
|
-
input.scope.addTypeNamed(a.getName(), foundType);
|
|
93
|
-
} else {
|
|
94
|
-
const foundField = idef.getAttributes().findByName(fieldName);
|
|
95
|
-
if (foundField && foundField instanceof ClassConstant) {
|
|
96
|
-
const token = new TokenIdentifier(a.getStart(), a.getName());
|
|
97
|
-
const id = new TypedIdentifier(token, input.filename, foundField.getType());
|
|
98
|
-
const constant = new ClassConstant(id, Visibility.Public, foundField.getValue());
|
|
99
|
-
input.scope.addIdentifier(constant);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
*/
|
|
105
86
|
const events = node.findAllStatements(Statements.Events);
|
|
106
87
|
for (const e of events) {
|
|
107
88
|
this.events.push(new event_definition_1.EventDefinition(e, visibility_1.Visibility.Public, input));
|
|
@@ -29,6 +29,9 @@ class CDSParser {
|
|
|
29
29
|
if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
|
|
30
30
|
res = combi_1.Combi.run(new Expressions.CDSDefineCustom(), tokens, version_1.defaultVersion);
|
|
31
31
|
}
|
|
32
|
+
if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
|
|
33
|
+
res = combi_1.Combi.run(new Expressions.CDSExtendView(), tokens, version_1.defaultVersion);
|
|
34
|
+
}
|
|
32
35
|
if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
|
|
33
36
|
return undefined;
|
|
34
37
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CDSExtendView = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const combi_1 = require("../../abap/2_statements/combi");
|
|
6
|
+
const cds_name_1 = require("./cds_name");
|
|
7
|
+
class CDSExtendView extends combi_1.Expression {
|
|
8
|
+
getRunnable() {
|
|
9
|
+
const namedot = (0, combi_1.seq)(cds_name_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", cds_name_1.CDSName)), (0, combi_1.opt)(_1.CDSAs));
|
|
10
|
+
const valueNested = (0, combi_1.seq)("{", namedot, (0, combi_1.star)((0, combi_1.seq)(",", namedot)), "}");
|
|
11
|
+
return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("EXTEND VIEW"), (0, combi_1.opt)((0, combi_1.str)("ENTITY")), cds_name_1.CDSName, (0, combi_1.str)("WITH"), (0, combi_1.opt)(cds_name_1.CDSName), valueNested, (0, combi_1.opt)(";"));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.CDSExtendView = CDSExtendView;
|
|
15
|
+
//# sourceMappingURL=cds_extend_view.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CDSHaving = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const combi_1 = require("../../abap/2_statements/combi");
|
|
6
|
+
class CDSHaving extends combi_1.Expression {
|
|
7
|
+
getRunnable() {
|
|
8
|
+
return (0, combi_1.seq)("HAVING", _1.CDSCondition);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.CDSHaving = CDSHaving;
|
|
12
|
+
//# sourceMappingURL=cds_having.js.map
|
|
@@ -10,7 +10,7 @@ class CDSSelect extends combi_1.Expression {
|
|
|
10
10
|
const fields = (0, combi_1.opt)((0, combi_1.seq)((0, combi_1.star)((0, combi_1.seq)(_1.CDSElement, ",")), _1.CDSElement));
|
|
11
11
|
const distinct = (0, combi_1.str)("DISTINCT");
|
|
12
12
|
const elements = (0, combi_1.seq)((0, combi_1.str)("{"), (0, combi_1.plus)(_1.CDSElement), (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.str)("}"));
|
|
13
|
-
return (0, combi_1.seq)("SELECT", (0, combi_1.opt)(distinct), (0, combi_1.opt)(fields), "FROM", _1.CDSSource, (0, combi_1.opt)(_1.CDSParametersSelect), (0, combi_1.opt)(_1.CDSAs), (0, combi_1.star)(cds_join_1.CDSJoin), (0, combi_1.star)(_1.CDSComposition), (0, combi_1.star)(cds_association_1.CDSAssociation), (0, combi_1.star)(_1.CDSComposition), (0, combi_1.opt)(elements), (0, combi_1.opt)(_1.CDSGroupBy), (0, combi_1.opt)(_1.
|
|
13
|
+
return (0, combi_1.seq)("SELECT", (0, combi_1.opt)(distinct), (0, combi_1.opt)(fields), "FROM", _1.CDSSource, (0, combi_1.opt)(_1.CDSParametersSelect), (0, combi_1.opt)(_1.CDSAs), (0, combi_1.star)(cds_join_1.CDSJoin), (0, combi_1.star)(_1.CDSComposition), (0, combi_1.star)(cds_association_1.CDSAssociation), (0, combi_1.star)(_1.CDSComposition), (0, combi_1.opt)(elements), (0, combi_1.opt)(_1.CDSWhere), (0, combi_1.opt)(_1.CDSGroupBy), (0, combi_1.opt)(_1.CDSHaving), (0, combi_1.opt)((0, combi_1.seq)("UNION", (0, combi_1.opt)("ALL"), CDSSelect)));
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
exports.CDSSelect = CDSSelect;
|
|
@@ -33,14 +33,16 @@ __exportStar(require("./cds_define_custom"), exports);
|
|
|
33
33
|
__exportStar(require("./cds_define_projection"), exports);
|
|
34
34
|
__exportStar(require("./cds_define_view"), exports);
|
|
35
35
|
__exportStar(require("./cds_element"), exports);
|
|
36
|
+
__exportStar(require("./cds_extend_view"), exports);
|
|
36
37
|
__exportStar(require("./cds_function"), exports);
|
|
37
38
|
__exportStar(require("./cds_group_by"), exports);
|
|
38
|
-
__exportStar(require("./
|
|
39
|
+
__exportStar(require("./cds_having"), exports);
|
|
39
40
|
__exportStar(require("./cds_integer"), exports);
|
|
40
41
|
__exportStar(require("./cds_join"), exports);
|
|
41
42
|
__exportStar(require("./cds_name"), exports);
|
|
42
43
|
__exportStar(require("./cds_parameters_select"), exports);
|
|
43
44
|
__exportStar(require("./cds_parameters"), exports);
|
|
45
|
+
__exportStar(require("./cds_provider_contract"), exports);
|
|
44
46
|
__exportStar(require("./cds_relation"), exports);
|
|
45
47
|
__exportStar(require("./cds_select"), exports);
|
|
46
48
|
__exportStar(require("./cds_source"), exports);
|
package/build/src/registry.js
CHANGED
|
@@ -31,7 +31,7 @@ class CyclicOO {
|
|
|
31
31
|
return {
|
|
32
32
|
key: "cyclic_oo",
|
|
33
33
|
title: "Cyclic OO",
|
|
34
|
-
shortDescription: `Finds cyclic OO references`,
|
|
34
|
+
shortDescription: `Finds cyclic/circular OO references`,
|
|
35
35
|
extendedInformation: `Runs for global INTF + CLAS objects
|
|
36
36
|
|
|
37
37
|
Objects must be without syntax errors for this rule to take effect
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.112.
|
|
3
|
+
"version": "2.112.8",
|
|
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.47.
|
|
53
|
+
"@microsoft/api-extractor": "^7.47.4",
|
|
54
54
|
"@types/chai": "^4.3.16",
|
|
55
55
|
"@types/mocha": "^10.0.7",
|
|
56
|
-
"@types/node": "^
|
|
57
|
-
"chai": "^4.
|
|
56
|
+
"@types/node": "^22.0.0",
|
|
57
|
+
"chai": "^4.5.0",
|
|
58
58
|
"eslint": "^8.57.0",
|
|
59
59
|
"mocha": "^10.7.0",
|
|
60
60
|
"c8": "^10.1.2",
|
|
61
61
|
"source-map-support": "^0.5.21",
|
|
62
62
|
"ts-json-schema-generator": "^2.3.0",
|
|
63
|
-
"typescript": "^5.5.
|
|
63
|
+
"typescript": "^5.5.4"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"fast-xml-parser": "^4.4.
|
|
66
|
+
"fast-xml-parser": "^4.4.1",
|
|
67
67
|
"json5": "^2.2.3",
|
|
68
68
|
"vscode-languageserver-types": "^3.17.5"
|
|
69
69
|
}
|