@abaplint/core 2.93.60 → 2.93.62

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.
@@ -646,6 +646,10 @@ declare class CDSDefineAbstract extends Expression {
646
646
  getRunnable(): IStatementRunnable;
647
647
  }
648
648
 
649
+ declare class CDSDefineCustom extends Expression {
650
+ getRunnable(): IStatementRunnable;
651
+ }
652
+
649
653
  declare class CDSDefineProjection extends Expression {
650
654
  getRunnable(): IStatementRunnable;
651
655
  }
@@ -987,6 +991,15 @@ declare class Communication implements IStatement {
987
991
  getMatcher(): IStatementRunnable;
988
992
  }
989
993
 
994
+ declare class CommunicationScenario extends AbstractObject {
995
+ getType(): string;
996
+ getAllowedNaming(): {
997
+ maxLength: number;
998
+ allowNamespace: boolean;
999
+ };
1000
+ getDescription(): string | undefined;
1001
+ }
1002
+
990
1003
  declare class Compare extends Expression {
991
1004
  getRunnable(): IStatementRunnable;
992
1005
  }
@@ -2067,6 +2080,7 @@ declare namespace ExpressionsCDS {
2067
2080
  CDSComposition,
2068
2081
  CDSCondition,
2069
2082
  CDSDefineAbstract,
2083
+ CDSDefineCustom,
2070
2084
  CDSDefineProjection,
2071
2085
  CDSDefineView,
2072
2086
  CDSElement,
@@ -3859,12 +3873,12 @@ declare class MethodParameters extends Expression {
3859
3873
  }
3860
3874
 
3861
3875
  declare class MethodParameters_2 implements IMethodParameters {
3876
+ private preferred;
3877
+ private returning;
3862
3878
  private readonly importing;
3863
3879
  private readonly optional;
3864
3880
  private readonly exporting;
3865
3881
  private readonly changing;
3866
- private preferred;
3867
- private returning;
3868
3882
  private readonly exceptions;
3869
3883
  private readonly defaults;
3870
3884
  private readonly filename;
@@ -4070,6 +4084,7 @@ declare namespace Objects {
4070
4084
  ChangeDocument,
4071
4085
  ChapterOfBookStructure,
4072
4086
  CheckpointGroup,
4087
+ CommunicationScenario,
4073
4088
  ClassCategory,
4074
4089
  Class,
4075
4090
  Classification,
@@ -16,7 +16,8 @@ class MethodDef {
16
16
  const result = (0, combi_1.seq)("RESULT", expressions_1.MethodParamName);
17
17
  const link = (0, combi_1.seq)("LINK", expressions_1.MethodParamName);
18
18
  const full = (0, combi_1.seq)("FULL", expressions_1.MethodParamName);
19
- const behavior = (0, combi_1.altPrio)((0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, "FOR ACTION", expressions_1.TypeName, result), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, "FOR CREATE", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation)), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, "FOR DELETE", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, "FOR UPDATE", expressions_1.TypeName), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, "FOR READ", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation), (0, combi_1.optPrio)(full), result, (0, combi_1.optPrio)(link)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("DETERMINE ON MODIFY IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("DETERMINE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName));
19
+ const modify = (0, combi_1.alt)((0, combi_1.seq)("FOR ACTION", expressions_1.TypeName, 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));
20
+ const behavior = (0, combi_1.altPrio)((0, combi_1.seq)("VALIDATE ON SAVE IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName), (0, combi_1.seq)("MODIFY IMPORTING", expressions_1.MethodParamName, modify), (0, combi_1.seq)("READ IMPORTING", expressions_1.MethodParamName, "FOR READ", (0, combi_1.alt)(expressions_1.TypeName, expressions_1.EntityAssociation), (0, combi_1.optPrio)(full), result, (0, combi_1.optPrio)(link)), (0, combi_1.seq)("FEATURES IMPORTING", expressions_1.MethodParamName, "REQUEST", expressions_1.NamespaceSimpleName, "FOR", expressions_1.NamespaceSimpleName, result), (0, combi_1.seq)("DETERMINE", (0, combi_1.alt)("ON MODIFY", "ON SAVE"), "IMPORTING", expressions_1.MethodParamName, "FOR", expressions_1.TypeName));
20
21
  // todo, this is only from version something
21
22
  const amdp = (0, combi_1.seq)("AMDP OPTIONS CDS SESSION CLIENT CURRENT", (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefRaising));
22
23
  const ret = (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), expressions_1.EventHandler), parameters, testing, (0, combi_1.seq)("FOR", (0, combi_1.alt)(tableFunction, ddl, behavior)), amdp, "NOT AT END OF MODE", (0, combi_1.optPrio)(expressions_1.Redefinition)));
@@ -545,6 +545,22 @@ class BasicTypes {
545
545
  this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);
546
546
  }
547
547
  }
548
+ else if (chainText.includes("->")) {
549
+ const [varName, typeName] = chainText.split("->");
550
+ const varVar = this.scope.findVariable(varName);
551
+ const foo = varVar === null || varVar === void 0 ? void 0 : varVar.getType();
552
+ if (foo instanceof basic_1.ObjectReferenceType) {
553
+ const id = foo.getIdentifier();
554
+ if (id instanceof types_1.ClassDefinition) {
555
+ const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(id, typeName);
556
+ foundType = byName === null || byName === void 0 ? void 0 : byName.getType();
557
+ if (byName === undefined || foundType === undefined) {
558
+ return new Types.UnknownType(typeName + " not found in class or interface");
559
+ }
560
+ this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);
561
+ }
562
+ }
563
+ }
548
564
  else {
549
565
  const found = this.scope.findType(subs[0]);
550
566
  foundType = found === null || found === void 0 ? void 0 : found.getType();
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommitEntities = void 0;
4
+ const Expressions = require("../../2_statements/expressions");
5
+ const source_1 = require("../expressions/source");
6
+ const target_1 = require("../expressions/target");
7
+ const inline_data_1 = require("../expressions/inline_data");
8
+ const basic_1 = require("../../types/basic");
9
+ class CommitEntities {
10
+ runSyntax(node, scope, filename) {
11
+ for (const s of node.findDirectExpressions(Expressions.Source)) {
12
+ new source_1.Source().runSyntax(s, scope, filename);
13
+ }
14
+ for (const t of node.findDirectExpressions(Expressions.Target)) {
15
+ const inline = t === null || t === void 0 ? void 0 : t.findDirectExpression(Expressions.InlineData);
16
+ if (inline) {
17
+ new inline_data_1.InlineData().runSyntax(inline, scope, filename, new basic_1.VoidType("CommitEntities"));
18
+ }
19
+ else {
20
+ new target_1.Target().runSyntax(t, scope, filename);
21
+ }
22
+ }
23
+ }
24
+ }
25
+ exports.CommitEntities = CommitEntities;
26
+ //# sourceMappingURL=commit_entities.js.map
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ModifyEntities = void 0;
4
+ const Expressions = require("../../2_statements/expressions");
5
+ const source_1 = require("../expressions/source");
6
+ const target_1 = require("../expressions/target");
7
+ const inline_data_1 = require("../expressions/inline_data");
8
+ const basic_1 = require("../../types/basic");
9
+ class ModifyEntities {
10
+ runSyntax(node, scope, filename) {
11
+ for (const s of node.findDirectExpressions(Expressions.Source)) {
12
+ new source_1.Source().runSyntax(s, scope, filename);
13
+ }
14
+ for (const t of node.findDirectExpressions(Expressions.Target)) {
15
+ const inline = t === null || t === void 0 ? void 0 : t.findDirectExpression(Expressions.InlineData);
16
+ if (inline) {
17
+ new inline_data_1.InlineData().runSyntax(inline, scope, filename, new basic_1.VoidType("ModifyEntities"));
18
+ }
19
+ else {
20
+ new target_1.Target().runSyntax(t, scope, filename);
21
+ }
22
+ }
23
+ }
24
+ }
25
+ exports.ModifyEntities = ModifyEntities;
26
+ //# sourceMappingURL=modify_entities.js.map
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReadEntities = void 0;
4
+ const Expressions = require("../../2_statements/expressions");
5
+ const source_1 = require("../expressions/source");
6
+ const target_1 = require("../expressions/target");
7
+ const inline_data_1 = require("../expressions/inline_data");
8
+ const basic_1 = require("../../types/basic");
9
+ class ReadEntities {
10
+ runSyntax(node, scope, filename) {
11
+ for (const s of node.findDirectExpressions(Expressions.Source)) {
12
+ new source_1.Source().runSyntax(s, scope, filename);
13
+ }
14
+ for (const t of node.findDirectExpressions(Expressions.Target)) {
15
+ const inline = t === null || t === void 0 ? void 0 : t.findDirectExpression(Expressions.InlineData);
16
+ if (inline) {
17
+ new inline_data_1.InlineData().runSyntax(inline, scope, filename, new basic_1.VoidType("ReadEntities"));
18
+ }
19
+ else {
20
+ new target_1.Target().runSyntax(t, scope, filename);
21
+ }
22
+ }
23
+ }
24
+ }
25
+ exports.ReadEntities = ReadEntities;
26
+ //# sourceMappingURL=read_entities.js.map
@@ -132,6 +132,9 @@ const insert_textpool_1 = require("./statements/insert_textpool");
132
132
  const get_cursor_1 = require("./statements/get_cursor");
133
133
  const loop_at_screen_1 = require("./statements/loop_at_screen");
134
134
  const insert_field_group_1 = require("./statements/insert_field_group");
135
+ const read_entities_1 = require("./statements/read_entities");
136
+ const modify_entities_1 = require("./statements/modify_entities");
137
+ const commit_entities_1 = require("./statements/commit_entities");
135
138
  // -----------------------------------
136
139
  const map = {};
137
140
  function addToMap(handler) {
@@ -250,6 +253,9 @@ if (Object.keys(map).length === 0) {
250
253
  addToMap(new tables_1.Tables());
251
254
  addToMap(new parameter_1.Parameter());
252
255
  addToMap(new fieldsymbol_1.FieldSymbol());
256
+ addToMap(new read_entities_1.ReadEntities());
257
+ addToMap(new modify_entities_1.ModifyEntities());
258
+ addToMap(new commit_entities_1.CommitEntities());
253
259
  }
254
260
  // -----------------------------------
255
261
  class SyntaxLogic {
@@ -146,6 +146,11 @@ class MethodParameters {
146
146
  }
147
147
  }
148
148
  }
149
+ // RAP parameters, temporary fix
150
+ const rapName = node.findExpressionAfterToken("IMPORTING");
151
+ if (rapName) {
152
+ this.importing.push(new _typed_identifier_1.TypedIdentifier(rapName.getFirstToken(), filename, new basic_1.VoidType("RapMethodParameter"), ["importing" /* IdentifierMeta.MethodImporting */]));
153
+ }
149
154
  const exporting = node.findFirstExpression(Expressions.MethodDefExporting);
150
155
  if (exporting) {
151
156
  this.add(this.exporting, exporting, scope, ["exporting" /* IdentifierMeta.MethodExporting */]);
@@ -26,6 +26,9 @@ class CDSParser {
26
26
  if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
27
27
  res = combi_1.Combi.run(new Expressions.CDSAnnotate(), tokens, version_1.defaultVersion);
28
28
  }
29
+ if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
30
+ res = combi_1.Combi.run(new Expressions.CDSDefineCustom(), tokens, version_1.defaultVersion);
31
+ }
29
32
  if (res === undefined || !(res[0] instanceof nodes_1.ExpressionNode)) {
30
33
  return undefined;
31
34
  }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSDefineCustom = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ const cds_name_1 = require("./cds_name");
7
+ const cds_type_1 = require("./cds_type");
8
+ class CDSDefineCustom extends combi_1.Expression {
9
+ getRunnable() {
10
+ const field = (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.opt)((0, combi_1.str)("KEY")), cds_name_1.CDSName, ":", cds_type_1.CDSType, ";");
11
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), (0, combi_1.str)("DEFINE ROOT CUSTOM ENTITY"), cds_name_1.CDSName, (0, combi_1.str)("{"), (0, combi_1.plus)(field), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
12
+ }
13
+ }
14
+ exports.CDSDefineCustom = CDSDefineCustom;
15
+ //# sourceMappingURL=cds_define_custom.js.map
@@ -6,7 +6,7 @@ const __1 = require("../..");
6
6
  const combi_1 = require("../../abap/2_statements/combi");
7
7
  class CDSDefineProjection extends combi_1.Expression {
8
8
  getRunnable() {
9
- return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.opt)("ROOT"), "VIEW", (0, combi_1.ver)(__1.Version.v755, (0, combi_1.opt)("ENTITY")), _1.CDSName, "PROVIDER CONTRACT", _1.CDSName, "AS PROJECTION ON", _1.CDSName, (0, combi_1.str)("{"), (0, combi_1.plus)(_1.CDSElement), (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
9
+ return (0, combi_1.seq)((0, combi_1.star)(_1.CDSAnnotation), "DEFINE", (0, combi_1.opt)("ROOT"), "VIEW", (0, combi_1.ver)(__1.Version.v755, (0, combi_1.opt)("ENTITY")), _1.CDSName, (0, combi_1.opt)((0, combi_1.seq)("PROVIDER CONTRACT", _1.CDSName)), "AS PROJECTION ON", _1.CDSName, (0, combi_1.str)("{"), (0, combi_1.plus)(_1.CDSElement), (0, combi_1.star)((0, combi_1.seq)(",", _1.CDSElement)), (0, combi_1.str)("}"), (0, combi_1.opt)(";"));
10
10
  }
11
11
  }
12
12
  exports.CDSDefineProjection = CDSDefineProjection;
@@ -4,7 +4,8 @@ exports.CDSName = void 0;
4
4
  const combi_1 = require("../../abap/2_statements/combi");
5
5
  class CDSName extends combi_1.Expression {
6
6
  getRunnable() {
7
- return (0, combi_1.seq)((0, combi_1.opt)(":"), (0, combi_1.regex)(/^\$?#?[\w_]+$/));
7
+ const pre = (0, combi_1.seq)("/", (0, combi_1.regex)(/^[\w_]+$/), "/");
8
+ return (0, combi_1.seq)((0, combi_1.opt)(":"), (0, combi_1.opt)(pre), (0, combi_1.regex)(/^\$?#?[\w_]+$/));
8
9
  }
9
10
  }
10
11
  exports.CDSName = CDSName;
@@ -5,7 +5,8 @@ const _1 = require(".");
5
5
  const combi_1 = require("../../abap/2_statements/combi");
6
6
  class CDSRelation extends combi_1.Expression {
7
7
  getRunnable() {
8
- return (0, combi_1.seq)((0, combi_1.regex)(/^[\w_]+$/), (0, combi_1.opt)(_1.CDSAs));
8
+ const pre = (0, combi_1.seq)("/", (0, combi_1.regex)(/^[\w_]+$/), "/");
9
+ return (0, combi_1.seq)((0, combi_1.opt)(pre), (0, combi_1.regex)(/^[\w_]+$/), (0, combi_1.opt)(_1.CDSAs));
9
10
  }
10
11
  }
11
12
  exports.CDSRelation = CDSRelation;
@@ -5,7 +5,8 @@ const _1 = require(".");
5
5
  const combi_1 = require("../../abap/2_statements/combi");
6
6
  class CDSSource extends combi_1.Expression {
7
7
  getRunnable() {
8
- return (0, combi_1.seq)((0, combi_1.regex)(/^[\w_]+$/), (0, combi_1.opt)(_1.CDSAs));
8
+ const pre = (0, combi_1.seq)("/", (0, combi_1.regex)(/^[\w_]+$/), "/");
9
+ return (0, combi_1.seq)((0, combi_1.opt)(pre), (0, combi_1.regex)(/^[\w_]+$/), (0, combi_1.opt)(_1.CDSAs));
9
10
  }
10
11
  }
11
12
  exports.CDSSource = CDSSource;
@@ -30,6 +30,7 @@ __exportStar(require("./cds_cast"), exports);
30
30
  __exportStar(require("./cds_composition"), exports);
31
31
  __exportStar(require("./cds_condition"), exports);
32
32
  __exportStar(require("./cds_define_abstract"), exports);
33
+ __exportStar(require("./cds_define_custom"), exports);
33
34
  __exportStar(require("./cds_define_projection"), exports);
34
35
  __exportStar(require("./cds_define_view"), exports);
35
36
  __exportStar(require("./cds_element"), exports);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommunicationScenario = void 0;
4
+ const _abstract_object_1 = require("./_abstract_object");
5
+ class CommunicationScenario extends _abstract_object_1.AbstractObject {
6
+ getType() {
7
+ return "SCO1";
8
+ }
9
+ getAllowedNaming() {
10
+ return {
11
+ maxLength: 30,
12
+ allowNamespace: true,
13
+ };
14
+ }
15
+ getDescription() {
16
+ // todo
17
+ return undefined;
18
+ }
19
+ }
20
+ exports.CommunicationScenario = CommunicationScenario;
21
+ //# sourceMappingURL=communication_scenario.js.map
@@ -34,6 +34,7 @@ __exportStar(require("./cds_metadata_extension"), exports);
34
34
  __exportStar(require("./change_document"), exports);
35
35
  __exportStar(require("./chapter_of_book_structure"), exports);
36
36
  __exportStar(require("./checkpoint_group"), exports);
37
+ __exportStar(require("./communication_scenario"), exports);
37
38
  __exportStar(require("./class"), exports);
38
39
  __exportStar(require("./classification"), exports);
39
40
  __exportStar(require("./composite_enhancement_implementation"), exports);
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.93.60";
66
+ return "2.93.62";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
@@ -50,12 +50,14 @@ class CloudTypes {
50
50
  || obj instanceof Objects.FunctionGroup
51
51
  || obj instanceof Objects.HttpService
52
52
  || obj instanceof Objects.IAMApp
53
+ || obj instanceof Objects.CommunicationScenario
53
54
  || obj instanceof Objects.InboundService
54
55
  || obj instanceof Objects.Interface
55
56
  || obj instanceof Objects.LockObject
56
57
  || obj instanceof Objects.MessageClass
57
58
  || obj instanceof Objects.Package
58
59
  || obj instanceof Objects.ServiceBinding
60
+ || obj instanceof Objects.ServiceDefinition
59
61
  || obj instanceof Objects.Table
60
62
  || obj instanceof Objects.TableType
61
63
  || obj instanceof Objects.Transformation) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.93.60",
3
+ "version": "2.93.62",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -49,7 +49,7 @@
49
49
  "@microsoft/api-extractor": "^7.33.5",
50
50
  "@types/chai": "^4.3.3",
51
51
  "@types/mocha": "^10.0.0",
52
- "@types/node": "^18.11.8",
52
+ "@types/node": "^18.11.9",
53
53
  "chai": "^4.3.6",
54
54
  "eslint": "^8.26.0",
55
55
  "mocha": "^10.1.0",