@abaplint/cli 2.119.37 → 2.119.38

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.
Files changed (2) hide show
  1. package/build/cli.js +49 -13
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -26933,16 +26933,16 @@ class BasicTypes {
26933
26933
  options.primaryKey.type = basic_1.TableAccessType.standard;
26934
26934
  return new Types.TableType(structure, options);
26935
26935
  }
26936
- else if (typename && (text.startsWith("TYPE TABLE FOR CREATE ")
26937
- || text.startsWith("TYPE TABLE FOR READ ")
26938
- || text.startsWith("TYPE TABLE FOR DELETE ")
26939
- || text.startsWith("TYPE TABLE FOR UPDATE "))) {
26936
+ else if (typename && this.isRAPTableFor(text)) {
26940
26937
  const name = typename.concatTokens();
26941
26938
  const ddlsName = this.getRAPBaseEntityName(name);
26942
26939
  const type = (_d = this.input.scope.getDDIC().lookupDDLS(ddlsName)) === null || _d === void 0 ? void 0 : _d.type;
26943
26940
  if (type) {
26944
26941
  return new Types.TableType(basic_1.VoidType.get("RAP-TODO"), options);
26945
26942
  }
26943
+ else if (this.isRAPDerivedEntityName(name)) {
26944
+ return Types.VoidType.get(name);
26945
+ }
26946
26946
  else if (this.input.scope.getDDIC().inErrorNamespace(ddlsName)) {
26947
26947
  return new Types.UnknownType(`DDLS ${ddlsName} not found`);
26948
26948
  }
@@ -26954,7 +26954,7 @@ class BasicTypes {
26954
26954
  return this.parseType(node, name);
26955
26955
  }
26956
26956
  parseType(node, qualifiedName) {
26957
- var _a, _b, _c, _d, _e, _f, _g, _h;
26957
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
26958
26958
  const typeName = node.findFirstExpression(Expressions.TypeName);
26959
26959
  let text = (_a = node.findFirstExpression(Expressions.Type)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
26960
26960
  if (text === undefined) {
@@ -26967,7 +26967,10 @@ class BasicTypes {
26967
26967
  }
26968
26968
  }
26969
26969
  if (text === undefined) {
26970
- text = (_d = node.findFirstExpression(Expressions.FormParamType)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();
26970
+ text = (_d = node.findFirstExpression(Expressions.TypeStructure)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();
26971
+ }
26972
+ if (text === undefined) {
26973
+ text = (_e = node.findFirstExpression(Expressions.FormParamType)) === null || _e === void 0 ? void 0 : _e.concatTokens().toUpperCase();
26971
26974
  }
26972
26975
  if (text === undefined
26973
26976
  && node.get() instanceof Statements.Parameter
@@ -26978,8 +26981,11 @@ class BasicTypes {
26978
26981
  text = "TYPE";
26979
26982
  }
26980
26983
  let found = undefined;
26981
- if (text.startsWith("LIKE LINE OF ")) {
26982
- const name = (_e = node.findFirstExpression(Expressions.FieldChain)) === null || _e === void 0 ? void 0 : _e.concatTokens();
26984
+ if (this.isRAPTypeStructure(text)) {
26985
+ return Types.VoidType.get((_f = node.findFirstExpression(Expressions.TypeStructure)) === null || _f === void 0 ? void 0 : _f.concatTokens());
26986
+ }
26987
+ else if (text.startsWith("LIKE LINE OF ")) {
26988
+ const name = (_g = node.findFirstExpression(Expressions.FieldChain)) === null || _g === void 0 ? void 0 : _g.concatTokens();
26983
26989
  let e = node.findFirstExpression(Expressions.Type);
26984
26990
  if (e === undefined) {
26985
26991
  e = node.findFirstExpression(Expressions.FormParamType);
@@ -27002,7 +27008,7 @@ class BasicTypes {
27002
27008
  }
27003
27009
  }
27004
27010
  else if (text.startsWith("LIKE REF TO ")) {
27005
- const name = (_f = node.findFirstExpression(Expressions.FieldChain)) === null || _f === void 0 ? void 0 : _f.concatTokens();
27011
+ const name = (_h = node.findFirstExpression(Expressions.FieldChain)) === null || _h === void 0 ? void 0 : _h.concatTokens();
27006
27012
  const type = this.resolveLikeName(node.findFirstExpression(Expressions.Type), false);
27007
27013
  if (type === undefined) {
27008
27014
  return new Types.UnknownType("Type error, could not resolve \"" + name + "\", parseType");
@@ -27093,7 +27099,7 @@ class BasicTypes {
27093
27099
  }
27094
27100
  }
27095
27101
  if (text.includes(" WITH INDICATORS ")) {
27096
- const componentName = (_h = (_g = node.findFirstExpression(Expressions.Type)) === null || _g === void 0 ? void 0 : _g.findDirectExpression(Expressions.ComponentName)) === null || _h === void 0 ? void 0 : _h.concatTokens().toUpperCase();
27102
+ const componentName = (_k = (_j = node.findFirstExpression(Expressions.Type)) === null || _j === void 0 ? void 0 : _j.findDirectExpression(Expressions.ComponentName)) === null || _k === void 0 ? void 0 : _k.concatTokens().toUpperCase();
27097
27103
  if (componentName === undefined) {
27098
27104
  throw new Error("parseType, componentName expected");
27099
27105
  }
@@ -27119,12 +27125,38 @@ class BasicTypes {
27119
27125
  getRAPBaseEntityName(name) {
27120
27126
  const association = name.indexOf("\\_");
27121
27127
  const path = name.indexOf("\\\\");
27122
- if (association === -1 && path === -1) {
27128
+ const action = name.indexOf("~");
27129
+ if (association === -1 && path === -1 && action === -1) {
27123
27130
  return name;
27124
27131
  }
27125
- const splitAt = association === -1 ? path : path === -1 ? association : Math.min(association, path);
27132
+ const candidates = [association, path, action].filter(i => i !== -1);
27133
+ const splitAt = Math.min(...candidates);
27126
27134
  return name.substring(0, splitAt);
27127
27135
  }
27136
+ isRAPDerivedEntityName(name) {
27137
+ return name.includes("\\") || name.includes("~");
27138
+ }
27139
+ isRAPTableFor(text) {
27140
+ return text.startsWith("TYPE TABLE FOR ACTION IMPORT ")
27141
+ || text.startsWith("TYPE TABLE FOR ACTION RESULT ")
27142
+ || text.startsWith("TYPE TABLE FOR CREATE ")
27143
+ || text.startsWith("TYPE TABLE FOR DELETE ")
27144
+ || text.startsWith("TYPE TABLE FOR DETERMINATION ")
27145
+ || text.startsWith("TYPE TABLE FOR EVENT ")
27146
+ || text.startsWith("TYPE TABLE FOR FAILED ")
27147
+ || text.startsWith("TYPE TABLE FOR FAILED EARLY ")
27148
+ || text.startsWith("TYPE TABLE FOR LOCK ")
27149
+ || text.startsWith("TYPE TABLE FOR READ ")
27150
+ || text.startsWith("TYPE TABLE FOR READ IMPORT ")
27151
+ || text.startsWith("TYPE TABLE FOR READ RESULT ")
27152
+ || text.startsWith("TYPE TABLE FOR REPORTED EARLY ")
27153
+ || text.startsWith("TYPE TABLE FOR UPDATE ");
27154
+ }
27155
+ isRAPTypeStructure(text) {
27156
+ return text.startsWith("TYPE STRUCTURE FOR ")
27157
+ || text.startsWith("TYPE RESPONSE FOR ")
27158
+ || text.startsWith("TYPE REQUEST FOR CHANGE ");
27159
+ }
27128
27160
  // todo, rewrite this method
27129
27161
  resolveTypeChain(expr) {
27130
27162
  var _a, _b, _c, _d;
@@ -45846,6 +45878,10 @@ class SyntaxLogic {
45846
45878
  this.scope.addList(values);
45847
45879
  return true;
45848
45880
  }
45881
+ else if (stru instanceof Structures.TestInjection) {
45882
+ // todo: skipped for now
45883
+ return true;
45884
+ }
45849
45885
  return false;
45850
45886
  }
45851
45887
  updateScopeStatement(node) {
@@ -66531,7 +66567,7 @@ class Registry {
66531
66567
  }
66532
66568
  static abaplintVersion() {
66533
66569
  // magic, see build script "version.js"
66534
- return "2.119.37";
66570
+ return "2.119.38";
66535
66571
  }
66536
66572
  getDDICReferences() {
66537
66573
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.119.37",
3
+ "version": "2.119.38",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.119.37",
41
+ "@abaplint/core": "^2.119.38",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",