@abaplint/core 2.93.61 → 2.93.63

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
  }
@@ -692,6 +696,10 @@ declare class CDSParameters extends Expression {
692
696
  getRunnable(): IStatementRunnable;
693
697
  }
694
698
 
699
+ declare class CDSParametersSelect extends Expression {
700
+ getRunnable(): IStatementRunnable;
701
+ }
702
+
695
703
  export declare class CDSParser {
696
704
  parse(file: IFile | undefined): ExpressionNode | undefined;
697
705
  }
@@ -2076,6 +2084,7 @@ declare namespace ExpressionsCDS {
2076
2084
  CDSComposition,
2077
2085
  CDSCondition,
2078
2086
  CDSDefineAbstract,
2087
+ CDSDefineCustom,
2079
2088
  CDSDefineProjection,
2080
2089
  CDSDefineView,
2081
2090
  CDSElement,
@@ -2083,6 +2092,7 @@ declare namespace ExpressionsCDS {
2083
2092
  CDSGroupBy,
2084
2093
  CDSJoin,
2085
2094
  CDSName,
2095
+ CDSParametersSelect,
2086
2096
  CDSParameters,
2087
2097
  CDSRelation,
2088
2098
  CDSSelect,
@@ -3868,12 +3878,12 @@ declare class MethodParameters extends Expression {
3868
3878
  }
3869
3879
 
3870
3880
  declare class MethodParameters_2 implements IMethodParameters {
3881
+ private preferred;
3882
+ private returning;
3871
3883
  private readonly importing;
3872
3884
  private readonly optional;
3873
3885
  private readonly exporting;
3874
3886
  private readonly changing;
3875
- private preferred;
3876
- private returning;
3877
3887
  private readonly exceptions;
3878
3888
  private readonly defaults;
3879
3889
  private readonly filename;
@@ -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,28 @@ 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
+ const type = id instanceof types_1.ClassDefinition ? "CLAS" : "INTF";
555
+ this.scope.addReference(expr.getFirstToken(), id, _reference_1.ReferenceType.ObjectOrientedReference, this.filename, { ooType: type, ooName: id.getName() });
556
+ if (id instanceof types_1.ClassDefinition) {
557
+ const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(id, typeName);
558
+ foundType = byName === null || byName === void 0 ? void 0 : byName.getType();
559
+ if (byName === undefined || foundType === undefined) {
560
+ return new Types.UnknownType(typeName + " not found in class or interface");
561
+ }
562
+ this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);
563
+ }
564
+ }
565
+ // todo, ugh, hmm
566
+ while (subs.length > 0) {
567
+ subs.shift();
568
+ }
569
+ }
548
570
  else {
549
571
  const found = this.scope.findType(subs[0]);
550
572
  foundType = found === null || found === void 0 ? void 0 : found.getType();
@@ -40,6 +40,7 @@ class Loop {
40
40
  throw new Error("Loop, no header line");
41
41
  }
42
42
  else if (!(sourceType instanceof basic_1.TableType)
43
+ && !(sourceType instanceof basic_1.AnyType)
43
44
  && !(sourceType instanceof basic_1.VoidType)
44
45
  && concat.startsWith("LOOP AT GROUP ") === false) {
45
46
  throw new Error("Loop, not a table type");
@@ -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
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CDSParametersSelect = void 0;
4
+ const _1 = require(".");
5
+ const combi_1 = require("../../abap/2_statements/combi");
6
+ class CDSParametersSelect extends combi_1.Expression {
7
+ getRunnable() {
8
+ const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.opt)((0, combi_1.seq)(".", _1.CDSName)));
9
+ const value = (0, combi_1.alt)(name, _1.CDSString);
10
+ const nameValue = (0, combi_1.seq)(name, ":", value);
11
+ return (0, combi_1.seq)("(", nameValue, (0, combi_1.star)((0, combi_1.seq)(",", nameValue)), ")");
12
+ }
13
+ }
14
+ exports.CDSParametersSelect = CDSParametersSelect;
15
+ //# sourceMappingURL=cds_parameters_select.js.map
@@ -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;
@@ -4,11 +4,10 @@ exports.CDSSelect = void 0;
4
4
  const _1 = require(".");
5
5
  const combi_1 = require("../../abap/2_statements/combi");
6
6
  const cds_association_1 = require("./cds_association");
7
- const cds_element_1 = require("./cds_element");
8
7
  const cds_join_1 = require("./cds_join");
9
8
  class CDSSelect extends combi_1.Expression {
10
9
  getRunnable() {
11
- return (0, combi_1.seq)("SELECT", (0, combi_1.opt)("DISTINCT"), "FROM", _1.CDSSource, (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.str)("{"), (0, combi_1.plus)(cds_element_1.CDSElement), (0, combi_1.star)((0, combi_1.seq)(",", cds_element_1.CDSElement)), (0, combi_1.str)("}"), (0, combi_1.opt)(_1.CDSGroupBy), (0, combi_1.opt)(_1.CDSWhere), (0, combi_1.opt)((0, combi_1.seq)("UNION", (0, combi_1.opt)("ALL"), CDSSelect)));
10
+ return (0, combi_1.seq)("SELECT", (0, combi_1.opt)("DISTINCT"), "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.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)(_1.CDSGroupBy), (0, combi_1.opt)(_1.CDSWhere), (0, combi_1.opt)((0, combi_1.seq)("UNION", (0, combi_1.opt)("ALL"), CDSSelect)));
12
11
  }
13
12
  }
14
13
  exports.CDSSelect = CDSSelect;
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./cds_aggregate"), exports);
18
- __exportStar(require("./cds_aggregate"), exports);
19
18
  __exportStar(require("./cds_annotate"), exports);
20
19
  __exportStar(require("./cds_annotation_array"), exports);
21
20
  __exportStar(require("./cds_annotation_object"), exports);
@@ -30,6 +29,7 @@ __exportStar(require("./cds_cast"), exports);
30
29
  __exportStar(require("./cds_composition"), exports);
31
30
  __exportStar(require("./cds_condition"), exports);
32
31
  __exportStar(require("./cds_define_abstract"), exports);
32
+ __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);
@@ -37,6 +37,7 @@ __exportStar(require("./cds_function"), exports);
37
37
  __exportStar(require("./cds_group_by"), exports);
38
38
  __exportStar(require("./cds_join"), exports);
39
39
  __exportStar(require("./cds_name"), exports);
40
+ __exportStar(require("./cds_parameters_select"), exports);
40
41
  __exportStar(require("./cds_parameters"), exports);
41
42
  __exportStar(require("./cds_relation"), exports);
42
43
  __exportStar(require("./cds_select"), 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.61";
66
+ return "2.93.63";
67
67
  }
68
68
  getDDICReferences() {
69
69
  return this.references;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.93.61",
3
+ "version": "2.93.63",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",