@abaplint/core 2.120.22 → 2.120.24
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/class_definition.js +1 -1
- package/build/src/abap/2_statements/statements/method_def.js +7 -1
- package/build/src/abap/5_syntax/_type_utils.js +3 -0
- package/build/src/abap/5_syntax/statements/method_implementation.js +1 -1
- package/build/src/registry.js +1 -1
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ class ClassDefinition {
|
|
|
11
11
|
const risk = (0, combi_1.seq)("RISK LEVEL", level);
|
|
12
12
|
const time = (0, combi_1.altPrio)("LONG", "MEDIUM", "SHORT");
|
|
13
13
|
const duration = (0, combi_1.seq)("DURATION", time);
|
|
14
|
-
const blah = (0, combi_1.per)(expressions_1.ClassGlobal, expressions_1.ClassFinal, "ABSTRACT", (0, combi_1.seq)("INHERITING FROM", expressions_1.SuperClassName), create, "FOR TESTING", risk, "SHARED MEMORY ENABLED", duration, (0, combi_1.ver)(version_1.Release.v754, (0, combi_1.seq)("FOR BEHAVIOR OF", expressions_1.BehaviorDefinitionName), { also: combi_1.AlsoIn.OpenABAP }), expressions_1.ClassFriends);
|
|
14
|
+
const blah = (0, combi_1.per)(expressions_1.ClassGlobal, expressions_1.ClassFinal, "ABSTRACT", (0, combi_1.seq)("INHERITING FROM", expressions_1.SuperClassName), create, "FOR TESTING", risk, "SHARED MEMORY ENABLED", duration, (0, combi_1.ver)(version_1.Release.v754, (0, combi_1.seq)("FOR BEHAVIOR OF", expressions_1.BehaviorDefinitionName), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.ver)(version_1.Release.v758, (0, combi_1.seq)("FOR EVENTS OF", expressions_1.BehaviorDefinitionName)), expressions_1.ClassFriends);
|
|
15
15
|
const def = (0, combi_1.seq)("DEFINITION", (0, combi_1.optPrio)(blah));
|
|
16
16
|
return (0, combi_1.seq)("CLASS", expressions_1.ClassName, def);
|
|
17
17
|
}
|
|
@@ -4,6 +4,7 @@ exports.MethodDef = void 0;
|
|
|
4
4
|
const version_1 = require("../../../version");
|
|
5
5
|
const combi_1 = require("../combi");
|
|
6
6
|
const expressions_1 = require("../expressions");
|
|
7
|
+
const tokens_1 = require("../../1_lexer/tokens");
|
|
7
8
|
class MethodDef {
|
|
8
9
|
getMatcher() {
|
|
9
10
|
const def = (0, combi_1.ver)(version_1.Release.v740sp08, (0, combi_1.seq)("DEFAULT", (0, combi_1.altPrio)("FAIL", "IGNORE")), { also: combi_1.AlsoIn.OpenABAP });
|
|
@@ -17,6 +18,9 @@ class MethodDef {
|
|
|
17
18
|
const modify = (0, combi_1.alt)((0, combi_1.seq)("FOR ACTION", expressions_1.TypeName, (0, combi_1.optPrio)(result)), (0, combi_1.seq)("FOR CREATE", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation)), (0, combi_1.seq)("FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("FOR UPDATE", expressions_1.TypeName));
|
|
18
19
|
const forRead = (0, combi_1.seq)("FOR READ", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation), (0, combi_1.optPrio)(full), result, (0, combi_1.optPrio)(link));
|
|
19
20
|
const forfunction = (0, combi_1.seq)("FOR FUNCTION", expressions_1.TypeName, result);
|
|
21
|
+
const entityEventReference = (0, combi_1.seq)("REFERENCE", (0, combi_1.tok)(tokens_1.ParenLeft), expressions_1.MethodParamName, (0, combi_1.tok)(tokens_1.ParenRightW));
|
|
22
|
+
const entityEventParameter = (0, combi_1.seq)((0, combi_1.altPrio)(entityEventReference, expressions_1.MethodParamName), "FOR", expressions_1.TypeName);
|
|
23
|
+
const entityEvent = (0, combi_1.seq)((0, combi_1.optPrio)("FINAL"), "FOR ENTITY EVENT", (0, combi_1.optPrio)("IMPORTING"), (0, combi_1.plus)(entityEventParameter));
|
|
20
24
|
const behavior = (0, combi_1.altPrio)("DDL OBJECT OPTIONS CDS SESSION CLIENT REQUIRED", // todo, this is only from version something
|
|
21
25
|
(0, combi_1.seq)("TABLE FUNCTION", expressions_1.NamespaceSimpleName), // todo, this is only from version something
|
|
22
26
|
(0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY", (0, combi_1.opt)("IMPORTING"), (0, combi_1.plus)((0, combi_1.seq)(expressions_1.MethodParamName, modify))), (0, combi_1.seq)("PRECHECK IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("DETERMINATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("VALIDATION", expressions_1.TypeName, "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("NUMBERING IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, (0, combi_1.altPrio)(forRead, forfunction)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR CREATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName, expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR READ", expressions_1.TypeName, result), (0, combi_1.seq)("BEHAVIOR IMPORTING", expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName), (0, combi_1.seq)((0, combi_1.alt)("BEHAVIOR", "LOCK"), "IMPORTING", expressions_1.MethodParamName, "FOR LOCK", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("GLOBAL AUTHORIZATION IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("GLOBAL FEATURES IMPORTING REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)((0, combi_1.seq)((0, combi_1.opt)("INSTANCE"), "AUTHORIZATION IMPORTING"), expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result), (0, combi_1.seq)("INSTANCE FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.MethodParamName, "FOR", expressions_1.TypeName, result));
|
|
@@ -24,7 +28,9 @@ class MethodDef {
|
|
|
24
28
|
// AMDP OPTIONS clause blocked in KeyUser
|
|
25
29
|
const amdp = (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("AMDP OPTIONS", (0, combi_1.optPrio)("READ-ONLY"), "CDS SESSION CLIENT", (0, combi_1.alt)("CURRENT", "DEPENDENT"), (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising)));
|
|
26
30
|
// FOR DDL OBJECT / FOR TABLE FUNCTION / FOR SCALAR FUNCTION blocked in KeyUser
|
|
27
|
-
const
|
|
31
|
+
const regular = (0, combi_1.seq)((0, combi_1.altPrio)("CLASS-METHODS", "METHODS"), expressions_1.MethodName, (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), (0, combi_1.optPrio)(def), expressions_1.EventHandler), parameters, testing, (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.seq)("FOR", behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
|
|
32
|
+
// RAP event handlers are instance methods; CLASS-METHODS is not allowed.
|
|
33
|
+
const ret = (0, combi_1.alt)((0, combi_1.seq)("METHODS", expressions_1.MethodName, (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, entityEvent)), regular);
|
|
28
34
|
return ret;
|
|
29
35
|
}
|
|
30
36
|
}
|
|
@@ -343,6 +343,9 @@ class TypeUtils {
|
|
|
343
343
|
&& (target instanceof basic_1.XStringType || target instanceof basic_1.XSequenceType)) {
|
|
344
344
|
return false;
|
|
345
345
|
}
|
|
346
|
+
if (calculated && source instanceof basic_1.IntegerType && target instanceof basic_1.DateType) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
346
349
|
if (target instanceof basic_1.NumericType
|
|
347
350
|
&& (source instanceof basic_1.CharacterType || source instanceof basic_1.StringType)
|
|
348
351
|
&& ((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {
|
|
@@ -61,7 +61,7 @@ class MethodImplementation {
|
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
const start = node.getFirstToken().getStart();
|
|
64
|
-
if ((methodDefinition === null || methodDefinition === void 0 ? void 0 : methodDefinition.isStatic()) === false) {
|
|
64
|
+
if ((methodDefinition === null || methodDefinition === void 0 ? void 0 : methodDefinition.isStatic()) === false || methodDefinition === undefined) {
|
|
65
65
|
input.scope.push(_scope_type_1.ScopeType.MethodInstance, methodName, start, input.filename);
|
|
66
66
|
input.scope.addList(classDefinition.getAttributes().getInstance());
|
|
67
67
|
}
|
package/build/src/registry.js
CHANGED