@abaplint/core 2.105.20 → 2.105.22

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.
@@ -26,6 +26,7 @@ class TypeUtils {
26
26
  }
27
27
  else if (type instanceof basic_1.StringType
28
28
  || type instanceof basic_1.AnyType
29
+ || type instanceof basic_1.DataType
29
30
  || type instanceof basic_1.CharacterType
30
31
  || type instanceof basic_1.SimpleType
31
32
  || type instanceof cgeneric_type_1.CGenericType
@@ -109,7 +109,7 @@ class NewObject {
109
109
  new method_parameters_1.MethodParameters().checkExporting(parameters, scope, method, filename);
110
110
  }
111
111
  else if (requiredParameters.length > 0) {
112
- throw new Error(`constructor parameter "${requiredParameters[0].getName()}" must be supplied` + name);
112
+ throw new Error(`constructor parameter "${requiredParameters[0].getName()}" must be supplied, ` + name);
113
113
  }
114
114
  }
115
115
  defaultImportingType(method) {
@@ -49,6 +49,7 @@ class CreateObject {
49
49
  }
50
50
  else if (!(found instanceof basic_1.ObjectReferenceType)
51
51
  && !(found instanceof basic_1.AnyType)
52
+ && !(found instanceof basic_1.DataType)
52
53
  && !(found instanceof basic_1.GenericObjectReferenceType)) {
53
54
  throw new Error("Target must be an object reference, " + t.concatTokens());
54
55
  }
@@ -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.20";
68
+ return "2.105.22";
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();
@@ -126,6 +126,11 @@ class KeepSingleParameterCallsOnOneLine extends _abap_rule_1.ABAPRule {
126
126
  }
127
127
  isSingleParameter(c) {
128
128
  if (c.findDirectExpression(Expressions.Source)) {
129
+ for (const params of c.findAllExpressions(Expressions.ParameterListS)) {
130
+ if (params.getChildren().length > 1) {
131
+ return false;
132
+ }
133
+ }
129
134
  return true;
130
135
  }
131
136
  const list = c.findDirectExpression(Expressions.ParameterListS);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.105.20",
3
+ "version": "2.105.22",
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.3",
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
  }