@abaplint/transpiler-cli 2.13.0 → 2.13.2

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/bundle.js +386 -27
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -14070,7 +14070,7 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
14070
14070
  const expressions_1 = __webpack_require__(/*! ../expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
14071
14071
  class MethodDef {
14072
14072
  getMatcher() {
14073
- const def = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)("DEFAULT", (0, combi_1.altPrio)("FAIL", "IGNORE")));
14073
+ const def = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)("DEFAULT", (0, combi_1.altPrio)("FAIL", "IGNORE")), version_1.Version.OpenABAP);
14074
14074
  const parameters = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("FINAL", def, expressions_1.Abstract)), (0, combi_1.optPrio)(expressions_1.MethodDefImporting), (0, combi_1.optPrio)(expressions_1.MethodDefExporting), (0, combi_1.optPrio)(expressions_1.MethodDefChanging), (0, combi_1.optPrio)(expressions_1.MethodDefReturning), (0, combi_1.optPrio)((0, combi_1.altPrio)(expressions_1.MethodDefRaising, expressions_1.MethodDefExceptions)));
14075
14075
  const testing = (0, combi_1.seq)((0, combi_1.optPrio)(expressions_1.Abstract), "FOR TESTING", (0, combi_1.optPrio)((0, combi_1.altPrio)(expressions_1.MethodDefRaising, expressions_1.MethodDefExceptions)));
14076
14076
  const result = (0, combi_1.seq)("RESULT", expressions_1.MethodParamName);
@@ -15217,7 +15217,9 @@ class ReadTable {
15217
15217
  const key = (0, combi_1.seq)((0, combi_1.altPrio)("WITH KEY", "WITH TABLE KEY"), (0, combi_1.alt)(expressions_1.ComponentCompareSimple, components, (0, combi_1.seq)((0, combi_1.optPrio)("="), expressions_1.Source)));
15218
15218
  const using = (0, combi_1.seq)("USING KEY", (0, combi_1.alt)(expressions_1.Field, expressions_1.Dynamic));
15219
15219
  const from = (0, combi_1.seq)("FROM", expressions_1.Source);
15220
- const perm = (0, combi_1.per)((0, combi_1.alt)(index, key, from), expressions_1.ReadTableTarget, using, comparing, "CASTING", (0, combi_1.seq)("TRANSPORTING", (0, combi_1.altPrio)("ALL FIELDS", "NO FIELDS", transporting_fields_1.TransportingFields)), "BINARY SEARCH");
15220
+ const transporting = (0, combi_1.seq)("TRANSPORTING", (0, combi_1.altPrio)("ALL FIELDS", "NO FIELDS", transporting_fields_1.TransportingFields));
15221
+ const common = [expressions_1.ReadTableTarget, comparing, "CASTING", transporting, "BINARY SEARCH"];
15222
+ const perm = (0, combi_1.alt)((0, combi_1.per)((0, combi_1.alt)(index, from), using, ...common), (0, combi_1.per)(key, ...common), (0, combi_1.per)(...common));
15221
15223
  return (0, combi_1.seq)("READ TABLE", (0, combi_1.alt)(expressions_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source, version_1.Version.OpenABAP)), (0, combi_1.opt)(perm));
15222
15224
  }
15223
15225
  }
@@ -16555,6 +16557,8 @@ class Submit {
16555
16557
  const exporting = (0, combi_1.str)("EXPORTING LIST TO MEMORY");
16556
16558
  const spool = (0, combi_1.seq)("SPOOL PARAMETERS", expressions_1.Source);
16557
16559
  const archive = (0, combi_1.seq)("ARCHIVE PARAMETERS", expressions_1.Source);
16560
+ const archiveMode = (0, combi_1.seq)("ARCHIVE MODE", expressions_1.Source);
16561
+ const receiver = (0, combi_1.seq)("RECEIVER", expressions_1.Source);
16558
16562
  const lineSize = (0, combi_1.seq)("LINE-SIZE", expressions_1.Source);
16559
16563
  const lineCount = (0, combi_1.seq)("LINE-COUNT", expressions_1.Source);
16560
16564
  const user = (0, combi_1.seq)("USER", expressions_1.Source);
@@ -16573,7 +16577,7 @@ class Submit {
16573
16577
  const imm = (0, combi_1.seq)("IMMEDIATELY", expressions_1.Source);
16574
16578
  const dest = (0, combi_1.seq)("DESTINATION", expressions_1.Source);
16575
16579
  const language = (0, combi_1.seq)("LANGUAGE", expressions_1.Source);
16576
- const perm = (0, combi_1.per)((0, combi_1.plus)(awith), selectionTable, (0, combi_1.plus)(awith), spool, lineSize, lineCount, archive, user, sset, ssetp, keep, cover, imm, layout, dest, coverText, listName, language, free, newList, uss, copies, datasetExpiration, "TO SAP-SPOOL", "WITHOUT SPOOL DYNPRO", "VIA SELECTION-SCREEN", exporting, expressions_1.AndReturn, job);
16580
+ const perm = (0, combi_1.per)((0, combi_1.plus)(awith), selectionTable, (0, combi_1.plus)(awith), (0, combi_1.plus)(awith), spool, lineSize, lineCount, archive, archiveMode, receiver, user, sset, ssetp, keep, cover, imm, layout, dest, coverText, listName, language, free, newList, uss, copies, datasetExpiration, "TO SAP-SPOOL", "WITHOUT SPOOL DYNPRO", "VIA SELECTION-SCREEN", exporting, expressions_1.AndReturn, job);
16577
16581
  const ret = (0, combi_1.seq)("SUBMIT", prog, (0, combi_1.opt)(perm));
16578
16582
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
16579
16583
  }
@@ -17066,7 +17070,7 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
17066
17070
  class TypeEnum {
17067
17071
  getMatcher() {
17068
17072
  // it is also possible to define without Value, this is covered by normal type
17069
- const ret = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("TYPES", expressions_1.NamespaceSimpleName, expressions_1.Value));
17073
+ const ret = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("TYPES", expressions_1.NamespaceSimpleName, expressions_1.Value), version_1.Version.OpenABAP);
17070
17074
  return ret;
17071
17075
  }
17072
17076
  }
@@ -17093,7 +17097,7 @@ class TypeEnumBegin {
17093
17097
  const structure = (0, combi_1.seq)("STRUCTURE", expressions_1.NamespaceSimpleName);
17094
17098
  const base = (0, combi_1.seq)("BASE TYPE", expressions_1.NamespaceSimpleName);
17095
17099
  const em = (0, combi_1.seq)("ENUM", expressions_1.NamespaceSimpleName, (0, combi_1.opt)(structure), (0, combi_1.opt)(base));
17096
- const ret = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("TYPES", "BEGIN OF", em));
17100
+ const ret = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("TYPES", "BEGIN OF", em), version_1.Version.OpenABAP);
17097
17101
  return ret;
17098
17102
  }
17099
17103
  }
@@ -17118,7 +17122,7 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
17118
17122
  class TypeEnumEnd {
17119
17123
  getMatcher() {
17120
17124
  const structure = (0, combi_1.seq)("STRUCTURE", expressions_1.NamespaceSimpleName);
17121
- const ret = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("TYPES", "END OF", "ENUM", expressions_1.NamespaceSimpleName, (0, combi_1.opt)(structure)));
17125
+ const ret = (0, combi_1.ver)(version_1.Version.v751, (0, combi_1.seq)("TYPES", "END OF", "ENUM", expressions_1.NamespaceSimpleName, (0, combi_1.opt)(structure)), version_1.Version.OpenABAP);
17122
17126
  return ret;
17123
17127
  }
17124
17128
  }
@@ -20543,7 +20547,7 @@ BuiltIn.methods = {
20543
20547
  "CONCAT_LINES_OF": {
20544
20548
  counter: BuiltIn.counter++,
20545
20549
  mandatory: {
20546
- "table": new basic_1.TableType(basic_1.AnyType.get(), { withHeader: false, keyType: basic_1.TableKeyType.default }),
20550
+ "table": new basic_1.TableType(basic_1.AnyType.get(), { withHeader: false, keyType: basic_1.TableKeyType.user }),
20547
20551
  },
20548
20552
  optional: {
20549
20553
  "sep": basic_1.CLikeType.get(),
@@ -20841,7 +20845,7 @@ BuiltIn.methods = {
20841
20845
  "LINES": {
20842
20846
  counter: BuiltIn.counter++,
20843
20847
  mandatory: {
20844
- "val": new basic_1.TableType(basic_1.AnyType.get(), { withHeader: false, keyType: basic_1.TableKeyType.default }),
20848
+ "val": new basic_1.TableType(basic_1.AnyType.get(), { withHeader: false, keyType: basic_1.TableKeyType.user }),
20845
20849
  },
20846
20850
  return: basic_1.IntegerType.get(),
20847
20851
  },
@@ -21286,6 +21290,7 @@ class CurrentScope {
21286
21290
  }
21287
21291
  }
21288
21292
  constructor(reg, obj) {
21293
+ this.localFriends = new Map();
21289
21294
  this.current = undefined;
21290
21295
  this.parentObj = obj;
21291
21296
  this.reg = reg;
@@ -21709,6 +21714,27 @@ class CurrentScope {
21709
21714
  }
21710
21715
  return false;
21711
21716
  }
21717
+ addLocalFriend(className, friendName) {
21718
+ var _a;
21719
+ const key = className.toUpperCase();
21720
+ const list = (_a = this.localFriends.get(key)) !== null && _a !== void 0 ? _a : [];
21721
+ list.push(friendName.toUpperCase());
21722
+ this.localFriends.set(key, list);
21723
+ }
21724
+ isLocalFriend(className, friendName) {
21725
+ var _a;
21726
+ return ((_a = this.localFriends.get(className.toUpperCase())) === null || _a === void 0 ? void 0 : _a.includes(friendName.toUpperCase())) === true;
21727
+ }
21728
+ getEnclosingClassName() {
21729
+ let curr = this.current;
21730
+ while (curr !== undefined) {
21731
+ if (curr.getIdentifier().stype === _scope_type_1.ScopeType.ClassImplementation) {
21732
+ return curr.getIdentifier().sname;
21733
+ }
21734
+ curr = curr.getParent();
21735
+ }
21736
+ return undefined;
21737
+ }
21712
21738
  isGlobalOO() {
21713
21739
  return this.parentObj.getType() === "INTF" || this.parentObj.getType() === "CLAS";
21714
21740
  }
@@ -22462,6 +22488,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
22462
22488
  exports.TypeUtils = void 0;
22463
22489
  const types_1 = __webpack_require__(/*! ../types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
22464
22490
  const basic_1 = __webpack_require__(/*! ../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
22491
+ const table_type_1 = __webpack_require__(/*! ../types/basic/table_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/table_type.js");
22492
+ const enum_type_1 = __webpack_require__(/*! ../types/basic/enum_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/enum_type.js");
22465
22493
  const cgeneric_type_1 = __webpack_require__(/*! ../types/basic/cgeneric_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js");
22466
22494
  const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
22467
22495
  // todo: refactor to static? for performance
@@ -22538,7 +22566,8 @@ class TypeUtils {
22538
22566
  || type instanceof basic_1.DataType
22539
22567
  || type instanceof basic_1.CLikeType
22540
22568
  || type instanceof basic_1.PackedType
22541
- || type instanceof basic_1.TimeType) {
22569
+ || type instanceof basic_1.TimeType
22570
+ || type instanceof enum_type_1.EnumType) {
22542
22571
  return true;
22543
22572
  }
22544
22573
  return false;
@@ -22888,6 +22917,17 @@ class TypeUtils {
22888
22917
  }
22889
22918
  else if (source instanceof basic_1.TableType) {
22890
22919
  if (target instanceof basic_1.TableType) {
22920
+ const sourceKeyType = source.getOptions().keyType;
22921
+ const targetKeyType = target.getOptions().keyType;
22922
+ if (sourceKeyType !== targetKeyType
22923
+ && sourceKeyType !== table_type_1.TableKeyType.user
22924
+ && targetKeyType !== table_type_1.TableKeyType.user) {
22925
+ return false;
22926
+ }
22927
+ if (sourceKeyType === table_type_1.TableKeyType.empty && targetKeyType !== table_type_1.TableKeyType.empty
22928
+ && !(target.getRowType() instanceof basic_1.AnyType)) {
22929
+ return false;
22930
+ }
22891
22931
  return this.isAssignableStrict(source.getRowType(), target.getRowType());
22892
22932
  }
22893
22933
  else if (target instanceof basic_1.UnknownType
@@ -23616,7 +23656,7 @@ class BasicTypes {
23616
23656
  || text === "TYPE HASHED TABLE"
23617
23657
  || text === "TYPE INDEX TABLE"
23618
23658
  || text === "TYPE ANY TABLE") {
23619
- return new Types.TableType(Types.AnyType.get(), { withHeader: node.concatTokens().toUpperCase().includes("WITH HEADER LINE"), keyType: Types.TableKeyType.default });
23659
+ return new Types.TableType(Types.AnyType.get(), { withHeader: node.concatTokens().toUpperCase().includes("WITH HEADER LINE"), keyType: Types.TableKeyType.user });
23620
23660
  }
23621
23661
  else if (text.startsWith("LIKE ")) {
23622
23662
  let sub = node.findFirstExpression(Expressions.Type);
@@ -24893,7 +24933,9 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modu
24893
24933
  class DatabaseTable {
24894
24934
  static runSyntax(node, input) {
24895
24935
  const token = node.getFirstToken();
24896
- const name = token.getStr();
24936
+ const rawName = token.getStr();
24937
+ const starPrefixed = rawName.startsWith("*");
24938
+ const name = starPrefixed ? rawName.substring(1) : rawName;
24897
24939
  if (name === "(") {
24898
24940
  // dynamic
24899
24941
  return undefined;
@@ -25112,6 +25154,7 @@ class FieldChain {
25112
25154
  let context = undefined;
25113
25155
  const children = node.getChildren();
25114
25156
  context = this.findTop(children[0], input, refType);
25157
+ let prev = children[0].concatTokens();
25115
25158
  for (let i = 1; i < children.length; i++) {
25116
25159
  const current = children[i];
25117
25160
  if (current === undefined) {
@@ -25152,7 +25195,7 @@ class FieldChain {
25152
25195
  }
25153
25196
  }
25154
25197
  else {
25155
- const message = "Not a structure, FieldChain, " + (context === null || context === void 0 ? void 0 : context.constructor.name) + ", " + current.concatTokens();
25198
+ const message = prev.toUpperCase() + " is not structured (" + (context === null || context === void 0 ? void 0 : context.constructor.name) + ")";
25156
25199
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, current.getFirstToken(), message));
25157
25200
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
25158
25201
  }
@@ -25219,6 +25262,7 @@ class FieldChain {
25219
25262
  }
25220
25263
  }
25221
25264
  }
25265
+ prev = current.concatTokens();
25222
25266
  }
25223
25267
  return context;
25224
25268
  }
@@ -26458,7 +26502,7 @@ class MethodParameters {
26458
26502
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
26459
26503
  return;
26460
26504
  }
26461
- else if (item.targetType && new _type_utils_1.TypeUtils(input.scope).isAssignable(parameterType, item.targetType) === false) {
26505
+ else if (item.targetType && new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(parameterType, item.targetType) === false) {
26462
26506
  const message = "Method parameter type not compatible, " + item.name;
26463
26507
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
26464
26508
  return;
@@ -26486,7 +26530,7 @@ class MethodParameters {
26486
26530
  }
26487
26531
  parameterType = parameter.getType();
26488
26532
  }
26489
- if (item.targetType && new _type_utils_1.TypeUtils(input.scope).isAssignable(parameterType, item.targetType) === false) {
26533
+ if (item.targetType && new _type_utils_1.TypeUtils(input.scope).isAssignableStrict(parameterType, item.targetType) === false) {
26490
26534
  const message = "Method parameter type not compatible, " + item.name;
26491
26535
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
26492
26536
  return;
@@ -26801,6 +26845,7 @@ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/
26801
26845
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
26802
26846
  const assert_error_1 = __webpack_require__(/*! ../assert_error */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/assert_error.js");
26803
26847
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
26848
+ const create_object_1 = __webpack_require__(/*! ../statements/create_object */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/create_object.js");
26804
26849
  class NewObject {
26805
26850
  static runSyntax(node, input, targetType) {
26806
26851
  let ret = undefined;
@@ -26834,6 +26879,13 @@ class NewObject {
26834
26879
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
26835
26880
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
26836
26881
  }
26882
+ if (clas) {
26883
+ const err = create_object_1.CreateObject.checkInstantiationAllowed(clas, input);
26884
+ if (err) {
26885
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), err));
26886
+ return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
26887
+ }
26888
+ }
26837
26889
  }
26838
26890
  else if (typeName === "#" && targetType) {
26839
26891
  ret = targetType;
@@ -26855,6 +26907,13 @@ class NewObject {
26855
26907
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
26856
26908
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
26857
26909
  }
26910
+ if (clas) {
26911
+ const err = create_object_1.CreateObject.checkInstantiationAllowed(clas, input);
26912
+ if (err) {
26913
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), err));
26914
+ return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
26915
+ }
26916
+ }
26858
26917
  ret = objref;
26859
26918
  }
26860
26919
  }
@@ -27411,16 +27470,17 @@ class Select {
27411
27470
  if (dbSources.length !== 1) {
27412
27471
  return basic_1.VoidType.get("SELECT_todo3");
27413
27472
  }
27473
+ const tableOptions = { withHeader: false, keyType: basic_1.TableKeyType.empty };
27414
27474
  if (dbSources[0] === undefined) {
27415
27475
  // then its a voided table
27416
- return basic_1.VoidType.get("SELECT_todo4");
27476
+ return new basic_1.TableType(basic_1.VoidType.get("SELECT_todo4"), tableOptions, undefined);
27417
27477
  }
27418
27478
  const dbType = dbSources[0].parseType(scope.getRegistry());
27419
27479
  if (!(dbType instanceof basic_1.StructureType)) {
27420
27480
  return basic_1.VoidType.get("SELECT_todo5");
27421
27481
  }
27422
27482
  if (fields.length === 1 && fields[0].code === "*") {
27423
- return new basic_1.TableType(dbType, { withHeader: false, keyType: basic_1.TableKeyType.default }, undefined);
27483
+ return new basic_1.TableType(dbType, tableOptions, undefined);
27424
27484
  }
27425
27485
  const allFieldsSimple = fields.every(f => isSimple.test(f.code));
27426
27486
  if (allFieldsSimple === true) {
@@ -27432,7 +27492,7 @@ class Select {
27432
27492
  }
27433
27493
  components.push({ name: field.code, type });
27434
27494
  }
27435
- return new basic_1.TableType(new basic_1.StructureType(components), { withHeader: false, keyType: basic_1.TableKeyType.default }, undefined);
27495
+ return new basic_1.TableType(new basic_1.StructureType(components), tableOptions, undefined);
27436
27496
  }
27437
27497
  return basic_1.VoidType.get("SELECT_todo7");
27438
27498
  }
@@ -27620,6 +27680,11 @@ class Source {
27620
27680
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
27621
27681
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
27622
27682
  }
27683
+ else if (foundType === null || foundType === void 0 ? void 0 : foundType.isGeneric()) {
27684
+ const message = "Cannot CONV to generic type";
27685
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
27686
+ return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
27687
+ }
27623
27688
  this.addIfInferred(node, input, foundType);
27624
27689
  return foundType;
27625
27690
  }
@@ -30054,6 +30119,7 @@ const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@a
30054
30119
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
30055
30120
  class ClassLocalFriends {
30056
30121
  runSyntax(node, input) {
30122
+ var _a;
30057
30123
  const classNames = node.findAllExpressions(Expressions.ClassName);
30058
30124
  const found = classNames[0];
30059
30125
  if (found) {
@@ -30084,6 +30150,12 @@ class ClassLocalFriends {
30084
30150
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30085
30151
  return;
30086
30152
  }
30153
+ else {
30154
+ const befriendedName = (_a = classNames[0]) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();
30155
+ if (befriendedName) {
30156
+ input.scope.addLocalFriend(befriendedName, className);
30157
+ }
30158
+ }
30087
30159
  }
30088
30160
  }
30089
30161
  }
@@ -30565,6 +30637,7 @@ const types_1 = __webpack_require__(/*! ../../types */ "./node_modules/@abaplint
30565
30637
  const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
30566
30638
  const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
30567
30639
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
30640
+ const visibility_1 = __webpack_require__(/*! ../../4_file_information/visibility */ "./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js");
30568
30641
  class CreateObject {
30569
30642
  runSyntax(node, input) {
30570
30643
  var _a;
@@ -30661,8 +30734,46 @@ class CreateObject {
30661
30734
  ooName = found.getVoided();
30662
30735
  }
30663
30736
  input.scope.addReference(t === null || t === void 0 ? void 0 : t.getFirstToken(), cdef, _reference_1.ReferenceType.ConstructorReference, input.filename, { ooName: ooName });
30737
+ if (cdef !== undefined) {
30738
+ const err = CreateObject.checkInstantiationAllowed(cdef, input);
30739
+ if (err) {
30740
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), err));
30741
+ return;
30742
+ }
30743
+ }
30664
30744
  this.validateParameters(cdef, node, input);
30665
30745
  }
30746
+ static checkInstantiationAllowed(cdef, input) {
30747
+ var _a, _b;
30748
+ const createVis = cdef.getCreateVisibility();
30749
+ if (createVis === visibility_1.Visibility.Public) {
30750
+ return undefined;
30751
+ }
30752
+ const enclosingClass = input.scope.getEnclosingClassName();
30753
+ if (enclosingClass === undefined) {
30754
+ return cdef.getName() + " cannot be instantiated, class is defined as " +
30755
+ (createVis === visibility_1.Visibility.Private ? "private" : "protected");
30756
+ }
30757
+ if (enclosingClass.toUpperCase() === cdef.getName().toUpperCase()) {
30758
+ return undefined;
30759
+ }
30760
+ if (cdef.getFriends().some(f => f.toUpperCase() === enclosingClass.toUpperCase()) ||
30761
+ input.scope.isLocalFriend(cdef.getName(), enclosingClass)) {
30762
+ return undefined;
30763
+ }
30764
+ if (createVis === visibility_1.Visibility.Protected) {
30765
+ // subclasses are also allowed
30766
+ let sup = (_a = input.scope.findClassDefinition(enclosingClass)) === null || _a === void 0 ? void 0 : _a.getSuperClass();
30767
+ while (sup !== undefined) {
30768
+ if (sup.toUpperCase() === cdef.getName().toUpperCase()) {
30769
+ return undefined;
30770
+ }
30771
+ sup = (_b = input.scope.findClassDefinition(sup)) === null || _b === void 0 ? void 0 : _b.getSuperClass();
30772
+ }
30773
+ }
30774
+ return cdef.getName() + " cannot be instantiated, class is defined as " +
30775
+ (createVis === visibility_1.Visibility.Private ? "private" : "protected");
30776
+ }
30666
30777
  validateParameters(cdef, node, input) {
30667
30778
  var _a, _b, _c, _d;
30668
30779
  if (cdef === undefined) {
@@ -37813,6 +37924,7 @@ __exportStar(__webpack_require__(/*! ./date_type */ "./node_modules/@abaplint/co
37813
37924
  __exportStar(__webpack_require__(/*! ./decfloat_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat_type.js"), exports);
37814
37925
  __exportStar(__webpack_require__(/*! ./decfloat16_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat16_type.js"), exports);
37815
37926
  __exportStar(__webpack_require__(/*! ./decfloat34_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/decfloat34_type.js"), exports);
37927
+ __exportStar(__webpack_require__(/*! ./enum_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/enum_type.js"), exports);
37816
37928
  __exportStar(__webpack_require__(/*! ./float_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/float_type.js"), exports);
37817
37929
  __exportStar(__webpack_require__(/*! ./floating_point_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/floating_point_type.js"), exports);
37818
37930
  __exportStar(__webpack_require__(/*! ./generic_object_reference_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/generic_object_reference_type.js"), exports);
@@ -38671,6 +38783,7 @@ class Attributes {
38671
38783
  this.instance = [];
38672
38784
  this.constants = [];
38673
38785
  this.aliases = [];
38786
+ this.declaredInterfaces = [];
38674
38787
  this.tlist = [];
38675
38788
  this.filename = input.filename;
38676
38789
  this.parse(node, input);
@@ -38746,8 +38859,15 @@ class Attributes {
38746
38859
  }
38747
38860
  /////////////////////////////
38748
38861
  parse(node, input) {
38862
+ var _a, _b;
38749
38863
  const cdef = node.findDirectStructure(Structures.ClassDefinition);
38750
38864
  if (cdef) {
38865
+ for (const i of cdef.findAllStatements(Statements.InterfaceDef)) {
38866
+ const name = (_a = i.findFirstExpression(Expressions.InterfaceName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();
38867
+ if (name) {
38868
+ this.declaredInterfaces.push(name.toUpperCase());
38869
+ }
38870
+ }
38751
38871
  this.parseSection(cdef.findDirectStructure(Structures.PublicSection), visibility_1.Visibility.Public, input);
38752
38872
  this.parseSection(cdef.findDirectStructure(Structures.ProtectedSection), visibility_1.Visibility.Protected, input);
38753
38873
  this.parseSection(cdef.findDirectStructure(Structures.PrivateSection), visibility_1.Visibility.Private, input);
@@ -38755,6 +38875,12 @@ class Attributes {
38755
38875
  }
38756
38876
  const idef = node.findDirectStructure(Structures.Interface);
38757
38877
  if (idef) {
38878
+ for (const i of idef.findAllStatements(Statements.InterfaceDef)) {
38879
+ const name = (_b = i.findFirstExpression(Expressions.InterfaceName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();
38880
+ if (name) {
38881
+ this.declaredInterfaces.push(name.toUpperCase());
38882
+ }
38883
+ }
38758
38884
  this.parseSection(idef.findDirectStructure(Structures.SectionContents), visibility_1.Visibility.Public, input);
38759
38885
  return;
38760
38886
  }
@@ -38863,6 +38989,12 @@ class Attributes {
38863
38989
  input.scope.addNamedIdentifier(aliasName.getStr(), foundAttribute);
38864
38990
  }
38865
38991
  }
38992
+ else if (this.declaredInterfaces.includes(name.toUpperCase()) || input.scope.getDDIC().inErrorNamespace(name) === false) {
38993
+ input.scope.addReference(compToken, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, input.filename);
38994
+ }
38995
+ else {
38996
+ throw new Error("Interface " + name + " not found");
38997
+ }
38866
38998
  }
38867
38999
  }
38868
39000
  parseAttribute(node, visibility, input) {
@@ -38936,6 +39068,7 @@ const event_definition_1 = __webpack_require__(/*! ./event_definition */ "./node
38936
39068
  const visibility_1 = __webpack_require__(/*! ../4_file_information/visibility */ "./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js");
38937
39069
  const _object_oriented_1 = __webpack_require__(/*! ../5_syntax/_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
38938
39070
  const _reference_1 = __webpack_require__(/*! ../5_syntax/_reference */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js");
39071
+ const _syntax_input_1 = __webpack_require__(/*! ../5_syntax/_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
38939
39072
  class ClassDefinition extends _identifier_1.Identifier {
38940
39073
  constructor(node, input) {
38941
39074
  var _a;
@@ -38973,6 +39106,15 @@ class ClassDefinition extends _identifier_1.Identifier {
38973
39106
  this.testing = concat.includes(" FOR TESTING");
38974
39107
  this.sharedMemory = concat.includes(" SHARED MEMORY ENABLED");
38975
39108
  this.abstract = (def === null || def === void 0 ? void 0 : def.findDirectTokenByText("ABSTRACT")) !== undefined;
39109
+ if (concat.includes(" CREATE PRIVATE")) {
39110
+ this.createVisibilityValue = visibility_1.Visibility.Private;
39111
+ }
39112
+ else if (concat.includes(" CREATE PROTECTED")) {
39113
+ this.createVisibilityValue = visibility_1.Visibility.Protected;
39114
+ }
39115
+ else {
39116
+ this.createVisibilityValue = visibility_1.Visibility.Public;
39117
+ }
38976
39118
  // perform checks after everything has been initialized
38977
39119
  this.checkMethodsFromSuperClasses(input.scope);
38978
39120
  this.checkMethodNameLength();
@@ -39016,6 +39158,9 @@ class ClassDefinition extends _identifier_1.Identifier {
39016
39158
  isSharedMemory() {
39017
39159
  return this.sharedMemory;
39018
39160
  }
39161
+ getCreateVisibility() {
39162
+ return this.createVisibilityValue;
39163
+ }
39019
39164
  /*
39020
39165
  public getEvents() {
39021
39166
  }
@@ -39071,8 +39216,20 @@ class ClassDefinition extends _identifier_1.Identifier {
39071
39216
  const result = [];
39072
39217
  for (const n of ((_a = def === null || def === void 0 ? void 0 : def.findDirectExpression(Expressions.ClassFriends)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.ClassName)) || []) {
39073
39218
  const token = n.getFirstToken();
39074
- this.addReference(token, input);
39075
39219
  const name = token.getStr();
39220
+ const s = input.scope.findClassDefinition(name);
39221
+ if (s) {
39222
+ input.scope.addReference(token, s, _reference_1.ReferenceType.ObjectOrientedReference, input.filename, { ooName: name.toUpperCase(), ooType: "CLAS" });
39223
+ }
39224
+ else if (input.scope.existsObject(name) !== undefined) {
39225
+ // DEFINITION DEFERRED friend
39226
+ }
39227
+ else if (input.scope.getDDIC().inErrorNamespace(name) === false) {
39228
+ input.scope.addReference(token, undefined, _reference_1.ReferenceType.ObjectOrientedVoidReference, input.filename);
39229
+ }
39230
+ else {
39231
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, name.toUpperCase() + " does not exist"));
39232
+ }
39076
39233
  result.push(name);
39077
39234
  }
39078
39235
  return result;
@@ -54792,7 +54949,7 @@ class Registry {
54792
54949
  }
54793
54950
  static abaplintVersion() {
54794
54951
  // magic, see build script "version.sh"
54795
- return "2.118.1";
54952
+ return "2.118.7";
54796
54953
  }
54797
54954
  getDDICReferences() {
54798
54955
  return this.ddicReferences;
@@ -55390,12 +55547,12 @@ https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#abap-doc-on
55390
55547
  issues.push(issue);
55391
55548
  }
55392
55549
  if (rowText.trim().match(regexEmptyAbapdoc) === null && previousRowsTexts.indexOf(rowText) === previousRowsTexts.length - 1) {
55393
- const message = "Missing ABAP Doc for method " + method.identifier.getToken().getStr() + " (" + rowText + ")";
55550
+ const message = "Missing ABAP Doc for method " + method.identifier.getToken().getStr();
55394
55551
  const issue = issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key, this.conf.severity);
55395
55552
  issues.push(issue);
55396
55553
  }
55397
55554
  if (rowText.trim().match(regexEmptyParameterName) !== null) {
55398
- const message = "Missing ABAP Doc parameter name for method " + method.identifier.getToken().getStr() + " (" + rowText + ")";
55555
+ const message = "Missing ABAP Doc parameter name for method " + method.identifier.getToken().getStr();
55399
55556
  const issue = issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key, this.conf.severity);
55400
55557
  issues.push(issue);
55401
55558
  }
@@ -56477,11 +56634,17 @@ MODIFY TABLE foo FROM bar.`,
56477
56634
  match = this.tryMatch(statement, this.reg, Statements.DeleteDatabase);
56478
56635
  }
56479
56636
  else if (statement.get() instanceof Statements.ModifyInternal) {
56480
- match = this.tryMatch(statement, this.reg, Statements.ModifyDatabase);
56637
+ match = this.tryMatch(statement, this.reg, Statements.ModifyDatabase) || this.isBareStatement(statement);
56481
56638
  }
56482
56639
  else if (statement.get() instanceof Statements.ModifyDatabase) {
56483
56640
  match = this.tryMatch(statement, this.reg, Statements.ModifyInternal);
56484
56641
  }
56642
+ else if (statement.get() instanceof Statements.InsertDatabase) {
56643
+ match = this.isBareStatement(statement);
56644
+ }
56645
+ else if (statement.get() instanceof Statements.UpdateDatabase) {
56646
+ match = this.isBareStatement(statement);
56647
+ }
56485
56648
  if (match) {
56486
56649
  const issue = issue_1.Issue.atStatement(file, statement, this.getMessage(), this.getMetadata().key, this.conf.severity);
56487
56650
  issues.push(issue);
@@ -56489,6 +56652,11 @@ MODIFY TABLE foo FROM bar.`,
56489
56652
  }
56490
56653
  return issues;
56491
56654
  }
56655
+ isBareStatement(st) {
56656
+ const tokens = st.getTokens().slice(0);
56657
+ tokens.pop();
56658
+ return tokens.length === 2;
56659
+ }
56492
56660
  tryMatch(st, reg, type1) {
56493
56661
  const ver = reg.getConfig().getVersion();
56494
56662
  const tokens = st.getTokens().slice(0);
@@ -56943,6 +57111,98 @@ exports.CallTransactionAuthorityCheck = CallTransactionAuthorityCheck;
56943
57111
 
56944
57112
  /***/ },
56945
57113
 
57114
+ /***/ "./node_modules/@abaplint/core/build/src/rules/catch_and_raise.js"
57115
+ /*!************************************************************************!*\
57116
+ !*** ./node_modules/@abaplint/core/build/src/rules/catch_and_raise.js ***!
57117
+ \************************************************************************/
57118
+ (__unused_webpack_module, exports, __webpack_require__) {
57119
+
57120
+ "use strict";
57121
+
57122
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
57123
+ exports.CatchAndRaise = exports.CatchAndRaiseConf = void 0;
57124
+ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
57125
+ const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
57126
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
57127
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
57128
+ const Structures = __webpack_require__(/*! ../abap/3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
57129
+ const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
57130
+ const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
57131
+ class CatchAndRaiseConf extends _basic_rule_config_1.BasicRuleConfig {
57132
+ }
57133
+ exports.CatchAndRaiseConf = CatchAndRaiseConf;
57134
+ class CatchAndRaise extends _abap_rule_1.ABAPRule {
57135
+ constructor() {
57136
+ super(...arguments);
57137
+ this.conf = new CatchAndRaiseConf();
57138
+ }
57139
+ getMetadata() {
57140
+ return {
57141
+ key: "catch_and_raise",
57142
+ title: "Catch and re-raise same exception",
57143
+ shortDescription: `Reports CATCH blocks that only re-raise the caught exception without any handling`,
57144
+ badExample: `TRY.\n something( ).\nCATCH zcx_something INTO DATA(lv_exc).\n RAISE EXCEPTION lv_exc.\nENDTRY.`,
57145
+ goodExample: `TRY.\n something( ).\nCATCH zcx_something.\n " handle exception\nENDTRY.`,
57146
+ tags: [_irule_1.RuleTag.SingleFile],
57147
+ };
57148
+ }
57149
+ getConfig() {
57150
+ return this.conf;
57151
+ }
57152
+ setConfig(conf) {
57153
+ this.conf = conf;
57154
+ }
57155
+ runParsed(file) {
57156
+ const issues = [];
57157
+ const stru = file.getStructure();
57158
+ if (stru === undefined) {
57159
+ return [];
57160
+ }
57161
+ for (const catchStruct of stru.findAllStructures(Structures.Catch)) {
57162
+ const catchStatement = catchStruct.findDirectStatement(Statements.Catch);
57163
+ if (catchStatement === undefined) {
57164
+ continue;
57165
+ }
57166
+ const target = catchStatement.findFirstExpression(Expressions.Target);
57167
+ if (target === undefined) {
57168
+ continue;
57169
+ }
57170
+ const targetField = target.findFirstExpression(Expressions.TargetField);
57171
+ if (targetField === undefined) {
57172
+ continue;
57173
+ }
57174
+ const caughtVar = targetField.getFirstToken().getStr().toUpperCase();
57175
+ const allStatements = catchStruct.findAllStatementNodes();
57176
+ if (allStatements.length !== 2) {
57177
+ continue;
57178
+ }
57179
+ if (!(allStatements[1].get() instanceof Statements.Raise)) {
57180
+ continue;
57181
+ }
57182
+ const raiseStatement = allStatements[1];
57183
+ const raiseConcat = raiseStatement.concatTokens().toUpperCase().replace(/\.$/, "").trim();
57184
+ if (!raiseConcat.startsWith("RAISE EXCEPTION ")) {
57185
+ continue;
57186
+ }
57187
+ const parts = raiseConcat.split(/\s+/);
57188
+ if (parts.length !== 3) {
57189
+ continue;
57190
+ }
57191
+ if (parts[2] === caughtVar) {
57192
+ issues.push(issue_1.Issue.atStatement(file, catchStatement, this.getMessage(), this.getMetadata().key, this.conf.severity));
57193
+ }
57194
+ }
57195
+ return issues;
57196
+ }
57197
+ getMessage() {
57198
+ return "Caught exception is immediately re-raised, CATCH block has no effect";
57199
+ }
57200
+ }
57201
+ exports.CatchAndRaise = CatchAndRaise;
57202
+ //# sourceMappingURL=catch_and_raise.js.map
57203
+
57204
+ /***/ },
57205
+
56946
57206
  /***/ "./node_modules/@abaplint/core/build/src/rules/cds_association_name.js"
56947
57207
  /*!*****************************************************************************!*\
56948
57208
  !*** ./node_modules/@abaplint/core/build/src/rules/cds_association_name.js ***!
@@ -66711,6 +66971,7 @@ __exportStar(__webpack_require__(/*! ./avoid_use */ "./node_modules/@abaplint/co
66711
66971
  __exportStar(__webpack_require__(/*! ./begin_end_names */ "./node_modules/@abaplint/core/build/src/rules/begin_end_names.js"), exports);
66712
66972
  __exportStar(__webpack_require__(/*! ./begin_single_include */ "./node_modules/@abaplint/core/build/src/rules/begin_single_include.js"), exports);
66713
66973
  __exportStar(__webpack_require__(/*! ./call_transaction_authority_check */ "./node_modules/@abaplint/core/build/src/rules/call_transaction_authority_check.js"), exports);
66974
+ __exportStar(__webpack_require__(/*! ./catch_and_raise */ "./node_modules/@abaplint/core/build/src/rules/catch_and_raise.js"), exports);
66714
66975
  __exportStar(__webpack_require__(/*! ./cds_association_name */ "./node_modules/@abaplint/core/build/src/rules/cds_association_name.js"), exports);
66715
66976
  __exportStar(__webpack_require__(/*! ./cds_comment_style */ "./node_modules/@abaplint/core/build/src/rules/cds_comment_style.js"), exports);
66716
66977
  __exportStar(__webpack_require__(/*! ./cds_field_order */ "./node_modules/@abaplint/core/build/src/rules/cds_field_order.js"), exports);
@@ -87711,6 +87972,13 @@ class DataTranspiler {
87711
87972
  else {
87712
87973
  value = DataTranspiler.buildValue(node, traversal_1.Traversal.prefixVariable(found.getName().toLowerCase()), traversal);
87713
87974
  }
87975
+ // for enum types, initialize with the first enum value
87976
+ if (found.getType() instanceof abaplint.BasicTypes.EnumType && value === "") {
87977
+ const enumDefault = DataTranspiler.findEnumDefault(scope, found.getType());
87978
+ if (enumDefault) {
87979
+ value = "\n" + traversal_1.Traversal.prefixVariable(found.getName().toLowerCase()) + ".set(\"" + enumDefault + "\");";
87980
+ }
87981
+ }
87714
87982
  const ret = new chunk_1.Chunk()
87715
87983
  .appendString("let ")
87716
87984
  .appendString(traversal_1.Traversal.prefixVariable(traversal_1.Traversal.escapeNamespace(found.getName().toLowerCase())))
@@ -87719,6 +87987,26 @@ class DataTranspiler {
87719
87987
  .appendString(value);
87720
87988
  return ret;
87721
87989
  }
87990
+ static findEnumDefault(scope, _enumType) {
87991
+ let current = scope;
87992
+ while (current) {
87993
+ const vars = current.getData().vars;
87994
+ for (const key of Object.keys(vars)) {
87995
+ const v = vars[key];
87996
+ if (v.getMeta().includes("enum" /* abaplint.IdentifierMeta.Enum */)) {
87997
+ const structType = v.getType();
87998
+ if (structType instanceof abaplint.BasicTypes.StructureType) {
87999
+ const components = structType.getComponents();
88000
+ if (components.length > 0) {
88001
+ return components[0].name.toUpperCase();
88002
+ }
88003
+ }
88004
+ }
88005
+ }
88006
+ current = current.getParent();
88007
+ }
88008
+ return undefined;
88009
+ }
87722
88010
  static buildValue(node, name, traversal) {
87723
88011
  let value = "";
87724
88012
  const val = node.findFirstExpression(abaplint.Expressions.Value);
@@ -89224,6 +89512,7 @@ __exportStar(__webpack_require__(/*! ./select */ "./node_modules/@abaplint/trans
89224
89512
  __exportStar(__webpack_require__(/*! ./selection_screen */ "./node_modules/@abaplint/transpiler/build/src/statements/selection_screen.js"), exports);
89225
89513
  __exportStar(__webpack_require__(/*! ./set_bit */ "./node_modules/@abaplint/transpiler/build/src/statements/set_bit.js"), exports);
89226
89514
  __exportStar(__webpack_require__(/*! ./set_dataset */ "./node_modules/@abaplint/transpiler/build/src/statements/set_dataset.js"), exports);
89515
+ __exportStar(__webpack_require__(/*! ./set_extended_check */ "./node_modules/@abaplint/transpiler/build/src/statements/set_extended_check.js"), exports);
89227
89516
  __exportStar(__webpack_require__(/*! ./set_handler */ "./node_modules/@abaplint/transpiler/build/src/statements/set_handler.js"), exports);
89228
89517
  __exportStar(__webpack_require__(/*! ./set_language */ "./node_modules/@abaplint/transpiler/build/src/statements/set_language.js"), exports);
89229
89518
  __exportStar(__webpack_require__(/*! ./set_locale */ "./node_modules/@abaplint/transpiler/build/src/statements/set_locale.js"), exports);
@@ -91055,7 +91344,7 @@ exports.RetryTranspiler = void 0;
91055
91344
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
91056
91345
  class RetryTranspiler {
91057
91346
  transpile(_node, _traversal) {
91058
- return new chunk_1.Chunk(`throw new Error("Retry, not supported, transpiler");`);
91347
+ return new chunk_1.Chunk(`throw new Error("RETRY, not supported, transpiler");`);
91059
91348
  }
91060
91349
  }
91061
91350
  exports.RetryTranspiler = RetryTranspiler;
@@ -91456,6 +91745,27 @@ exports.SetDatasetTranspiler = SetDatasetTranspiler;
91456
91745
 
91457
91746
  /***/ },
91458
91747
 
91748
+ /***/ "./node_modules/@abaplint/transpiler/build/src/statements/set_extended_check.js"
91749
+ /*!**************************************************************************************!*\
91750
+ !*** ./node_modules/@abaplint/transpiler/build/src/statements/set_extended_check.js ***!
91751
+ \**************************************************************************************/
91752
+ (__unused_webpack_module, exports, __webpack_require__) {
91753
+
91754
+ "use strict";
91755
+
91756
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
91757
+ exports.SetExtendedCheckTranspiler = void 0;
91758
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
91759
+ class SetExtendedCheckTranspiler {
91760
+ transpile(_node, _traversal) {
91761
+ return new chunk_1.Chunk(`throw new Error("SET EXTENDED CHECK, not supported, transpiler");`);
91762
+ }
91763
+ }
91764
+ exports.SetExtendedCheckTranspiler = SetExtendedCheckTranspiler;
91765
+ //# sourceMappingURL=set_extended_check.js.map
91766
+
91767
+ /***/ },
91768
+
91459
91769
  /***/ "./node_modules/@abaplint/transpiler/build/src/statements/set_handler.js"
91460
91770
  /*!*******************************************************************************!*\
91461
91771
  !*** ./node_modules/@abaplint/transpiler/build/src/statements/set_handler.js ***!
@@ -91878,7 +92188,7 @@ exports.StopTranspiler = void 0;
91878
92188
  const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
91879
92189
  class StopTranspiler {
91880
92190
  transpile(_node, _traversal) {
91881
- return new chunk_1.Chunk(`throw new Error("Stop, not supported, transpiler");`);
92191
+ return new chunk_1.Chunk(`throw new Error("STOP, not supported, transpiler");`);
91882
92192
  }
91883
92193
  }
91884
92194
  exports.StopTranspiler = StopTranspiler;
@@ -93267,6 +93577,7 @@ __exportStar(__webpack_require__(/*! ./module */ "./node_modules/@abaplint/trans
93267
93577
  __exportStar(__webpack_require__(/*! ./select */ "./node_modules/@abaplint/transpiler/build/src/structures/select.js"), exports);
93268
93578
  __exportStar(__webpack_require__(/*! ./method */ "./node_modules/@abaplint/transpiler/build/src/structures/method.js"), exports);
93269
93579
  __exportStar(__webpack_require__(/*! ./try */ "./node_modules/@abaplint/transpiler/build/src/structures/try.js"), exports);
93580
+ __exportStar(__webpack_require__(/*! ./type_enum */ "./node_modules/@abaplint/transpiler/build/src/structures/type_enum.js"), exports);
93270
93581
  __exportStar(__webpack_require__(/*! ./types */ "./node_modules/@abaplint/transpiler/build/src/structures/types.js"), exports);
93271
93582
  __exportStar(__webpack_require__(/*! ./when */ "./node_modules/@abaplint/transpiler/build/src/structures/when.js"), exports);
93272
93583
  __exportStar(__webpack_require__(/*! ./while */ "./node_modules/@abaplint/transpiler/build/src/structures/while.js"), exports);
@@ -93680,6 +93991,51 @@ exports.TryTranspiler = TryTranspiler;
93680
93991
 
93681
93992
  /***/ },
93682
93993
 
93994
+ /***/ "./node_modules/@abaplint/transpiler/build/src/structures/type_enum.js"
93995
+ /*!*****************************************************************************!*\
93996
+ !*** ./node_modules/@abaplint/transpiler/build/src/structures/type_enum.js ***!
93997
+ \*****************************************************************************/
93998
+ (__unused_webpack_module, exports, __webpack_require__) {
93999
+
94000
+ "use strict";
94001
+
94002
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
94003
+ exports.TypeEnumTranspiler = void 0;
94004
+ const abaplint = __webpack_require__(/*! @abaplint/core */ "./node_modules/@abaplint/core/build/src/index.js");
94005
+ const traversal_1 = __webpack_require__(/*! ../traversal */ "./node_modules/@abaplint/transpiler/build/src/traversal.js");
94006
+ const chunk_1 = __webpack_require__(/*! ../chunk */ "./node_modules/@abaplint/transpiler/build/src/chunk.js");
94007
+ class TypeEnumTranspiler {
94008
+ transpile(node, _traversal) {
94009
+ const begin = node.findDirectStatement(abaplint.Statements.TypeEnumBegin);
94010
+ if (begin === undefined) {
94011
+ return new chunk_1.Chunk("");
94012
+ }
94013
+ const nsNames = begin.findAllExpressions(abaplint.Expressions.NamespaceSimpleName);
94014
+ if (nsNames.length < 2) {
94015
+ return new chunk_1.Chunk("");
94016
+ }
94017
+ const structureName = nsNames[1].concatTokens().toLowerCase();
94018
+ const values = [];
94019
+ for (const t of node.findDirectStatements(abaplint.Statements.Type)) {
94020
+ const name = t.findFirstExpression(abaplint.Expressions.NamespaceSimpleName);
94021
+ if (name) {
94022
+ values.push(name.concatTokens().toLowerCase());
94023
+ }
94024
+ }
94025
+ const fields = values.map(v => `"${v}": new abap.types.String()`).join(",\n");
94026
+ let ret = `let ${traversal_1.Traversal.prefixVariable(structureName)} = new abap.types.Structure({
94027
+ ${fields}});\n`;
94028
+ for (const v of values) {
94029
+ ret += `${traversal_1.Traversal.prefixVariable(structureName)}.get().${v}.set("${v.toUpperCase()}");\n`;
94030
+ }
94031
+ return new chunk_1.Chunk(ret);
94032
+ }
94033
+ }
94034
+ exports.TypeEnumTranspiler = TypeEnumTranspiler;
94035
+ //# sourceMappingURL=type_enum.js.map
94036
+
94037
+ /***/ },
94038
+
93683
94039
  /***/ "./node_modules/@abaplint/transpiler/build/src/structures/types.js"
93684
94040
  /*!*************************************************************************!*\
93685
94041
  !*** ./node_modules/@abaplint/transpiler/build/src/structures/types.js ***!
@@ -93969,6 +94325,12 @@ class TranspileTypes {
93969
94325
  else if (type instanceof abaplint.BasicTypes.DecFloat34Type) {
93970
94326
  resolved = "DecFloat34";
93971
94327
  }
94328
+ else if (type instanceof abaplint.BasicTypes.EnumType) {
94329
+ resolved = "String";
94330
+ if (type.getQualifiedName() !== undefined) {
94331
+ extra = "{qualifiedName: \"" + type.getQualifiedName()?.toUpperCase() + "\"}";
94332
+ }
94333
+ }
93972
94334
  else if (type instanceof abaplint.BasicTypes.UnknownType) {
93973
94335
  return `(() => { throw new Error("Unknown type: ${type.getError()}") })()`;
93974
94336
  }
@@ -95252,9 +95614,6 @@ exports.config = {
95252
95614
  "begin_end_names": true,
95253
95615
  "check_syntax": true,
95254
95616
  "form_no_dash": true,
95255
- "obsolete_statement": {
95256
- "setExtended": true,
95257
- },
95258
95617
  "forbidden_identifier": {
95259
95618
  "check": [],
95260
95619
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.13.0",
3
+ "version": "2.13.2",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -27,8 +27,8 @@
27
27
  "author": "abaplint",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@abaplint/core": "^2.118.1",
31
- "@abaplint/transpiler": "^2.13.0",
30
+ "@abaplint/core": "^2.118.7",
31
+ "@abaplint/transpiler": "^2.13.2",
32
32
  "@types/glob": "^8.1.0",
33
33
  "@types/node": "^24.12.0",
34
34
  "@types/progress": "^2.0.7",