@abaplint/core 2.93.62 → 2.93.64

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.
@@ -696,6 +696,10 @@ declare class CDSParameters extends Expression {
696
696
  getRunnable(): IStatementRunnable;
697
697
  }
698
698
 
699
+ declare class CDSParametersSelect extends Expression {
700
+ getRunnable(): IStatementRunnable;
701
+ }
702
+
699
703
  export declare class CDSParser {
700
704
  parse(file: IFile | undefined): ExpressionNode | undefined;
701
705
  }
@@ -2088,6 +2092,7 @@ declare namespace ExpressionsCDS {
2088
2092
  CDSGroupBy,
2089
2093
  CDSJoin,
2090
2094
  CDSName,
2095
+ CDSParametersSelect,
2091
2096
  CDSParameters,
2092
2097
  CDSRelation,
2093
2098
  CDSSelect,
@@ -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 (0, combi_1.verNot)(version_1.Version.Cloud, ret);
9
+ return ret;
11
10
  }
12
11
  }
13
12
  exports.Include = Include;
@@ -551,6 +551,8 @@ class BasicTypes {
551
551
  const foo = varVar === null || varVar === void 0 ? void 0 : varVar.getType();
552
552
  if (foo instanceof basic_1.ObjectReferenceType) {
553
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() });
554
556
  if (id instanceof types_1.ClassDefinition) {
555
557
  const byName = new _object_oriented_1.ObjectOriented(this.scope).searchTypeName(id, typeName);
556
558
  foundType = byName === null || byName === void 0 ? void 0 : byName.getType();
@@ -560,6 +562,10 @@ class BasicTypes {
560
562
  this.scope.addReference(expr.getTokens()[2], byName, _reference_1.ReferenceType.TypeReference, this.filename);
561
563
  }
562
564
  }
565
+ // todo, ugh, hmm
566
+ while (subs.length > 0) {
567
+ subs.shift();
568
+ }
563
569
  }
564
570
  else {
565
571
  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();
@@ -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");
@@ -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
- const rapName = node.findExpressionAfterToken("IMPORTING");
151
+ let rapName = node.findExpressionAfterToken("IMPORTING");
151
152
  if (rapName) {
152
- this.importing.push(new _typed_identifier_1.TypedIdentifier(rapName.getFirstToken(), filename, new basic_1.VoidType("RapMethodParameter"), ["importing" /* IdentifierMeta.MethodImporting */]));
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, ":", value, (0, combi_1.star)((0, combi_1.seq)(",", namedot, ":", value)), "}");
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
  }
@@ -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
@@ -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);
@@ -38,6 +37,7 @@ __exportStar(require("./cds_function"), exports);
38
37
  __exportStar(require("./cds_group_by"), exports);
39
38
  __exportStar(require("./cds_join"), exports);
40
39
  __exportStar(require("./cds_name"), exports);
40
+ __exportStar(require("./cds_parameters_select"), exports);
41
41
  __exportStar(require("./cds_parameters"), exports);
42
42
  __exportStar(require("./cds_relation"), exports);
43
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.62";
66
+ return "2.93.64";
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.62",
3
+ "version": "2.93.64",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",