@abaplint/transpiler-cli 2.5.72 → 2.5.74

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 +141 -43
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -18583,7 +18583,7 @@ BuiltIn.methods = [
18583
18583
  {
18584
18584
  name: "CONCAT_LINES_OF",
18585
18585
  mandatory: {
18586
- "table": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }),
18586
+ "table": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false, keyType: basic_1.TableKeyType.default }),
18587
18587
  },
18588
18588
  optional: {
18589
18589
  "sep": new basic_1.StringType(),
@@ -18879,7 +18879,7 @@ BuiltIn.methods = [
18879
18879
  {
18880
18880
  name: "LINES",
18881
18881
  mandatory: {
18882
- "val": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false }),
18882
+ "val": new basic_1.TableType(new basic_1.AnyType(), { withHeader: false, keyType: basic_1.TableKeyType.default }),
18883
18883
  },
18884
18884
  return: new basic_1.IntegerType(),
18885
18885
  },
@@ -20099,10 +20099,10 @@ class Procedural {
20099
20099
  }
20100
20100
  if (param.direction === types_1.FunctionModuleParameterDirection.tables) {
20101
20101
  if (found instanceof basic_1.TableType) {
20102
- found = new basic_1.TableType(found.getRowType(), { withHeader: true });
20102
+ found = new basic_1.TableType(found.getRowType(), { withHeader: true, keyType: basic_1.TableKeyType.default });
20103
20103
  }
20104
20104
  else {
20105
- found = new basic_1.TableType(found, { withHeader: true });
20105
+ found = new basic_1.TableType(found, { withHeader: true, keyType: basic_1.TableKeyType.default });
20106
20106
  }
20107
20107
  }
20108
20108
  if ((found instanceof basic_1.UnknownType || found instanceof basic_1.VoidType) && ((_a = param.type) === null || _a === void 0 ? void 0 : _a.includes("-"))) {
@@ -20659,7 +20659,7 @@ class BasicTypes {
20659
20659
  }
20660
20660
  else if (child.concatTokens() === "[]") {
20661
20661
  if (type instanceof Types.TableType) {
20662
- type = new basic_1.TableType(type.getRowType(), { withHeader: false });
20662
+ type = new basic_1.TableType(type.getRowType(), { withHeader: false, keyType: Types.TableKeyType.default });
20663
20663
  }
20664
20664
  }
20665
20665
  else { // field name
@@ -20785,7 +20785,7 @@ class BasicTypes {
20785
20785
  return undefined;
20786
20786
  }
20787
20787
  parseTable(node, name) {
20788
- var _a, _b, _c;
20788
+ var _a, _b, _c, _d;
20789
20789
  const typename = node.findFirstExpression(Expressions.TypeName);
20790
20790
  const text = (_a = node.findFirstExpression(Expressions.TypeTable)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
20791
20791
  if (text === undefined) {
@@ -20808,10 +20808,11 @@ class BasicTypes {
20808
20808
  }
20809
20809
  const typeTableKeys = node.findAllExpressions(expressions_1.TypeTableKey);
20810
20810
  const firstKey = typeTableKeys[0];
20811
- const isNamed = (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpression(expressions_1.Field)) !== undefined;
20811
+ const isNamed = (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpression(expressions_1.Field)) !== undefined
20812
+ && ((_b = firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpression(expressions_1.Field)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase()) !== "PRIMARY_KEY";
20812
20813
  const primaryKey = {
20813
20814
  name: "primary_key",
20814
- type: type,
20815
+ type: type || basic_1.TableAccessType.standard,
20815
20816
  isUnique: isNamed ? false : (firstKey === null || firstKey === void 0 ? void 0 : firstKey.concatTokens().toUpperCase().includes("WITH UNIQUE ")) === true,
20816
20817
  keyFields: [],
20817
20818
  };
@@ -20820,9 +20821,6 @@ class BasicTypes {
20820
20821
  for (const k of (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpressions(expressions_1.FieldSub)) || []) {
20821
20822
  primaryKey.keyFields.push(k.concatTokens().toUpperCase());
20822
20823
  }
20823
- if (primaryKey.keyFields.length === 0 && text.includes(" DEFAULT KEY")) {
20824
- primaryKey.keyFields.push("TABLE_LINE");
20825
- }
20826
20824
  }
20827
20825
  else {
20828
20826
  start = 0;
@@ -20830,7 +20828,7 @@ class BasicTypes {
20830
20828
  const secondaryKeys = [];
20831
20829
  for (let i = start; i < typeTableKeys.length; i++) {
20832
20830
  const row = typeTableKeys[i];
20833
- const name = (_b = row.findDirectExpression(expressions_1.Field)) === null || _b === void 0 ? void 0 : _b.concatTokens();
20831
+ const name = (_c = row.findDirectExpression(expressions_1.Field)) === null || _c === void 0 ? void 0 : _c.concatTokens();
20834
20832
  if (name === undefined) {
20835
20833
  continue;
20836
20834
  }
@@ -20845,8 +20843,16 @@ class BasicTypes {
20845
20843
  }
20846
20844
  secondaryKeys.push(secondary);
20847
20845
  }
20846
+ let keyType = Types.TableKeyType.user;
20847
+ if (text.includes(" EMPTY KEY")) {
20848
+ keyType = Types.TableKeyType.empty;
20849
+ }
20850
+ else if (text.includes(" DEFAULT KEY")) {
20851
+ keyType = Types.TableKeyType.default;
20852
+ }
20848
20853
  const options = {
20849
20854
  withHeader: text.includes(" WITH HEADER LINE"),
20855
+ keyType: keyType,
20850
20856
  primaryKey: primaryKey,
20851
20857
  secondary: secondaryKeys,
20852
20858
  };
@@ -20918,7 +20924,7 @@ class BasicTypes {
20918
20924
  else if (typename && (text.startsWith("TYPE TABLE FOR CREATE ")
20919
20925
  || text.startsWith("TYPE TABLE FOR UPDATE "))) {
20920
20926
  const name = typename.concatTokens();
20921
- const type = (_c = this.scope.getDDIC().lookupDDLS(name)) === null || _c === void 0 ? void 0 : _c.type;
20927
+ const type = (_d = this.scope.getDDIC().lookupDDLS(name)) === null || _d === void 0 ? void 0 : _d.type;
20922
20928
  if (type) {
20923
20929
  return new Types.TableType(new basic_1.VoidType("RapTodo"), options);
20924
20930
  }
@@ -20993,7 +20999,7 @@ class BasicTypes {
20993
20999
  || text === "TYPE HASHED TABLE"
20994
21000
  || text === "TYPE INDEX TABLE"
20995
21001
  || text === "TYPE ANY TABLE") {
20996
- return new Types.TableType(new Types.AnyType(), { withHeader: node.concatTokens().toUpperCase().includes("WITH HEADER LINE") });
21002
+ return new Types.TableType(new Types.AnyType(), { withHeader: node.concatTokens().toUpperCase().includes("WITH HEADER LINE"), keyType: Types.TableKeyType.default });
20997
21003
  }
20998
21004
  else if (text.startsWith("LIKE ")) {
20999
21005
  let sub = node.findFirstExpression(Expressions.Type);
@@ -21011,7 +21017,7 @@ class BasicTypes {
21011
21017
  }
21012
21018
  found = this.resolveLikeName(sub);
21013
21019
  if (found && this.isOccurs(node)) {
21014
- found = new Types.TableType(found, { withHeader: text.includes("WITH HEADER LINE") }, qualifiedName);
21020
+ found = new Types.TableType(found, { withHeader: text.includes("WITH HEADER LINE"), keyType: Types.TableKeyType.default }, qualifiedName);
21015
21021
  }
21016
21022
  }
21017
21023
  else if (text.startsWith("TYPE LINE OF ")) {
@@ -21040,17 +21046,17 @@ class BasicTypes {
21040
21046
  found = this.resolveTypeName(typeName, this.findLength(node), this.findDecimals(node), qualifiedName);
21041
21047
  const concat = node.concatTokens().toUpperCase();
21042
21048
  if (found && this.isOccurs(node)) {
21043
- found = new Types.TableType(found, { withHeader: concat.includes(" WITH HEADER LINE") }, qualifiedName);
21049
+ found = new Types.TableType(found, { withHeader: concat.includes(" WITH HEADER LINE"), keyType: Types.TableKeyType.default }, qualifiedName);
21044
21050
  }
21045
21051
  else if (found && concat.includes(" WITH HEADER LINE")) {
21046
21052
  if (found instanceof Types.VoidType) {
21047
- found = new Types.TableType(found, { withHeader: true });
21053
+ found = new Types.TableType(found, { withHeader: true, keyType: Types.TableKeyType.default });
21048
21054
  }
21049
21055
  else if (!(found instanceof Types.TableType)) {
21050
21056
  throw new Error("WITH HEADER LINE can only be used with internal table");
21051
21057
  }
21052
21058
  else {
21053
- found = new Types.TableType(found.getRowType(), { withHeader: true });
21059
+ found = new Types.TableType(found.getRowType(), { withHeader: true, keyType: Types.TableKeyType.default });
21054
21060
  }
21055
21061
  }
21056
21062
  if (found === undefined && typeName === undefined) {
@@ -21064,7 +21070,7 @@ class BasicTypes {
21064
21070
  }
21065
21071
  found = new Types.CharacterType(length, { qualifiedName: qualifiedName }); // fallback
21066
21072
  if (this.isOccurs(node)) {
21067
- found = new Types.TableType(found, { withHeader: concat.includes(" WITH HEADER LINE") }, qualifiedName);
21073
+ found = new Types.TableType(found, { withHeader: concat.includes(" WITH HEADER LINE"), keyType: Types.TableKeyType.default }, qualifiedName);
21068
21074
  }
21069
21075
  }
21070
21076
  }
@@ -26237,7 +26243,7 @@ class Controls {
26237
26243
  { name: "LINE_SELECTOR", type: new basic_1.CharacterType(1) },
26238
26244
  { name: "H_GRID", type: new basic_1.CharacterType(1) },
26239
26245
  { name: "V_GRID", type: new basic_1.CharacterType(1) },
26240
- { name: "COLS", type: new basic_1.TableType(cols, { withHeader: false }) },
26246
+ { name: "COLS", type: new basic_1.TableType(cols, { withHeader: false, keyType: basic_1.TableKeyType.default }) },
26241
26247
  { name: "INVISIBLE", type: new basic_1.CharacterType(1) },
26242
26248
  ]);
26243
26249
  const id = new _typed_identifier_1.TypedIdentifier(token, filename, type);
@@ -26884,13 +26890,13 @@ class Find {
26884
26890
  { name: "LINE", type: new basic_1.IntegerType() },
26885
26891
  { name: "OFFSET", type: new basic_1.IntegerType() },
26886
26892
  { name: "LENGTH", type: new basic_1.IntegerType() },
26887
- { name: "SUBMATCHES", type: new basic_1.TableType(sub, { withHeader: false }) },
26893
+ { name: "SUBMATCHES", type: new basic_1.TableType(sub, { withHeader: false, keyType: basic_1.TableKeyType.default }) },
26888
26894
  ], "MATCH_RESULT", "MATCH_RESULT");
26889
26895
  if (node.concatTokens().toUpperCase().startsWith("FIND FIRST")) {
26890
26896
  this.inline(rfound, scope, filename, type);
26891
26897
  }
26892
26898
  else {
26893
- this.inline(rfound, scope, filename, new basic_1.TableType(type, { withHeader: false }, "MATCH_RESULT_TAB"));
26899
+ this.inline(rfound, scope, filename, new basic_1.TableType(type, { withHeader: false, keyType: basic_1.TableKeyType.default }, "MATCH_RESULT_TAB"));
26894
26900
  }
26895
26901
  }
26896
26902
  const ofound = node.findExpressionsAfterToken("OFFSET");
@@ -28420,7 +28426,7 @@ class Ranges {
28420
28426
  { name: "low", type: found },
28421
28427
  { name: "high", type: found },
28422
28428
  ]);
28423
- const type = new basic_1.TableType(structure, { withHeader: true });
28429
+ const type = new basic_1.TableType(structure, { withHeader: true, keyType: basic_1.TableKeyType.default });
28424
28430
  const id = new _typed_identifier_1.TypedIdentifier(nameToken, filename, type);
28425
28431
  scope.addIdentifier(id);
28426
28432
  }
@@ -28880,7 +28886,7 @@ class SelectOption {
28880
28886
  { name: "LOW", type: found },
28881
28887
  { name: "HIGH", type: found },
28882
28888
  ]);
28883
- scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, filename, new basic_1.TableType(stru, { withHeader: true })));
28889
+ scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, filename, new basic_1.TableType(stru, { withHeader: true, keyType: basic_1.TableKeyType.default })));
28884
28890
  return;
28885
28891
  }
28886
28892
  if (nameToken) {
@@ -29167,7 +29173,7 @@ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/
29167
29173
  class Split {
29168
29174
  runSyntax(node, scope, filename) {
29169
29175
  const intoTable = node.findTokenSequencePosition("INTO", "TABLE") !== undefined;
29170
- const type = intoTable ? new basic_1.TableType(new basic_1.StringType(), { withHeader: false }) : new basic_1.StringType();
29176
+ const type = intoTable ? new basic_1.TableType(new basic_1.StringType(), { withHeader: false, keyType: basic_1.TableKeyType.default }) : new basic_1.StringType();
29171
29177
  for (const target of node.findAllExpressions(Expressions.Target)) {
29172
29178
  const inline = target.findDirectExpression(Expressions.InlineData);
29173
29179
  if (inline) {
@@ -30042,7 +30048,7 @@ class Data {
30042
30048
  }
30043
30049
  if (found instanceof Basic.VoidType) {
30044
30050
  if (table === true) {
30045
- return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(found, { withHeader: true }));
30051
+ return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(found, { withHeader: true, keyType: Basic.TableKeyType.default }));
30046
30052
  }
30047
30053
  else {
30048
30054
  return new _typed_identifier_1.TypedIdentifier(name, filename, found);
@@ -30060,7 +30066,7 @@ class Data {
30060
30066
  }
30061
30067
  }
30062
30068
  if (table === true) {
30063
- return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(new Basic.StructureType(components), { withHeader: true }));
30069
+ return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(new Basic.StructureType(components), { withHeader: true, keyType: Basic.TableKeyType.default }));
30064
30070
  }
30065
30071
  else {
30066
30072
  const val = Object.keys(values).length > 0 ? values : undefined;
@@ -30131,7 +30137,7 @@ class Statics {
30131
30137
  }
30132
30138
  if (found instanceof Basic.VoidType) {
30133
30139
  if (table === true) {
30134
- return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(found, { withHeader: true }));
30140
+ return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(found, { withHeader: true, keyType: Basic.TableKeyType.default }));
30135
30141
  }
30136
30142
  else {
30137
30143
  return new _typed_identifier_1.TypedIdentifier(name, filename, found);
@@ -30149,7 +30155,7 @@ class Statics {
30149
30155
  }
30150
30156
  }
30151
30157
  if (table === true) {
30152
- return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(new Basic.StructureType(components), { withHeader: true }));
30158
+ return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(new Basic.StructureType(components), { withHeader: true, keyType: Basic.TableKeyType.default }));
30153
30159
  }
30154
30160
  else {
30155
30161
  return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.StructureType(components));
@@ -33449,7 +33455,7 @@ exports.StructureType = StructureType;
33449
33455
  "use strict";
33450
33456
 
33451
33457
  Object.defineProperty(exports, "__esModule", ({ value: true }));
33452
- exports.TableType = exports.TableAccessType = void 0;
33458
+ exports.TableType = exports.TableKeyType = exports.TableAccessType = void 0;
33453
33459
  const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
33454
33460
  var TableAccessType;
33455
33461
  (function (TableAccessType) {
@@ -33459,6 +33465,12 @@ var TableAccessType;
33459
33465
  TableAccessType["index"] = "INDEX";
33460
33466
  TableAccessType["any"] = "ANY";
33461
33467
  })(TableAccessType = exports.TableAccessType || (exports.TableAccessType = {}));
33468
+ var TableKeyType;
33469
+ (function (TableKeyType) {
33470
+ TableKeyType["default"] = "DEFAULT";
33471
+ TableKeyType["user"] = "USER";
33472
+ TableKeyType["empty"] = "EMPTY";
33473
+ })(TableKeyType = exports.TableKeyType || (exports.TableKeyType = {}));
33462
33474
  class TableType extends _abstract_type_1.AbstractType {
33463
33475
  constructor(rowType, options, qualifiedName) {
33464
33476
  var _a;
@@ -33498,6 +33510,7 @@ class TableType extends _abstract_type_1.AbstractType {
33498
33510
  isGeneric() {
33499
33511
  var _a, _b;
33500
33512
  if (((_a = this.options.primaryKey) === null || _a === void 0 ? void 0 : _a.type) !== TableAccessType.standard
33513
+ && this.options.keyType === TableKeyType.user
33501
33514
  && ((_b = this.options.primaryKey) === null || _b === void 0 ? void 0 : _b.keyFields.length) === 0) {
33502
33515
  return true;
33503
33516
  }
@@ -34304,10 +34317,10 @@ class FormDefinition extends _identifier_1.Identifier {
34304
34317
  let type = p.getType();
34305
34318
  const isStructure = param.findDirectTokenByText("STRUCTURE") !== undefined;
34306
34319
  if (isStructure) {
34307
- type = new basic_1.TableType(type, { withHeader: true });
34320
+ type = new basic_1.TableType(type, { withHeader: true, keyType: basic_1.TableKeyType.default });
34308
34321
  }
34309
34322
  if (type instanceof basic_1.TableType) {
34310
- type = new basic_1.TableType(type.getRowType(), { withHeader: true });
34323
+ type = new basic_1.TableType(type.getRowType(), { withHeader: true, keyType: basic_1.TableKeyType.default });
34311
34324
  }
34312
34325
  else if (!(type instanceof basic_1.UnknownType) && !(type instanceof basic_1.VoidType)) {
34313
34326
  type = new basic_1.UnknownType("FORM TABLES type must be table type");
@@ -36542,7 +36555,7 @@ class DDIC {
36542
36555
  case "%_C_POINTER":
36543
36556
  return new Types.HexType(8, qualifiedName);
36544
36557
  case "TABLE":
36545
- return new Types.TableType(new Types.AnyType(), { withHeader: false });
36558
+ return new Types.TableType(new Types.AnyType(), { withHeader: false, keyType: Types.TableKeyType.default });
36546
36559
  case "DATA":
36547
36560
  return new Types.AnyType({ qualifiedName: qualifiedName });
36548
36561
  case "NUMERIC":
@@ -45029,6 +45042,7 @@ class TableType extends _abstract_object_1.AbstractObject {
45029
45042
  var _a, _b, _c;
45030
45043
  const tableOptions = {
45031
45044
  withHeader: false,
45045
+ keyType: Types.TableKeyType.user,
45032
45046
  secondary: [],
45033
45047
  };
45034
45048
  for (const k of ((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.dd43v) || []) {
@@ -46237,7 +46251,7 @@ class Registry {
46237
46251
  }
46238
46252
  static abaplintVersion() {
46239
46253
  // magic, see build script "version.sh"
46240
- return "2.96.2";
46254
+ return "2.97.2";
46241
46255
  }
46242
46256
  getDDICReferences() {
46243
46257
  return this.references;
@@ -49663,7 +49677,7 @@ class ConstantClasses {
49663
49677
  title: "Validate constant classes",
49664
49678
  shortDescription: `Checks that a class contains exactly the constants corresponding to a domain's fixed values.`,
49665
49679
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-enumeration-classes-to-constants-interfaces`,
49666
- tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Experimental],
49680
+ tags: [_irule_1.RuleTag.Styleguide],
49667
49681
  };
49668
49682
  }
49669
49683
  initialize(reg) {
@@ -50927,7 +50941,7 @@ class Downport {
50927
50941
  return {
50928
50942
  key: "downport",
50929
50943
  title: "Downport statement",
50930
- shortDescription: `Experimental downport functionality`,
50944
+ shortDescription: `Downport functionality`,
50931
50945
  extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
50932
50946
  a higher level language version. If successful, various rules are applied to downport the statement.
50933
50947
  Target downport version is always v702, thus rule is only enabled if target version is v702.
@@ -50960,7 +50974,7 @@ Current rules:
50960
50974
  * MESSAGE with non simple source
50961
50975
 
50962
50976
  Only one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.`,
50963
- tags: [_irule_1.RuleTag.Experimental, _irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
50977
+ tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
50964
50978
  };
50965
50979
  }
50966
50980
  getConfig() {
@@ -56202,6 +56216,7 @@ __exportStar(__webpack_require__(/*! ./space_before_dot */ "./node_modules/@abap
56202
56216
  __exportStar(__webpack_require__(/*! ./sql_escape_host_variables */ "./node_modules/@abaplint/core/build/src/rules/sql_escape_host_variables.js"), exports);
56203
56217
  __exportStar(__webpack_require__(/*! ./start_at_tab */ "./node_modules/@abaplint/core/build/src/rules/start_at_tab.js"), exports);
56204
56218
  __exportStar(__webpack_require__(/*! ./static_call_via_instance */ "./node_modules/@abaplint/core/build/src/rules/static_call_via_instance.js"), exports);
56219
+ __exportStar(__webpack_require__(/*! ./strict_sql */ "./node_modules/@abaplint/core/build/src/rules/strict_sql.js"), exports);
56205
56220
  __exportStar(__webpack_require__(/*! ./superclass_final */ "./node_modules/@abaplint/core/build/src/rules/superclass_final.js"), exports);
56206
56221
  __exportStar(__webpack_require__(/*! ./superfluous_value */ "./node_modules/@abaplint/core/build/src/rules/superfluous_value.js"), exports);
56207
56222
  __exportStar(__webpack_require__(/*! ./sy_modification */ "./node_modules/@abaplint/core/build/src/rules/sy_modification.js"), exports);
@@ -63041,7 +63056,7 @@ class SQLEscapeHostVariables extends _abap_rule_1.ABAPRule {
63041
63056
  title: "Escape SQL host variables",
63042
63057
  shortDescription: `Escape SQL host variables, from 740sp05`,
63043
63058
  extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements`,
63044
- tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],
63059
+ tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Syntax],
63045
63060
  badExample: `SELECT * FROM tab INTO TABLE res WHERE field = val.`,
63046
63061
  goodExample: `SELECT * FROM tab INTO TABLE @res WHERE field = @val.`,
63047
63062
  };
@@ -63278,6 +63293,87 @@ exports.StaticCallViaInstance = StaticCallViaInstance;
63278
63293
 
63279
63294
  /***/ }),
63280
63295
 
63296
+ /***/ "./node_modules/@abaplint/core/build/src/rules/strict_sql.js":
63297
+ /*!*******************************************************************!*\
63298
+ !*** ./node_modules/@abaplint/core/build/src/rules/strict_sql.js ***!
63299
+ \*******************************************************************/
63300
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
63301
+
63302
+ "use strict";
63303
+
63304
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
63305
+ exports.StrictSQL = exports.StrictSQLConf = void 0;
63306
+ const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
63307
+ const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
63308
+ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
63309
+ const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
63310
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
63311
+ const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplint/core/build/src/version.js");
63312
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
63313
+ class StrictSQLConf extends _basic_rule_config_1.BasicRuleConfig {
63314
+ }
63315
+ exports.StrictSQLConf = StrictSQLConf;
63316
+ class StrictSQL extends _abap_rule_1.ABAPRule {
63317
+ constructor() {
63318
+ super(...arguments);
63319
+ this.conf = new StrictSQLConf();
63320
+ }
63321
+ getMetadata() {
63322
+ return {
63323
+ key: "strict_sql",
63324
+ title: "Strict SQL",
63325
+ shortDescription: `Strict SQL`,
63326
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
63327
+
63328
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
63329
+
63330
+ Also see separate rule sql_escape_host_variables`,
63331
+ tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Syntax],
63332
+ };
63333
+ }
63334
+ getConfig() {
63335
+ return this.conf;
63336
+ }
63337
+ setConfig(conf) {
63338
+ this.conf = conf;
63339
+ }
63340
+ runParsed(file, obj) {
63341
+ const issues = [];
63342
+ const type = obj.getType();
63343
+ if (type === "INTF" || type === "TYPE") {
63344
+ return [];
63345
+ }
63346
+ if (this.reg.getConfig().getVersion() < version_1.Version.v740sp02
63347
+ && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {
63348
+ return [];
63349
+ }
63350
+ for (const s of file.getStatements()) {
63351
+ if (s.get() instanceof Statements.Select
63352
+ || s.get() instanceof Statements.SelectLoop) {
63353
+ const expr = s.findDirectExpression(Expressions.Select);
63354
+ const where = expr === null || expr === void 0 ? void 0 : expr.findDirectExpression(Expressions.SQLCond);
63355
+ const into = (expr === null || expr === void 0 ? void 0 : expr.findDirectExpression(Expressions.SQLIntoStructure))
63356
+ || (expr === null || expr === void 0 ? void 0 : expr.findDirectExpression(Expressions.SQLIntoTable));
63357
+ if (into === undefined || where === undefined) {
63358
+ continue;
63359
+ }
63360
+ if (where.getFirstToken().getStart().isBefore(into.getFirstToken().getStart())) {
63361
+ continue;
63362
+ }
63363
+ const message = "INTO/APPENDING must be last in strict SQL";
63364
+ const issue = issue_1.Issue.atToken(file, s.getFirstToken(), message, this.getMetadata().key, this.conf.severity);
63365
+ issues.push(issue);
63366
+ break;
63367
+ }
63368
+ }
63369
+ return issues;
63370
+ }
63371
+ }
63372
+ exports.StrictSQL = StrictSQL;
63373
+ //# sourceMappingURL=strict_sql.js.map
63374
+
63375
+ /***/ }),
63376
+
63281
63377
  /***/ "./node_modules/@abaplint/core/build/src/rules/superclass_final.js":
63282
63378
  /*!*************************************************************************!*\
63283
63379
  !*** ./node_modules/@abaplint/core/build/src/rules/superclass_final.js ***!
@@ -77454,13 +77550,14 @@ class Traversal {
77454
77550
  return undefined;
77455
77551
  }
77456
77552
  buildAttributes(def) {
77553
+ var _a, _b;
77457
77554
  const attr = [];
77458
77555
  // TODO: visibility is wrong for classes
77459
- for (const a of (def === null || def === void 0 ? void 0 : def.getAttributes().getAll()) || []) {
77556
+ for (const a of ((_a = def === null || def === void 0 ? void 0 : def.getAttributes()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {
77460
77557
  const type = new transpile_types_1.TranspileTypes().toType(a.getType());
77461
77558
  attr.push(`"${a.getName().toUpperCase()}": {"type": () => {return ${type};}, "visibility": "U", "is_constant": " "}`);
77462
77559
  }
77463
- for (const a of (def === null || def === void 0 ? void 0 : def.getAttributes().getConstants()) || []) {
77560
+ for (const a of ((_b = def === null || def === void 0 ? void 0 : def.getAttributes()) === null || _b === void 0 ? void 0 : _b.getConstants()) || []) {
77464
77561
  const type = new transpile_types_1.TranspileTypes().toType(a.getType());
77465
77562
  attr.push(`"${a.getName().toUpperCase()}": {"type": () => {return ${type};}, "visibility": "U", "is_constant": "X"}`);
77466
77563
  }
@@ -77572,6 +77669,7 @@ class Traversal {
77572
77669
  return undefined;
77573
77670
  }
77574
77671
  buildConstructorContents(scope, def) {
77672
+ var _a, _b, _c;
77575
77673
  let ret = "";
77576
77674
  if (def.getSuperClass() !== undefined
77577
77675
  && def.getMethodDefinitions().getByName("CONSTRUCTOR") === undefined) {
@@ -77580,7 +77678,7 @@ class Traversal {
77580
77678
  const cName = Traversal.escapeNamespace(def.getName().toLowerCase());
77581
77679
  ret += "this.me = new abap.types.ABAPObject();\n";
77582
77680
  ret += "this.me.set(this);\n";
77583
- for (const a of def.getAttributes().getAll()) {
77681
+ for (const a of ((_a = def.getAttributes()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {
77584
77682
  if (a.getMeta().includes("static" /* abaplint.IdentifierMeta.Static */) === true) {
77585
77683
  continue;
77586
77684
  }
@@ -77593,11 +77691,11 @@ class Traversal {
77593
77691
  ret += this.dataFromInterfaces(i.name, scope);
77594
77692
  }
77595
77693
  // handle aliases after initialization of carrier variables
77596
- for (const a of def.getAliases().getAll()) {
77694
+ for (const a of ((_b = def.getAliases()) === null || _b === void 0 ? void 0 : _b.getAll()) || []) {
77597
77695
  ret += "this." + a.getName().toLowerCase() + " = this." + Traversal.escapeNamespace(a.getComponent().replace("~", "$").toLowerCase()) + ";\n";
77598
77696
  }
77599
77697
  // constants can be accessed both statically and via reference
77600
- for (const c of def.getAttributes().getConstants()) {
77698
+ for (const c of ((_c = def.getAttributes()) === null || _c === void 0 ? void 0 : _c.getConstants()) || []) {
77601
77699
  ret += "this." + Traversal.escapeNamespace(c.getName().toLowerCase()) + " = " + cName + "." + Traversal.escapeNamespace(c.getName().toLowerCase()) + ";\n";
77602
77700
  }
77603
77701
  return ret;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.5.72",
3
+ "version": "2.5.74",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "bin": {
6
6
  "abap_transpile": "./abap_transpile"
@@ -25,12 +25,12 @@
25
25
  "author": "abaplint",
26
26
  "license": "MIT",
27
27
  "devDependencies": {
28
- "@abaplint/transpiler": "^2.5.72",
28
+ "@abaplint/transpiler": "^2.5.74",
29
29
  "@types/glob": "^7.2.0",
30
30
  "glob": "=7.2.0",
31
31
  "@types/progress": "^2.0.5",
32
32
  "@types/node": "^18.15.11",
33
- "@abaplint/core": "^2.96.2",
33
+ "@abaplint/core": "^2.97.2",
34
34
  "progress": "^2.0.3",
35
35
  "webpack": "^5.77.0",
36
36
  "webpack-cli": "^5.0.1",