@abaplint/transpiler-cli 2.5.72 → 2.5.73

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 +132 -36
  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
@@ -20811,7 +20811,7 @@ class BasicTypes {
20811
20811
  const isNamed = (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpression(expressions_1.Field)) !== undefined;
20812
20812
  const primaryKey = {
20813
20813
  name: "primary_key",
20814
- type: type,
20814
+ type: type || basic_1.TableAccessType.standard,
20815
20815
  isUnique: isNamed ? false : (firstKey === null || firstKey === void 0 ? void 0 : firstKey.concatTokens().toUpperCase().includes("WITH UNIQUE ")) === true,
20816
20816
  keyFields: [],
20817
20817
  };
@@ -20820,9 +20820,6 @@ class BasicTypes {
20820
20820
  for (const k of (firstKey === null || firstKey === void 0 ? void 0 : firstKey.findDirectExpressions(expressions_1.FieldSub)) || []) {
20821
20821
  primaryKey.keyFields.push(k.concatTokens().toUpperCase());
20822
20822
  }
20823
- if (primaryKey.keyFields.length === 0 && text.includes(" DEFAULT KEY")) {
20824
- primaryKey.keyFields.push("TABLE_LINE");
20825
- }
20826
20823
  }
20827
20824
  else {
20828
20825
  start = 0;
@@ -20845,8 +20842,16 @@ class BasicTypes {
20845
20842
  }
20846
20843
  secondaryKeys.push(secondary);
20847
20844
  }
20845
+ let keyType = Types.TableKeyType.user;
20846
+ if (text.includes(" EMPTY KEY")) {
20847
+ keyType = Types.TableKeyType.empty;
20848
+ }
20849
+ else if (text.includes(" DEFAULT KEY")) {
20850
+ keyType = Types.TableKeyType.default;
20851
+ }
20848
20852
  const options = {
20849
20853
  withHeader: text.includes(" WITH HEADER LINE"),
20854
+ keyType: keyType,
20850
20855
  primaryKey: primaryKey,
20851
20856
  secondary: secondaryKeys,
20852
20857
  };
@@ -20993,7 +20998,7 @@ class BasicTypes {
20993
20998
  || text === "TYPE HASHED TABLE"
20994
20999
  || text === "TYPE INDEX TABLE"
20995
21000
  || text === "TYPE ANY TABLE") {
20996
- return new Types.TableType(new Types.AnyType(), { withHeader: node.concatTokens().toUpperCase().includes("WITH HEADER LINE") });
21001
+ return new Types.TableType(new Types.AnyType(), { withHeader: node.concatTokens().toUpperCase().includes("WITH HEADER LINE"), keyType: Types.TableKeyType.default });
20997
21002
  }
20998
21003
  else if (text.startsWith("LIKE ")) {
20999
21004
  let sub = node.findFirstExpression(Expressions.Type);
@@ -21011,7 +21016,7 @@ class BasicTypes {
21011
21016
  }
21012
21017
  found = this.resolveLikeName(sub);
21013
21018
  if (found && this.isOccurs(node)) {
21014
- found = new Types.TableType(found, { withHeader: text.includes("WITH HEADER LINE") }, qualifiedName);
21019
+ found = new Types.TableType(found, { withHeader: text.includes("WITH HEADER LINE"), keyType: Types.TableKeyType.default }, qualifiedName);
21015
21020
  }
21016
21021
  }
21017
21022
  else if (text.startsWith("TYPE LINE OF ")) {
@@ -21040,17 +21045,17 @@ class BasicTypes {
21040
21045
  found = this.resolveTypeName(typeName, this.findLength(node), this.findDecimals(node), qualifiedName);
21041
21046
  const concat = node.concatTokens().toUpperCase();
21042
21047
  if (found && this.isOccurs(node)) {
21043
- found = new Types.TableType(found, { withHeader: concat.includes(" WITH HEADER LINE") }, qualifiedName);
21048
+ found = new Types.TableType(found, { withHeader: concat.includes(" WITH HEADER LINE"), keyType: Types.TableKeyType.default }, qualifiedName);
21044
21049
  }
21045
21050
  else if (found && concat.includes(" WITH HEADER LINE")) {
21046
21051
  if (found instanceof Types.VoidType) {
21047
- found = new Types.TableType(found, { withHeader: true });
21052
+ found = new Types.TableType(found, { withHeader: true, keyType: Types.TableKeyType.default });
21048
21053
  }
21049
21054
  else if (!(found instanceof Types.TableType)) {
21050
21055
  throw new Error("WITH HEADER LINE can only be used with internal table");
21051
21056
  }
21052
21057
  else {
21053
- found = new Types.TableType(found.getRowType(), { withHeader: true });
21058
+ found = new Types.TableType(found.getRowType(), { withHeader: true, keyType: Types.TableKeyType.default });
21054
21059
  }
21055
21060
  }
21056
21061
  if (found === undefined && typeName === undefined) {
@@ -21064,7 +21069,7 @@ class BasicTypes {
21064
21069
  }
21065
21070
  found = new Types.CharacterType(length, { qualifiedName: qualifiedName }); // fallback
21066
21071
  if (this.isOccurs(node)) {
21067
- found = new Types.TableType(found, { withHeader: concat.includes(" WITH HEADER LINE") }, qualifiedName);
21072
+ found = new Types.TableType(found, { withHeader: concat.includes(" WITH HEADER LINE"), keyType: Types.TableKeyType.default }, qualifiedName);
21068
21073
  }
21069
21074
  }
21070
21075
  }
@@ -26237,7 +26242,7 @@ class Controls {
26237
26242
  { name: "LINE_SELECTOR", type: new basic_1.CharacterType(1) },
26238
26243
  { name: "H_GRID", type: new basic_1.CharacterType(1) },
26239
26244
  { name: "V_GRID", type: new basic_1.CharacterType(1) },
26240
- { name: "COLS", type: new basic_1.TableType(cols, { withHeader: false }) },
26245
+ { name: "COLS", type: new basic_1.TableType(cols, { withHeader: false, keyType: basic_1.TableKeyType.default }) },
26241
26246
  { name: "INVISIBLE", type: new basic_1.CharacterType(1) },
26242
26247
  ]);
26243
26248
  const id = new _typed_identifier_1.TypedIdentifier(token, filename, type);
@@ -26884,13 +26889,13 @@ class Find {
26884
26889
  { name: "LINE", type: new basic_1.IntegerType() },
26885
26890
  { name: "OFFSET", type: new basic_1.IntegerType() },
26886
26891
  { name: "LENGTH", type: new basic_1.IntegerType() },
26887
- { name: "SUBMATCHES", type: new basic_1.TableType(sub, { withHeader: false }) },
26892
+ { name: "SUBMATCHES", type: new basic_1.TableType(sub, { withHeader: false, keyType: basic_1.TableKeyType.default }) },
26888
26893
  ], "MATCH_RESULT", "MATCH_RESULT");
26889
26894
  if (node.concatTokens().toUpperCase().startsWith("FIND FIRST")) {
26890
26895
  this.inline(rfound, scope, filename, type);
26891
26896
  }
26892
26897
  else {
26893
- this.inline(rfound, scope, filename, new basic_1.TableType(type, { withHeader: false }, "MATCH_RESULT_TAB"));
26898
+ this.inline(rfound, scope, filename, new basic_1.TableType(type, { withHeader: false, keyType: basic_1.TableKeyType.default }, "MATCH_RESULT_TAB"));
26894
26899
  }
26895
26900
  }
26896
26901
  const ofound = node.findExpressionsAfterToken("OFFSET");
@@ -28420,7 +28425,7 @@ class Ranges {
28420
28425
  { name: "low", type: found },
28421
28426
  { name: "high", type: found },
28422
28427
  ]);
28423
- const type = new basic_1.TableType(structure, { withHeader: true });
28428
+ const type = new basic_1.TableType(structure, { withHeader: true, keyType: basic_1.TableKeyType.default });
28424
28429
  const id = new _typed_identifier_1.TypedIdentifier(nameToken, filename, type);
28425
28430
  scope.addIdentifier(id);
28426
28431
  }
@@ -28880,7 +28885,7 @@ class SelectOption {
28880
28885
  { name: "LOW", type: found },
28881
28886
  { name: "HIGH", type: found },
28882
28887
  ]);
28883
- scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, filename, new basic_1.TableType(stru, { withHeader: true })));
28888
+ scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, filename, new basic_1.TableType(stru, { withHeader: true, keyType: basic_1.TableKeyType.default })));
28884
28889
  return;
28885
28890
  }
28886
28891
  if (nameToken) {
@@ -29167,7 +29172,7 @@ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/
29167
29172
  class Split {
29168
29173
  runSyntax(node, scope, filename) {
29169
29174
  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();
29175
+ const type = intoTable ? new basic_1.TableType(new basic_1.StringType(), { withHeader: false, keyType: basic_1.TableKeyType.default }) : new basic_1.StringType();
29171
29176
  for (const target of node.findAllExpressions(Expressions.Target)) {
29172
29177
  const inline = target.findDirectExpression(Expressions.InlineData);
29173
29178
  if (inline) {
@@ -30042,7 +30047,7 @@ class Data {
30042
30047
  }
30043
30048
  if (found instanceof Basic.VoidType) {
30044
30049
  if (table === true) {
30045
- return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(found, { withHeader: true }));
30050
+ return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(found, { withHeader: true, keyType: Basic.TableKeyType.default }));
30046
30051
  }
30047
30052
  else {
30048
30053
  return new _typed_identifier_1.TypedIdentifier(name, filename, found);
@@ -30060,7 +30065,7 @@ class Data {
30060
30065
  }
30061
30066
  }
30062
30067
  if (table === true) {
30063
- return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(new Basic.StructureType(components), { withHeader: true }));
30068
+ return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(new Basic.StructureType(components), { withHeader: true, keyType: Basic.TableKeyType.default }));
30064
30069
  }
30065
30070
  else {
30066
30071
  const val = Object.keys(values).length > 0 ? values : undefined;
@@ -30131,7 +30136,7 @@ class Statics {
30131
30136
  }
30132
30137
  if (found instanceof Basic.VoidType) {
30133
30138
  if (table === true) {
30134
- return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(found, { withHeader: true }));
30139
+ return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(found, { withHeader: true, keyType: Basic.TableKeyType.default }));
30135
30140
  }
30136
30141
  else {
30137
30142
  return new _typed_identifier_1.TypedIdentifier(name, filename, found);
@@ -30149,7 +30154,7 @@ class Statics {
30149
30154
  }
30150
30155
  }
30151
30156
  if (table === true) {
30152
- return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(new Basic.StructureType(components), { withHeader: true }));
30157
+ return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(new Basic.StructureType(components), { withHeader: true, keyType: Basic.TableKeyType.default }));
30153
30158
  }
30154
30159
  else {
30155
30160
  return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.StructureType(components));
@@ -33449,7 +33454,7 @@ exports.StructureType = StructureType;
33449
33454
  "use strict";
33450
33455
 
33451
33456
  Object.defineProperty(exports, "__esModule", ({ value: true }));
33452
- exports.TableType = exports.TableAccessType = void 0;
33457
+ exports.TableType = exports.TableKeyType = exports.TableAccessType = void 0;
33453
33458
  const _abstract_type_1 = __webpack_require__(/*! ./_abstract_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/_abstract_type.js");
33454
33459
  var TableAccessType;
33455
33460
  (function (TableAccessType) {
@@ -33459,6 +33464,12 @@ var TableAccessType;
33459
33464
  TableAccessType["index"] = "INDEX";
33460
33465
  TableAccessType["any"] = "ANY";
33461
33466
  })(TableAccessType = exports.TableAccessType || (exports.TableAccessType = {}));
33467
+ var TableKeyType;
33468
+ (function (TableKeyType) {
33469
+ TableKeyType["default"] = "DEFAULT";
33470
+ TableKeyType["user"] = "USER";
33471
+ TableKeyType["empty"] = "EMPTY";
33472
+ })(TableKeyType = exports.TableKeyType || (exports.TableKeyType = {}));
33462
33473
  class TableType extends _abstract_type_1.AbstractType {
33463
33474
  constructor(rowType, options, qualifiedName) {
33464
33475
  var _a;
@@ -33498,6 +33509,7 @@ class TableType extends _abstract_type_1.AbstractType {
33498
33509
  isGeneric() {
33499
33510
  var _a, _b;
33500
33511
  if (((_a = this.options.primaryKey) === null || _a === void 0 ? void 0 : _a.type) !== TableAccessType.standard
33512
+ && this.options.keyType === TableKeyType.user
33501
33513
  && ((_b = this.options.primaryKey) === null || _b === void 0 ? void 0 : _b.keyFields.length) === 0) {
33502
33514
  return true;
33503
33515
  }
@@ -34304,10 +34316,10 @@ class FormDefinition extends _identifier_1.Identifier {
34304
34316
  let type = p.getType();
34305
34317
  const isStructure = param.findDirectTokenByText("STRUCTURE") !== undefined;
34306
34318
  if (isStructure) {
34307
- type = new basic_1.TableType(type, { withHeader: true });
34319
+ type = new basic_1.TableType(type, { withHeader: true, keyType: basic_1.TableKeyType.default });
34308
34320
  }
34309
34321
  if (type instanceof basic_1.TableType) {
34310
- type = new basic_1.TableType(type.getRowType(), { withHeader: true });
34322
+ type = new basic_1.TableType(type.getRowType(), { withHeader: true, keyType: basic_1.TableKeyType.default });
34311
34323
  }
34312
34324
  else if (!(type instanceof basic_1.UnknownType) && !(type instanceof basic_1.VoidType)) {
34313
34325
  type = new basic_1.UnknownType("FORM TABLES type must be table type");
@@ -36542,7 +36554,7 @@ class DDIC {
36542
36554
  case "%_C_POINTER":
36543
36555
  return new Types.HexType(8, qualifiedName);
36544
36556
  case "TABLE":
36545
- return new Types.TableType(new Types.AnyType(), { withHeader: false });
36557
+ return new Types.TableType(new Types.AnyType(), { withHeader: false, keyType: Types.TableKeyType.default });
36546
36558
  case "DATA":
36547
36559
  return new Types.AnyType({ qualifiedName: qualifiedName });
36548
36560
  case "NUMERIC":
@@ -45029,6 +45041,7 @@ class TableType extends _abstract_object_1.AbstractObject {
45029
45041
  var _a, _b, _c;
45030
45042
  const tableOptions = {
45031
45043
  withHeader: false,
45044
+ keyType: Types.TableKeyType.user,
45032
45045
  secondary: [],
45033
45046
  };
45034
45047
  for (const k of ((_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.dd43v) || []) {
@@ -46237,7 +46250,7 @@ class Registry {
46237
46250
  }
46238
46251
  static abaplintVersion() {
46239
46252
  // magic, see build script "version.sh"
46240
- return "2.96.2";
46253
+ return "2.97.0";
46241
46254
  }
46242
46255
  getDDICReferences() {
46243
46256
  return this.references;
@@ -49663,7 +49676,7 @@ class ConstantClasses {
49663
49676
  title: "Validate constant classes",
49664
49677
  shortDescription: `Checks that a class contains exactly the constants corresponding to a domain's fixed values.`,
49665
49678
  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],
49679
+ tags: [_irule_1.RuleTag.Styleguide],
49667
49680
  };
49668
49681
  }
49669
49682
  initialize(reg) {
@@ -50927,7 +50940,7 @@ class Downport {
50927
50940
  return {
50928
50941
  key: "downport",
50929
50942
  title: "Downport statement",
50930
- shortDescription: `Experimental downport functionality`,
50943
+ shortDescription: `Downport functionality`,
50931
50944
  extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with
50932
50945
  a higher level language version. If successful, various rules are applied to downport the statement.
50933
50946
  Target downport version is always v702, thus rule is only enabled if target version is v702.
@@ -50960,7 +50973,7 @@ Current rules:
50960
50973
  * MESSAGE with non simple source
50961
50974
 
50962
50975
  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],
50976
+ tags: [_irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],
50964
50977
  };
50965
50978
  }
50966
50979
  getConfig() {
@@ -56202,6 +56215,7 @@ __exportStar(__webpack_require__(/*! ./space_before_dot */ "./node_modules/@abap
56202
56215
  __exportStar(__webpack_require__(/*! ./sql_escape_host_variables */ "./node_modules/@abaplint/core/build/src/rules/sql_escape_host_variables.js"), exports);
56203
56216
  __exportStar(__webpack_require__(/*! ./start_at_tab */ "./node_modules/@abaplint/core/build/src/rules/start_at_tab.js"), exports);
56204
56217
  __exportStar(__webpack_require__(/*! ./static_call_via_instance */ "./node_modules/@abaplint/core/build/src/rules/static_call_via_instance.js"), exports);
56218
+ __exportStar(__webpack_require__(/*! ./strict_sql */ "./node_modules/@abaplint/core/build/src/rules/strict_sql.js"), exports);
56205
56219
  __exportStar(__webpack_require__(/*! ./superclass_final */ "./node_modules/@abaplint/core/build/src/rules/superclass_final.js"), exports);
56206
56220
  __exportStar(__webpack_require__(/*! ./superfluous_value */ "./node_modules/@abaplint/core/build/src/rules/superfluous_value.js"), exports);
56207
56221
  __exportStar(__webpack_require__(/*! ./sy_modification */ "./node_modules/@abaplint/core/build/src/rules/sy_modification.js"), exports);
@@ -63041,7 +63055,7 @@ class SQLEscapeHostVariables extends _abap_rule_1.ABAPRule {
63041
63055
  title: "Escape SQL host variables",
63042
63056
  shortDescription: `Escape SQL host variables, from 740sp05`,
63043
63057
  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],
63058
+ tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Syntax],
63045
63059
  badExample: `SELECT * FROM tab INTO TABLE res WHERE field = val.`,
63046
63060
  goodExample: `SELECT * FROM tab INTO TABLE @res WHERE field = @val.`,
63047
63061
  };
@@ -63278,6 +63292,87 @@ exports.StaticCallViaInstance = StaticCallViaInstance;
63278
63292
 
63279
63293
  /***/ }),
63280
63294
 
63295
+ /***/ "./node_modules/@abaplint/core/build/src/rules/strict_sql.js":
63296
+ /*!*******************************************************************!*\
63297
+ !*** ./node_modules/@abaplint/core/build/src/rules/strict_sql.js ***!
63298
+ \*******************************************************************/
63299
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
63300
+
63301
+ "use strict";
63302
+
63303
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
63304
+ exports.StrictSQL = exports.StrictSQLConf = void 0;
63305
+ const Statements = __webpack_require__(/*! ../abap/2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
63306
+ const Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
63307
+ const issue_1 = __webpack_require__(/*! ../issue */ "./node_modules/@abaplint/core/build/src/issue.js");
63308
+ const _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ "./node_modules/@abaplint/core/build/src/rules/_abap_rule.js");
63309
+ const _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ "./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js");
63310
+ const version_1 = __webpack_require__(/*! ../version */ "./node_modules/@abaplint/core/build/src/version.js");
63311
+ const _irule_1 = __webpack_require__(/*! ./_irule */ "./node_modules/@abaplint/core/build/src/rules/_irule.js");
63312
+ class StrictSQLConf extends _basic_rule_config_1.BasicRuleConfig {
63313
+ }
63314
+ exports.StrictSQLConf = StrictSQLConf;
63315
+ class StrictSQL extends _abap_rule_1.ABAPRule {
63316
+ constructor() {
63317
+ super(...arguments);
63318
+ this.conf = new StrictSQLConf();
63319
+ }
63320
+ getMetadata() {
63321
+ return {
63322
+ key: "strict_sql",
63323
+ title: "Strict SQL",
63324
+ shortDescription: `Strict SQL`,
63325
+ extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapinto_clause.htm
63326
+
63327
+ https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenopensql_strict_mode_750.htm
63328
+
63329
+ Also see separate rule sql_escape_host_variables`,
63330
+ tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Syntax],
63331
+ };
63332
+ }
63333
+ getConfig() {
63334
+ return this.conf;
63335
+ }
63336
+ setConfig(conf) {
63337
+ this.conf = conf;
63338
+ }
63339
+ runParsed(file, obj) {
63340
+ const issues = [];
63341
+ const type = obj.getType();
63342
+ if (type === "INTF" || type === "TYPE") {
63343
+ return [];
63344
+ }
63345
+ if (this.reg.getConfig().getVersion() < version_1.Version.v740sp02
63346
+ && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {
63347
+ return [];
63348
+ }
63349
+ for (const s of file.getStatements()) {
63350
+ if (s.get() instanceof Statements.Select
63351
+ || s.get() instanceof Statements.SelectLoop) {
63352
+ const expr = s.findDirectExpression(Expressions.Select);
63353
+ const where = expr === null || expr === void 0 ? void 0 : expr.findDirectExpression(Expressions.SQLCond);
63354
+ const into = (expr === null || expr === void 0 ? void 0 : expr.findDirectExpression(Expressions.SQLIntoStructure))
63355
+ || (expr === null || expr === void 0 ? void 0 : expr.findDirectExpression(Expressions.SQLIntoTable));
63356
+ if (into === undefined || where === undefined) {
63357
+ continue;
63358
+ }
63359
+ if (where.getFirstToken().getStart().isBefore(into.getFirstToken().getStart())) {
63360
+ continue;
63361
+ }
63362
+ const message = "INTO/APPENDING must be last in strict SQL";
63363
+ const issue = issue_1.Issue.atToken(file, s.getFirstToken(), message, this.getMetadata().key, this.conf.severity);
63364
+ issues.push(issue);
63365
+ break;
63366
+ }
63367
+ }
63368
+ return issues;
63369
+ }
63370
+ }
63371
+ exports.StrictSQL = StrictSQL;
63372
+ //# sourceMappingURL=strict_sql.js.map
63373
+
63374
+ /***/ }),
63375
+
63281
63376
  /***/ "./node_modules/@abaplint/core/build/src/rules/superclass_final.js":
63282
63377
  /*!*************************************************************************!*\
63283
63378
  !*** ./node_modules/@abaplint/core/build/src/rules/superclass_final.js ***!
@@ -77454,13 +77549,14 @@ class Traversal {
77454
77549
  return undefined;
77455
77550
  }
77456
77551
  buildAttributes(def) {
77552
+ var _a, _b;
77457
77553
  const attr = [];
77458
77554
  // TODO: visibility is wrong for classes
77459
- for (const a of (def === null || def === void 0 ? void 0 : def.getAttributes().getAll()) || []) {
77555
+ for (const a of ((_a = def === null || def === void 0 ? void 0 : def.getAttributes()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {
77460
77556
  const type = new transpile_types_1.TranspileTypes().toType(a.getType());
77461
77557
  attr.push(`"${a.getName().toUpperCase()}": {"type": () => {return ${type};}, "visibility": "U", "is_constant": " "}`);
77462
77558
  }
77463
- for (const a of (def === null || def === void 0 ? void 0 : def.getAttributes().getConstants()) || []) {
77559
+ for (const a of ((_b = def === null || def === void 0 ? void 0 : def.getAttributes()) === null || _b === void 0 ? void 0 : _b.getConstants()) || []) {
77464
77560
  const type = new transpile_types_1.TranspileTypes().toType(a.getType());
77465
77561
  attr.push(`"${a.getName().toUpperCase()}": {"type": () => {return ${type};}, "visibility": "U", "is_constant": "X"}`);
77466
77562
  }
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.73",
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.73",
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.0",
34
34
  "progress": "^2.0.3",
35
35
  "webpack": "^5.77.0",
36
36
  "webpack-cli": "^5.0.1",