@abaplint/cli 2.101.3 → 2.101.4

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 +31 -26
  2. package/package.json +3 -3
package/build/cli.js CHANGED
@@ -29809,45 +29809,50 @@ const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@a
29809
29809
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
29810
29810
  const message_source_1 = __webpack_require__(/*! ../expressions/message_source */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/message_source.js");
29811
29811
  const raise_with_1 = __webpack_require__(/*! ../expressions/raise_with */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/raise_with.js");
29812
+ const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
29813
+ const method_parameters_1 = __webpack_require__(/*! ../expressions/method_parameters */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_parameters.js");
29812
29814
  class Raise {
29813
29815
  runSyntax(node, scope, filename) {
29814
29816
  // todo
29815
- var _a, _b, _c;
29817
+ var _a, _b, _c, _d, _e;
29818
+ const helper = new _object_oriented_1.ObjectOriented(scope);
29819
+ let method;
29816
29820
  const classTok = (_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
29817
- const classNam = classTok === null || classTok === void 0 ? void 0 : classTok.getStr();
29818
- if (classNam) {
29819
- const found = scope.existsObject(classNam);
29821
+ const className = classTok === null || classTok === void 0 ? void 0 : classTok.getStr();
29822
+ if (className) {
29823
+ const found = scope.existsObject(className);
29820
29824
  if (found.found === true && found.id) {
29821
29825
  scope.addReference(classTok, found.id, found.type, filename);
29826
+ const def = scope.findObjectDefinition(className);
29827
+ method = (_b = helper.searchMethodName(def, "CONSTRUCTOR")) === null || _b === void 0 ? void 0 : _b.method;
29822
29828
  }
29823
- else if (scope.getDDIC().inErrorNamespace(classNam) === false) {
29824
- const extra = { ooName: classNam, ooType: "Void" };
29829
+ else if (scope.getDDIC().inErrorNamespace(className) === false) {
29830
+ const extra = { ooName: className, ooType: "Void" };
29825
29831
  scope.addReference(classTok, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, filename, extra);
29832
+ method = new basic_1.VoidType(className);
29826
29833
  }
29827
29834
  else {
29828
- throw new Error("RAISE, unknown class " + classNam);
29835
+ throw new Error("RAISE, unknown class " + className);
29829
29836
  }
29830
29837
  }
29831
- let prev = "";
29832
- for (const c of node.getChildren()) {
29833
- if (c instanceof nodes_1.ExpressionNode
29834
- && (c.get() instanceof Expressions.SimpleSource2 || c.get() instanceof Expressions.Source)) {
29835
- const type = new source_1.Source().runSyntax(c, scope, filename);
29836
- if (prev === "EXCEPTION"
29837
- && type
29838
- && !(type instanceof basic_1.VoidType)
29839
- && !(type instanceof basic_1.ObjectReferenceType)) {
29840
- throw new Error("RAISE EXCEPTION, must be object reference, got " + type.constructor.name);
29841
- }
29838
+ const c = node.findExpressionAfterToken("EXCEPTION");
29839
+ if (c instanceof nodes_1.ExpressionNode && (c.get() instanceof Expressions.SimpleSource2 || c.get() instanceof Expressions.Source)) {
29840
+ const type = new source_1.Source().runSyntax(c, scope, filename);
29841
+ if (type instanceof basic_1.VoidType) {
29842
+ method = type;
29843
+ }
29844
+ else if (type instanceof basic_1.ObjectReferenceType) {
29845
+ const def = scope.findObjectDefinition(type.getIdentifierName());
29846
+ method = (_c = helper.searchMethodName(def, "CONSTRUCTOR")) === null || _c === void 0 ? void 0 : _c.method;
29847
+ }
29848
+ else if (type !== undefined) {
29849
+ throw new Error("RAISE EXCEPTION, must be object reference, got " + type.constructor.name);
29842
29850
  }
29843
- prev = c.concatTokens().toUpperCase();
29844
29851
  }
29845
- // todo, check parameters vs constructor
29852
+ // check parameters vs constructor
29846
29853
  const param = node.findDirectExpression(Expressions.ParameterListS);
29847
29854
  if (param) {
29848
- for (const s of param.findAllExpressions(Expressions.Source)) {
29849
- new source_1.Source().runSyntax(s, scope, filename);
29850
- }
29855
+ new method_parameters_1.MethodParameters().checkExporting(param, scope, method, filename, true);
29851
29856
  }
29852
29857
  for (const s of node.findDirectExpressions(Expressions.RaiseWith)) {
29853
29858
  new raise_with_1.RaiseWith().runSyntax(s, scope, filename);
@@ -29861,8 +29866,8 @@ class Raise {
29861
29866
  for (const s of node.findDirectExpressions(Expressions.MessageSource)) {
29862
29867
  new message_source_1.MessageSource().runSyntax(s, scope, filename);
29863
29868
  }
29864
- const id = (_b = node.findExpressionAfterToken("ID")) === null || _b === void 0 ? void 0 : _b.concatTokens();
29865
- const number = (_c = node.findDirectExpression(Expressions.MessageNumber)) === null || _c === void 0 ? void 0 : _c.concatTokens();
29869
+ const id = (_d = node.findExpressionAfterToken("ID")) === null || _d === void 0 ? void 0 : _d.concatTokens();
29870
+ const number = (_e = node.findDirectExpression(Expressions.MessageNumber)) === null || _e === void 0 ? void 0 : _e.concatTokens();
29866
29871
  if ((id === null || id === void 0 ? void 0 : id.startsWith("'")) && number) {
29867
29872
  const messageClass = id.substring(1, id.length - 1).toUpperCase();
29868
29873
  scope.getMSAGReferences().addUsing(filename, node.getFirstToken(), messageClass, number);
@@ -48009,7 +48014,7 @@ class Registry {
48009
48014
  }
48010
48015
  static abaplintVersion() {
48011
48016
  // magic, see build script "version.sh"
48012
- return "2.101.3";
48017
+ return "2.101.4";
48013
48018
  }
48014
48019
  getDDICReferences() {
48015
48020
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.101.3",
3
+ "version": "2.101.4",
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.101.3",
41
+ "@abaplint/core": "^2.101.4",
42
42
  "@types/chai": "^4.3.5",
43
43
  "@types/glob": "^7.2.0",
44
44
  "@types/minimist": "^1.2.2",
@@ -55,7 +55,7 @@
55
55
  "mocha": "^10.2.0",
56
56
  "progress": "^2.0.3",
57
57
  "typescript": "^5.0.4",
58
- "webpack": "^5.83.1",
58
+ "webpack": "^5.84.0",
59
59
  "webpack-cli": "^5.1.1",
60
60
  "xml-js": "^1.6.11"
61
61
  },