@abaplint/cli 2.113.182 → 2.113.183

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 +64 -33
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -15999,7 +15999,7 @@ class Raise {
15999
15999
  const exporting = (0, combi_1.seq)("EXPORTING", expressions_1.ParameterListS);
16000
16000
  const from = (0, combi_1.seq)("TYPE", expressions_1.ClassName, (0, combi_1.opt)((0, combi_1.alt)((0, combi_1.ver)(version_1.Version.v750, (0, combi_1.alt)(mess, messid)), (0, combi_1.ver)(version_1.Version.v752, "USING MESSAGE"))), (0, combi_1.optPrio)(exporting));
16001
16001
  const pre = (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)("RESUMABLE"), "EXCEPTION"), "SHORTDUMP");
16002
- const clas = (0, combi_1.seq)(pre, (0, combi_1.altPrio)(from, (0, combi_1.ver)(version_1.Version.v752, expressions_1.Source), expressions_1.SimpleSource2));
16002
+ const clas = (0, combi_1.seq)(pre, (0, combi_1.altPrio)(from, (0, combi_1.ver)(version_1.Version.v752, expressions_1.Source, version_1.Version.OpenABAP), expressions_1.SimpleSource2));
16003
16003
  const ret = (0, combi_1.seq)("RAISE", (0, combi_1.altPrio)(clas, expressions_1.ExceptionName));
16004
16004
  return ret;
16005
16005
  }
@@ -32260,15 +32260,22 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modu
32260
32260
  const assert_error_1 = __webpack_require__(/*! ../assert_error */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/assert_error.js");
32261
32261
  class IncludeType {
32262
32262
  runSyntax(node, input) {
32263
- var _a, _b;
32263
+ var _a, _b, _c;
32264
32264
  const components = [];
32265
32265
  const iname = node.findFirstExpression(Expressions.TypeName);
32266
32266
  if (iname === undefined) {
32267
32267
  throw new assert_error_1.AssertError("IncludeType, unexpected node structure");
32268
32268
  }
32269
32269
  const name = iname.getFirstToken().getStr();
32270
+ const isStructure = node.findDirectTokenByText("STRUCTURE") !== undefined;
32270
32271
  let ityp = new basic_types_1.BasicTypes(input).parseType(iname);
32271
- const as = (_a = node.findExpressionAfterToken("AS")) === null || _a === void 0 ? void 0 : _a.concatTokens();
32272
+ if (ityp instanceof basic_1.VoidType && isStructure) {
32273
+ const found = (_a = input.scope.findVariable(name)) === null || _a === void 0 ? void 0 : _a.getType();
32274
+ if (found) {
32275
+ ityp = found;
32276
+ }
32277
+ }
32278
+ const as = (_b = node.findExpressionAfterToken("AS")) === null || _b === void 0 ? void 0 : _b.concatTokens();
32272
32279
  if (as && ityp instanceof basic_1.StructureType) {
32273
32280
  ityp = new basic_1.StructureType(ityp.getComponents().concat([{
32274
32281
  name: as,
@@ -32276,7 +32283,18 @@ class IncludeType {
32276
32283
  asInclude: true,
32277
32284
  }]));
32278
32285
  }
32279
- const suffix = (_b = node.findExpressionAfterToken("SUFFIX")) === null || _b === void 0 ? void 0 : _b.concatTokens();
32286
+ else if (ityp instanceof basic_1.TableType && isStructure) {
32287
+ ityp = ityp.getRowType();
32288
+ }
32289
+ else if (ityp instanceof basic_1.VoidType) {
32290
+ return ityp;
32291
+ }
32292
+ if (!(ityp instanceof basic_1.StructureType)) {
32293
+ const message = "not structured, " + name;
32294
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, iname.getFirstToken(), message));
32295
+ return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
32296
+ }
32297
+ const suffix = (_c = node.findExpressionAfterToken("SUFFIX")) === null || _c === void 0 ? void 0 : _c.concatTokens();
32280
32298
  if (suffix && ityp instanceof basic_1.StructureType) {
32281
32299
  const components = [];
32282
32300
  for (const c of ityp.getComponents()) {
@@ -35236,9 +35254,7 @@ exports.Constants = Constants;
35236
35254
 
35237
35255
  Object.defineProperty(exports, "__esModule", ({ value: true }));
35238
35256
  exports.Data = void 0;
35239
- const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
35240
35257
  const data_1 = __webpack_require__(/*! ../statements/data */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/data.js");
35241
- const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
35242
35258
  const nodes_1 = __webpack_require__(/*! ../../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
35243
35259
  const type_1 = __webpack_require__(/*! ../statements/type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/type.js");
35244
35260
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
@@ -35247,9 +35263,10 @@ const Basic = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abap
35247
35263
  const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
35248
35264
  const Statements = __webpack_require__(/*! ../../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
35249
35265
  const Structures = __webpack_require__(/*! ../../3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
35266
+ const include_type_1 = __webpack_require__(/*! ../statements/include_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/include_type.js");
35250
35267
  class Data {
35251
35268
  static runSyntax(node, input) {
35252
- var _a, _b;
35269
+ var _a;
35253
35270
  const fouth = (_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.getChildren()[3];
35254
35271
  const isCommonPart = fouth instanceof nodes_1.TokenNode && fouth.concatTokens() === "COMMON";
35255
35272
  if (isCommonPart) {
@@ -35284,25 +35301,47 @@ class Data {
35284
35301
  }
35285
35302
  else if (c instanceof nodes_1.StatementNode && ctyp instanceof Statements.IncludeType) {
35286
35303
  // INCLUDES
35287
- const typeToken = (_b = c.findFirstExpression(Expressions.TypeName)) === null || _b === void 0 ? void 0 : _b.getFirstToken();
35288
- const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();
35304
+ /*
35305
+ const typeToken = c.findFirstExpression(Expressions.TypeName)?.getFirstToken();
35306
+ const typeName = typeToken?.getStr();
35307
+
35289
35308
  let foundId = input.scope.findType(typeName);
35290
35309
  if (foundId === undefined) {
35291
- foundId = input.scope.findVariable(typeName);
35310
+ foundId = input.scope.findVariable(typeName);
35292
35311
  }
35293
- let found = foundId === null || foundId === void 0 ? void 0 : foundId.getType();
35312
+
35313
+ let found = foundId?.getType();
35294
35314
  if (found === undefined) {
35295
- const f = input.scope.getDDIC().lookupTableOrView(typeName).type;
35296
- if (f instanceof _typed_identifier_1.TypedIdentifier) {
35297
- found = f.getType();
35298
- }
35299
- else {
35300
- found = f;
35301
- }
35315
+ const f = input.scope.getDDIC().lookupTableOrView(typeName).type;
35316
+ if (f instanceof TypedIdentifier) {
35317
+ found = f.getType();
35318
+ } else {
35319
+ found = f;
35320
+ }
35321
+ } else {
35322
+ input.scope.addReference(typeToken, foundId, ReferenceType.TypeReference, input.filename);
35302
35323
  }
35303
- else {
35304
- input.scope.addReference(typeToken, foundId, _reference_1.ReferenceType.TypeReference, input.filename);
35324
+ if (found instanceof Basic.VoidType) {
35325
+ if (table === true) {
35326
+ const ttyp = new Basic.TableType(found, {withHeader: true, keyType: Basic.TableKeyType.default});
35327
+ return new TypedIdentifier(name, input.filename, ttyp);
35328
+ } else {
35329
+ return new TypedIdentifier(name, input.filename, found);
35330
+ }
35331
+ }
35332
+ if (found instanceof Basic.UnknownType) {
35333
+ return new TypedIdentifier(name, input.filename, new Basic.UnknownType("unknown type, " + typeName));
35334
+ }
35335
+ if (found instanceof Basic.TableType && found.isWithHeader()) {
35336
+ found = found.getRowType();
35337
+ }
35338
+ if (!(found instanceof Basic.StructureType)) {
35339
+ const message = "not structured, " + typeName;
35340
+ input.issues.push(syntaxIssue(input, typeToken!, message));
35341
+ return new TypedIdentifier(name, input.filename, Basic.VoidType.get(CheckSyntaxKey));
35305
35342
  }
35343
+ */
35344
+ const found = new include_type_1.IncludeType().runSyntax(c, input);
35306
35345
  if (found instanceof Basic.VoidType) {
35307
35346
  if (table === true) {
35308
35347
  const ttyp = new Basic.TableType(found, { withHeader: true, keyType: Basic.TableKeyType.default });
@@ -35312,18 +35351,7 @@ class Data {
35312
35351
  return new _typed_identifier_1.TypedIdentifier(name, input.filename, found);
35313
35352
  }
35314
35353
  }
35315
- if (found instanceof Basic.UnknownType) {
35316
- return new _typed_identifier_1.TypedIdentifier(name, input.filename, new Basic.UnknownType("unknown type, " + typeName));
35317
- }
35318
- if (found instanceof Basic.TableType && found.isWithHeader()) {
35319
- found = found.getRowType();
35320
- }
35321
- if (!(found instanceof Basic.StructureType)) {
35322
- const message = "not structured, " + typeName;
35323
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, typeToken, message));
35324
- return new _typed_identifier_1.TypedIdentifier(name, input.filename, Basic.VoidType.get(_syntax_input_1.CheckSyntaxKey));
35325
- }
35326
- for (const c of found.getComponents()) {
35354
+ for (const c of found) {
35327
35355
  components.push(c);
35328
35356
  }
35329
35357
  }
@@ -54898,7 +54926,7 @@ class Registry {
54898
54926
  }
54899
54927
  static abaplintVersion() {
54900
54928
  // magic, see build script "version.sh"
54901
- return "2.113.182";
54929
+ return "2.113.183";
54902
54930
  }
54903
54931
  getDDICReferences() {
54904
54932
  return this.ddicReferences;
@@ -62843,6 +62871,9 @@ ${indentation} output = ${uniqueName}.\n`;
62843
62871
  }
62844
62872
  replaceLineFunctions(node, lowFile, highSyntax, highFile) {
62845
62873
  var _a, _b;
62874
+ if (this.lowReg.getConfig().getVersion() === version_1.Version.OpenABAP) {
62875
+ return undefined;
62876
+ }
62846
62877
  const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());
62847
62878
  for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {
62848
62879
  if (r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.182",
3
+ "version": "2.113.183",
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.113.182",
41
+ "@abaplint/core": "^2.113.183",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",