@abaplint/core 2.93.63 → 2.93.65
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/statements/include.js +1 -2
- package/build/src/abap/5_syntax/basic_types.js +9 -8
- package/build/src/abap/5_syntax/statements/class_implementation.js +4 -0
- package/build/src/abap/types/method_parameters.js +13 -2
- package/build/src/cds/expressions/cds_annotation_object.js +2 -2
- package/build/src/cds/expressions/cds_type.js +2 -1
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
|
@@ -3,11 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Include = void 0;
|
|
4
4
|
const combi_1 = require("../combi");
|
|
5
5
|
const expressions_1 = require("../expressions");
|
|
6
|
-
const version_1 = require("../../../version");
|
|
7
6
|
class Include {
|
|
8
7
|
getMatcher() {
|
|
9
8
|
const ret = (0, combi_1.seq)("INCLUDE", expressions_1.IncludeName, (0, combi_1.opt)("IF FOUND"));
|
|
10
|
-
return
|
|
9
|
+
return ret;
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
12
|
exports.Include = Include;
|
|
@@ -509,9 +509,14 @@ class BasicTypes {
|
|
|
509
509
|
className = split[0];
|
|
510
510
|
rest = split[1];
|
|
511
511
|
}
|
|
512
|
+
else if (chainText.includes("->")) {
|
|
513
|
+
const split = chainText.split("->");
|
|
514
|
+
className = split[0];
|
|
515
|
+
rest = split[1];
|
|
516
|
+
}
|
|
512
517
|
const subs = rest.split("-");
|
|
513
518
|
let foundType = undefined;
|
|
514
|
-
if (className) {
|
|
519
|
+
if (className && chainText.includes("=>")) {
|
|
515
520
|
const split = chainText.split("=>");
|
|
516
521
|
const className = split[0];
|
|
517
522
|
// the prefix might be itself
|
|
@@ -545,11 +550,11 @@ class BasicTypes {
|
|
|
545
550
|
this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);
|
|
546
551
|
}
|
|
547
552
|
}
|
|
548
|
-
else if (chainText.includes("->")) {
|
|
549
|
-
const
|
|
550
|
-
const varVar = this.scope.findVariable(varName);
|
|
553
|
+
else if (className && chainText.includes("->")) {
|
|
554
|
+
const varVar = this.scope.findVariable(className);
|
|
551
555
|
const foo = varVar === null || varVar === void 0 ? void 0 : varVar.getType();
|
|
552
556
|
if (foo instanceof basic_1.ObjectReferenceType) {
|
|
557
|
+
const typeName = subs[0];
|
|
553
558
|
const id = foo.getIdentifier();
|
|
554
559
|
const type = id instanceof types_1.ClassDefinition ? "CLAS" : "INTF";
|
|
555
560
|
this.scope.addReference(expr.getFirstToken(), id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: id.getName() });
|
|
@@ -562,10 +567,6 @@ class BasicTypes {
|
|
|
562
567
|
this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);
|
|
563
568
|
}
|
|
564
569
|
}
|
|
565
|
-
// todo, ugh, hmm
|
|
566
|
-
while (subs.length > 0) {
|
|
567
|
-
subs.shift();
|
|
568
|
-
}
|
|
569
570
|
}
|
|
570
571
|
else {
|
|
571
572
|
const found = this.scope.findType(subs[0]);
|
|
@@ -24,6 +24,10 @@ class ClassImplementation {
|
|
|
24
24
|
if (sup) {
|
|
25
25
|
scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(new tokens_1.Identifier(new position_1.Position(1, 1), "super"), _builtin_1.BuiltIn.filename, new basic_1.ObjectReferenceType(sup)));
|
|
26
26
|
}
|
|
27
|
+
else {
|
|
28
|
+
// todo: instead of the void type, do proper typing, ie. only empty constructor method
|
|
29
|
+
scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(new tokens_1.Identifier(new position_1.Position(1, 1), "super"), _builtin_1.BuiltIn.filename, new basic_1.VoidType("noSuper")));
|
|
30
|
+
}
|
|
27
31
|
scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(new tokens_1.Identifier(new position_1.Position(1, 1), "me"), _builtin_1.BuiltIn.filename, new basic_1.ObjectReferenceType(classDefinition)));
|
|
28
32
|
helper.addAliasedAttributes(classDefinition); // todo, this is not correct, take care of instance vs static
|
|
29
33
|
const classAttributes = classDefinition.getAttributes();
|
|
@@ -10,6 +10,7 @@ const method_def_returning_1 = require("../5_syntax/expressions/method_def_retur
|
|
|
10
10
|
const method_param_1 = require("../5_syntax/expressions/method_param");
|
|
11
11
|
const _object_oriented_1 = require("../5_syntax/_object_oriented");
|
|
12
12
|
const _reference_1 = require("../5_syntax/_reference");
|
|
13
|
+
const identifier_1 = require("../1_lexer/tokens/identifier");
|
|
13
14
|
// todo:
|
|
14
15
|
// this.exceptions = [];
|
|
15
16
|
// also consider RAISING vs EXCEPTIONS
|
|
@@ -147,9 +148,19 @@ class MethodParameters {
|
|
|
147
148
|
}
|
|
148
149
|
}
|
|
149
150
|
// RAP parameters, temporary fix
|
|
150
|
-
|
|
151
|
+
let rapName = node.findExpressionAfterToken("IMPORTING");
|
|
151
152
|
if (rapName) {
|
|
152
|
-
|
|
153
|
+
const token = rapName.getFirstToken();
|
|
154
|
+
this.importing.push(new _typed_identifier_1.TypedIdentifier(token, filename, new basic_1.VoidType("RapMethodParameter"), ["importing" /* IdentifierMeta.MethodImporting */]));
|
|
155
|
+
if (node.concatTokens().toUpperCase().includes(" FOR VALIDATE ON SAVE")) {
|
|
156
|
+
this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "failed"), filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
157
|
+
this.exporting.push(new _typed_identifier_1.TypedIdentifier(new identifier_1.Identifier(token.getStart(), "reported"), filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
rapName = node.findExpressionAfterToken("RESULT");
|
|
161
|
+
if (rapName) {
|
|
162
|
+
const token = rapName.getFirstToken();
|
|
163
|
+
this.importing.push(new _typed_identifier_1.TypedIdentifier(token, filename, new basic_1.VoidType("RapMethodParameter"), ["exporting" /* IdentifierMeta.MethodExporting */]));
|
|
153
164
|
}
|
|
154
165
|
const exporting = node.findFirstExpression(Expressions.MethodDefExporting);
|
|
155
166
|
if (exporting) {
|
|
@@ -6,9 +6,9 @@ const combi_1 = require("../../abap/2_statements/combi");
|
|
|
6
6
|
const cds_annotation_simple_1 = require("./cds_annotation_simple");
|
|
7
7
|
class CDSAnnotationObject extends combi_1.Expression {
|
|
8
8
|
getRunnable() {
|
|
9
|
-
const value = (0, combi_1.alt)(CDSAnnotationObject, _1.CDSAnnotationArray, cds_annotation_simple_1.CDSAnnotationSimple);
|
|
9
|
+
const value = (0, combi_1.seq)(":", (0, combi_1.alt)(CDSAnnotationObject, _1.CDSAnnotationArray, cds_annotation_simple_1.CDSAnnotationSimple));
|
|
10
10
|
const namedot = (0, combi_1.seq)(_1.CDSName, (0, combi_1.star)((0, combi_1.seq)(".", _1.CDSName)));
|
|
11
|
-
const valueNested = (0, combi_1.seq)("{", namedot,
|
|
11
|
+
const valueNested = (0, combi_1.seq)("{", namedot, (0, combi_1.opt)(value), (0, combi_1.star)((0, combi_1.seq)(",", namedot, (0, combi_1.opt)(value))), "}");
|
|
12
12
|
return valueNested;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -5,7 +5,8 @@ const _1 = require(".");
|
|
|
5
5
|
const combi_1 = require("../../abap/2_statements/combi");
|
|
6
6
|
class CDSType extends combi_1.Expression {
|
|
7
7
|
getRunnable() {
|
|
8
|
-
|
|
8
|
+
const decimals = (0, combi_1.seq)(",", (0, combi_1.regex)(/\d+/));
|
|
9
|
+
return (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)), (0, combi_1.opt)((0, combi_1.seq)("(", (0, combi_1.regex)(/\d+/), (0, combi_1.opt)(decimals), ")")));
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
exports.CDSType = CDSType;
|
package/build/src/registry.js
CHANGED