@abaplint/transpiler-cli 2.7.28 → 2.7.30

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 +61 -18
  2. package/package.json +4 -4
package/build/bundle.js CHANGED
@@ -20721,6 +20721,9 @@ class TypeUtils {
20721
20721
  }
20722
20722
  return source.getLength() === target.getLength();
20723
20723
  }
20724
+ else if (target instanceof basic_1.XStringType) {
20725
+ return false;
20726
+ }
20724
20727
  else if (target instanceof basic_1.IntegerType) {
20725
20728
  if (((_e = source.getAbstractTypeData()) === null || _e === void 0 ? void 0 : _e.derivedFromConstant) === true) {
20726
20729
  return true;
@@ -20770,7 +20773,10 @@ class TypeUtils {
20770
20773
  }
20771
20774
  }
20772
20775
  else if (source instanceof basic_1.XStringType) {
20773
- if (target instanceof basic_1.CLikeType) {
20776
+ if (target instanceof basic_1.CLikeType
20777
+ || target instanceof basic_1.IntegerType
20778
+ || target instanceof basic_1.ObjectReferenceType
20779
+ || target instanceof basic_1.HexType) {
20774
20780
  return false;
20775
20781
  }
20776
20782
  }
@@ -24600,6 +24606,8 @@ class Source {
24600
24606
  switch (tok) {
24601
24607
  case "(":
24602
24608
  case "-":
24609
+ case "+":
24610
+ case "BIT":
24603
24611
  break;
24604
24612
  case "BOOLC":
24605
24613
  {
@@ -26141,22 +26149,22 @@ const dynamic_1 = __webpack_require__(/*! ../expressions/dynamic */ "./node_modu
26141
26149
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
26142
26150
  class Assign {
26143
26151
  runSyntax(node, scope, filename) {
26144
- var _a, _b;
26145
- const sources = node.findAllExpressions(Expressions.Source);
26146
- const firstSource = sources[0];
26147
- let sourceType = new source_1.Source().runSyntax(firstSource, scope, filename);
26148
- if (sourceType === undefined || ((_a = node.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Dynamic))) {
26152
+ var _a, _b, _c;
26153
+ const sources = ((_a = node.findDirectExpression(Expressions.AssignSource)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.Source)) || [];
26154
+ const theSource = sources[sources.length - 1];
26155
+ let sourceType = new source_1.Source().runSyntax(theSource, scope, filename);
26156
+ if (sourceType === undefined || ((_b = node.findDirectExpression(Expressions.AssignSource)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Dynamic))) {
26149
26157
  sourceType = new basic_1.VoidType("DynamicAssign");
26150
26158
  }
26151
- for (const d of ((_b = node.findDirectExpression(Expressions.AssignSource)) === null || _b === void 0 ? void 0 : _b.findAllExpressions(Expressions.Dynamic)) || []) {
26159
+ for (const d of ((_c = node.findDirectExpression(Expressions.AssignSource)) === null || _c === void 0 ? void 0 : _c.findAllExpressions(Expressions.Dynamic)) || []) {
26152
26160
  new dynamic_1.Dynamic().runSyntax(d, scope, filename);
26153
26161
  }
26154
26162
  const target = node.findDirectExpression(Expressions.FSTarget);
26155
26163
  if (target) {
26156
26164
  new fstarget_1.FSTarget().runSyntax(target, scope, filename, sourceType);
26157
26165
  }
26158
- for (const s of sources) {
26159
- if (s === firstSource) {
26166
+ for (const s of node.findAllExpressions(Expressions.Source)) {
26167
+ if (s === theSource) {
26160
26168
  continue;
26161
26169
  }
26162
26170
  new source_1.Source().runSyntax(s, scope, filename);
@@ -40015,7 +40023,11 @@ class Hover {
40015
40023
  return { kind: LServer.MarkupKind.Markdown, value: "String Template" };
40016
40024
  }
40017
40025
  else if (found.token instanceof Tokens.Comment) {
40018
- return { kind: LServer.MarkupKind.Markdown, value: "Comment" };
40026
+ let type = "Comment";
40027
+ if (found.token.getStr().startsWith(`"!`)) {
40028
+ type = "ABAP Doc Comment";
40029
+ }
40030
+ return { kind: LServer.MarkupKind.Markdown, value: type };
40019
40031
  }
40020
40032
  const lookup = _lookup_1.LSPLookup.lookup(found, this.reg, obj);
40021
40033
  if (lookup === null || lookup === void 0 ? void 0 : lookup.hover) {
@@ -47506,7 +47518,7 @@ class Registry {
47506
47518
  }
47507
47519
  static abaplintVersion() {
47508
47520
  // magic, see build script "version.sh"
47509
- return "2.101.28";
47521
+ return "2.101.32";
47510
47522
  }
47511
47523
  getDDICReferences() {
47512
47524
  return this.ddicReferences;
@@ -47824,7 +47836,9 @@ class SevenBitAscii {
47824
47836
  shortDescription: `Only allow characters from the 7bit ASCII set.`,
47825
47837
  extendedInformation: `https://docs.abapopenchecks.org/checks/05/
47826
47838
 
47827
- Checkes files with extension ".abap" and ".asddls"`,
47839
+ https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencharacter_set_guidl.htm
47840
+
47841
+ Checkes files with extensions ".abap" and ".asddls"`,
47828
47842
  tags: [_irule_1.RuleTag.SingleFile],
47829
47843
  };
47830
47844
  }
@@ -56144,9 +56158,11 @@ class FunctionModuleRecommendationsConf extends _basic_rule_config_1.BasicRuleCo
56144
56158
  constructor() {
56145
56159
  super(...arguments);
56146
56160
  /** Tuple of Function Module Name to be replaced, the recommended alternative and
56147
- * the version from which the recommendation is valid.*/
56161
+ * the version from which the recommendation is valid.
56162
+ * @uniqueItems true
56163
+ */
56148
56164
  this.recommendations = [
56149
- { name: "CALCULATE_HASH_FOR_RAW", replace: "use CL_ABAP_HMAC" },
56165
+ { name: "CALCULATE_HASH_FOR_RAW", replace: "use CL_ABAP_HMAC or CL_ABAP_MESSAGE_DIGEST" },
56150
56166
  { name: "ECATT_CONV_XSTRING_TO_STRING", replace: "use CL_BINARY_CONVERT" },
56151
56167
  { name: "F4_FILENAME", replace: "use CL_GUI_FRONTEND_SERVICES" },
56152
56168
  { name: "FUNCTION_EXISTS", replace: "surround with try-catch CX_SY_DYN_CALL_ILLEGAL_METHOD instead" },
@@ -56155,10 +56171,11 @@ class FunctionModuleRecommendationsConf extends _basic_rule_config_1.BasicRuleCo
56155
56171
  { name: "GUID_CREATE", replace: "use CL_SYSTEM_UUID" },
56156
56172
  { name: "IGN_TIMESTAMP_DIFFERENCE", replace: "use CL_ABAP_TSTMP" },
56157
56173
  { name: "IGN_TIMESTAMP_PLUSMINUS", replace: "use CL_ABAP_TSTMP" },
56174
+ { name: "ISM_SD_GET_PRICING_CONDITIONS", replace: "use CL_PRC_RESULT_FACTORY as per note 2220005" },
56158
56175
  { name: "JOB_CREATE", replace: "use CL_BP_ABAP_JOB" },
56159
56176
  { name: "JOB_SUBMIT", replace: "use CL_BP_ABAP_JOB" },
56160
- { name: "POPUP_TO_DECIDE", replace: "use POPUP_TO_CONFIRM" },
56161
56177
  { name: "POPUP_TO_CONFIRM_STEP", replace: "use POPUP_TO_CONFIRM" },
56178
+ { name: "POPUP_TO_DECIDE", replace: "use POPUP_TO_CONFIRM" },
56162
56179
  { name: "POPUP_TO_GET_VALUE", replace: "use POPUP_GET_VALUES" },
56163
56180
  { name: "REUSE_ALV_GRID_DISPLAY", replace: "use CL_SALV_TABLE=>FACTORY or CL_GUI_ALV_GRID" },
56164
56181
  { name: "ROUND", replace: "use built in function: round()" },
@@ -60098,7 +60115,7 @@ class MSAGConsistency {
60098
60115
  key: "msag_consistency",
60099
60116
  title: "MSAG consistency check",
60100
60117
  shortDescription: `Checks the validity of messages in message classes`,
60101
- extendedInformation: `Message numbers must be 3 digits, and message text must not be empty`,
60118
+ extendedInformation: `Message numbers must be 3 digits, message text must not be empty, no message number duplicates`,
60102
60119
  };
60103
60120
  }
60104
60121
  getDescription(reason) {
@@ -60118,6 +60135,7 @@ class MSAGConsistency {
60118
60135
  if (!(obj instanceof objects_1.MessageClass)) {
60119
60136
  return [];
60120
60137
  }
60138
+ const numbers = new Set();
60121
60139
  for (const message of obj.getMessages()) {
60122
60140
  // todo, get the right positions in xml file
60123
60141
  if (!message.getNumber().match(/\d\d\d/)) {
@@ -60132,6 +60150,16 @@ class MSAGConsistency {
60132
60150
  const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
60133
60151
  issues.push(issue);
60134
60152
  }
60153
+ const num = message.getNumber();
60154
+ if (numbers.has(num)) {
60155
+ const text = "Duplicate message number " + num;
60156
+ const position = new position_1.Position(1, 1);
60157
+ const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, text, this.getMetadata().key, this.conf.severity);
60158
+ issues.push(issue);
60159
+ }
60160
+ else {
60161
+ numbers.add(num);
60162
+ }
60135
60163
  }
60136
60164
  return issues;
60137
60165
  }
@@ -61260,6 +61288,16 @@ POSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.ht
61260
61288
  OCCURENCES: check for OCCURENCES vs OCCURRENCES
61261
61289
 
61262
61290
  CLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,
61291
+ badExample: `REFRESH itab.
61292
+
61293
+ COMPUTE foo = 2 + 2.
61294
+
61295
+ MULTIPLY lv_foo BY 2.
61296
+
61297
+ INTERFACE intf LOAD.
61298
+
61299
+ IF foo IS SUPPLIED.
61300
+ ENDIF.`,
61263
61301
  };
61264
61302
  }
61265
61303
  getConfig() {
@@ -63891,7 +63929,9 @@ class SelectSingleFullKey {
63891
63929
  key: "select_single_full_key",
63892
63930
  title: "Detect SELECT SINGLE which are possibily not unique",
63893
63931
  shortDescription: `Detect SELECT SINGLE which are possibily not unique`,
63894
- extendedInformation: `Table definitions must be known, ie. inside the errorNamespace`,
63932
+ extendedInformation: `Table definitions must be known, ie. inside the errorNamespace
63933
+
63934
+ If the statement contains a JOIN it is not checked`,
63895
63935
  pseudoComment: "EC CI_NOORDER",
63896
63936
  tags: [],
63897
63937
  };
@@ -63932,6 +63972,9 @@ class SelectSingleFullKey {
63932
63972
  if (!(s.get() instanceof __1.Statements.Select)) {
63933
63973
  continue;
63934
63974
  }
63975
+ else if (s.findFirstExpression(__1.Expressions.SQLJoin)) {
63976
+ continue;
63977
+ }
63935
63978
  else if (s.findTokenSequencePosition("SELECT", "SINGLE") === undefined) {
63936
63979
  continue;
63937
63980
  }
@@ -80203,7 +80246,7 @@ class Traversal {
80203
80246
  if (s === undefined) {
80204
80247
  continue;
80205
80248
  }
80206
- handle(s, name + ".get()." + v);
80249
+ handle(s, name + ".get()." + v.toLowerCase());
80207
80250
  }
80208
80251
  }
80209
80252
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.7.28",
3
+ "version": "2.7.30",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -26,12 +26,12 @@
26
26
  "author": "abaplint",
27
27
  "license": "MIT",
28
28
  "devDependencies": {
29
- "@abaplint/transpiler": "^2.7.28",
29
+ "@abaplint/transpiler": "^2.7.30",
30
30
  "@types/glob": "^7.2.0",
31
31
  "glob": "=7.2.0",
32
32
  "@types/progress": "^2.0.5",
33
- "@types/node": "^20.3.2",
34
- "@abaplint/core": "^2.101.28",
33
+ "@types/node": "^20.4.0",
34
+ "@abaplint/core": "^2.101.32",
35
35
  "progress": "^2.0.3",
36
36
  "webpack": "^5.88.1",
37
37
  "webpack-cli": "^5.1.4",