@abaplint/core 2.93.64 → 2.93.66

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.
@@ -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 [varName, typeName] = chainText.split("->");
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]);
@@ -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
- 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+/), ")")));
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;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DataDefinition = void 0;
4
+ const nodes_1 = require("../abap/nodes");
4
5
  const cds_determine_types_1 = require("../cds/cds_determine_types");
5
6
  const cds_parser_1 = require("../cds/cds_parser");
6
7
  const expressions_1 = require("../cds/expressions");
@@ -75,7 +76,15 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
75
76
  this.findSQLViewName();
76
77
  this.parsedData.tree = new cds_parser_1.CDSParser().parse(this.findSourceFile());
77
78
  if (this.parsedData.tree) {
78
- this.parsedData.definitionName = (_b = (_a = this.parsedData.tree) === null || _a === void 0 ? void 0 : _a.findFirstExpression(expressions_1.CDSName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();
79
+ for (const c of ((_a = this.parsedData.tree) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {
80
+ if (c.get() instanceof expressions_1.CDSAnnotation) {
81
+ continue;
82
+ }
83
+ if (c instanceof nodes_1.ExpressionNode) {
84
+ this.parsedData.definitionName = (_b = c.findFirstExpression(expressions_1.CDSName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();
85
+ break;
86
+ }
87
+ }
79
88
  this.findSourcesAndRelations(this.parsedData.tree);
80
89
  this.findFieldNames(this.parsedData.tree);
81
90
  }
@@ -63,7 +63,7 @@ class Registry {
63
63
  }
64
64
  static abaplintVersion() {
65
65
  // magic, see build script "version.sh"
66
- return "2.93.64";
66
+ return "2.93.66";
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.64",
3
+ "version": "2.93.66",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",