@abaplint/core 2.105.21 → 2.105.23

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.
@@ -12,7 +12,11 @@ class GetReference {
12
12
  const type = new source_1.Source().runSyntax(s, scope, filename);
13
13
  const target = node.findDirectExpression(Expressions.Target);
14
14
  const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);
15
+ // todo: error if inline field symbol
15
16
  if (inline) {
17
+ if (type instanceof basic_1.AnyType) {
18
+ throw new Error("GET REFERENCE generic and inline declaration not possible");
19
+ }
16
20
  new inline_data_1.InlineData().runSyntax(inline, scope, filename, type ? new basic_1.DataReference(type) : undefined);
17
21
  }
18
22
  else if (target) {
@@ -11,7 +11,10 @@ const _reference_1 = require("../_reference");
11
11
  class Write {
12
12
  runSyntax(node, scope, filename) {
13
13
  // todo, more
14
- const second = node.getChildren()[1];
14
+ let second = node.getChildren()[1];
15
+ if (second.get() instanceof Expressions.WriteOffsetLength) {
16
+ second = node.getChildren()[2];
17
+ }
15
18
  for (const s of node.findAllExpressions(Expressions.Source)) {
16
19
  const type = new source_1.Source().runSyntax(s, scope, filename);
17
20
  if (s === second
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.105.21";
68
+ return "2.105.23";
69
69
  }
70
70
  getDDICReferences() {
71
71
  return this.ddicReferences;
@@ -1260,7 +1260,7 @@ ${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n`
1260
1260
  return undefined;
1261
1261
  }
1262
1262
  downportRefSimple(high, lowFile, highSyntax) {
1263
- var _a;
1263
+ var _a, _b;
1264
1264
  if (!(high.get() instanceof Statements.Move)
1265
1265
  || high.getChildren().length !== 4
1266
1266
  || high.getChildren()[2].getFirstToken().getStr().toUpperCase() !== "REF") {
@@ -1285,7 +1285,20 @@ ENDIF.
1285
1285
  GET REFERENCE OF <${uniqueName}> INTO ${target.concatTokens()}`;
1286
1286
  }
1287
1287
  else {
1288
- code = `GET REFERENCE OF ${sourceRef.concatTokens()} INTO ${target.concatTokens()}`;
1288
+ const concat = target.concatTokens();
1289
+ code = `GET REFERENCE OF ${sourceRef.concatTokens()} INTO ${concat}`;
1290
+ // workaround for handling generic ANY type,
1291
+ if (concat.toUpperCase().startsWith("DATA(")) {
1292
+ const spag = highSyntax.spaghetti.lookupPosition(high.getFirstToken().getStart(), lowFile.getFilename());
1293
+ if (spag !== undefined) {
1294
+ const found = spag.findVariable(sourceRef.concatTokens());
1295
+ const tt = found === null || found === void 0 ? void 0 : found.getType();
1296
+ if (tt instanceof basic_1.AnyType) {
1297
+ const tname = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();
1298
+ code = `DATA ${tname} TYPE REF TO data.\nGET REFERENCE OF ${sourceRef.concatTokens()} INTO ${tname}`;
1299
+ }
1300
+ }
1301
+ }
1289
1302
  }
1290
1303
  const start = high.getFirstToken().getStart();
1291
1304
  const end = high.getLastToken().getStart();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.105.21",
3
+ "version": "2.105.23",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -50,12 +50,12 @@
50
50
  },
51
51
  "homepage": "https://abaplint.org",
52
52
  "devDependencies": {
53
- "@microsoft/api-extractor": "^7.40.6",
54
- "@types/chai": "^4.3.11",
53
+ "@microsoft/api-extractor": "^7.41.0",
54
+ "@types/chai": "^4.3.12",
55
55
  "@types/mocha": "^10.0.6",
56
- "@types/node": "^20.11.19",
56
+ "@types/node": "^20.11.20",
57
57
  "chai": "^4.4.1",
58
- "eslint": "^8.56.0",
58
+ "eslint": "^8.57.0",
59
59
  "mocha": "^10.3.0",
60
60
  "c8": "^9.1.0",
61
61
  "source-map-support": "^0.5.21",
@@ -63,7 +63,7 @@
63
63
  "typescript": "^5.3.3"
64
64
  },
65
65
  "dependencies": {
66
- "fast-xml-parser": "^4.3.4",
66
+ "fast-xml-parser": "^4.3.5",
67
67
  "json5": "^2.2.3",
68
68
  "vscode-languageserver-types": "^3.17.5"
69
69
  }