@abaplint/cli 2.119.8 → 2.119.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/build/cli.js +44 -15
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -28614,6 +28614,9 @@ class Select {
28614
28614
  const ret = [];
28615
28615
  if (node.get() instanceof Expressions.SelectLoop) {
28616
28616
  expr = node.findFirstExpression(Expressions.SQLFieldListLoop);
28617
+ if (expr === undefined) {
28618
+ expr = node;
28619
+ }
28617
28620
  }
28618
28621
  else {
28619
28622
  expr = node.findFirstExpression(Expressions.SQLFieldList);
@@ -28621,7 +28624,8 @@ class Select {
28621
28624
  if (((_a = expr === null || expr === void 0 ? void 0 : expr.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Dynamic) {
28622
28625
  dynamic_1.Dynamic.runSyntax(expr.getFirstChild(), input);
28623
28626
  }
28624
- for (const field of (expr === null || expr === void 0 ? void 0 : expr.findDirectExpressionsMulti([Expressions.SQLField, Expressions.SQLFieldName])) || []) {
28627
+ // eslint-disable-next-line max-len
28628
+ for (const field of (expr === null || expr === void 0 ? void 0 : expr.findDirectExpressionsMulti([Expressions.SQLField, Expressions.SQLFieldName, Expressions.SQLAggregation])) || []) {
28625
28629
  let code = field.concatTokens().toUpperCase();
28626
28630
  const as = ((_b = field.findDirectExpression(Expressions.SQLAsName)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || "";
28627
28631
  if (as !== "") {
@@ -28710,6 +28714,7 @@ const assert_error_1 = __webpack_require__(/*! ../assert_error */ "./node_module
28710
28714
  // TODO: refactor all these method parameters to objects, this is getting messy
28711
28715
  class Source {
28712
28716
  static runSyntax(node, input, targetType, writeReference = false, allowGenericDeference = false) {
28717
+ var _a;
28713
28718
  if (node === undefined) {
28714
28719
  return undefined;
28715
28720
  }
@@ -28787,12 +28792,13 @@ class Source {
28787
28792
  {
28788
28793
  const foundType = this.determineType(node, input, targetType);
28789
28794
  const bodyType = conv_body_1.ConvBody.runSyntax(node.findDirectExpression(Expressions.ConvBody), input);
28795
+ const inferred = (_a = node.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _a === void 0 ? void 0 : _a.concatTokens();
28790
28796
  if (new _type_utils_1.TypeUtils(input.scope).isConvable(foundType, bodyType) === false) {
28791
28797
  const message = `CONV: Types not compatible, ${foundType === null || foundType === void 0 ? void 0 : foundType.constructor.name}, ${bodyType === null || bodyType === void 0 ? void 0 : bodyType.constructor.name}`;
28792
28798
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
28793
28799
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
28794
28800
  }
28795
- else if (foundType === null || foundType === void 0 ? void 0 : foundType.isGeneric()) {
28801
+ else if ((foundType === null || foundType === void 0 ? void 0 : foundType.isGeneric()) && inferred !== "#") {
28796
28802
  const message = "Cannot CONV to generic type";
28797
28803
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
28798
28804
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
@@ -34134,16 +34140,21 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modu
34134
34140
  const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
34135
34141
  class Parameter {
34136
34142
  runSyntax(node, input) {
34137
- var _a;
34138
- const nameToken = (_a = node.findFirstExpression(Expressions.FieldSub)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
34143
+ const nameExpression = node.findFirstExpression(Expressions.FieldSub);
34144
+ if (nameExpression === undefined) {
34145
+ return;
34146
+ }
34147
+ let nameToken = nameExpression.getFirstToken();
34148
+ // FieldSub can include dashes and optional length, eg p-tcode or p_table(4).
34149
+ if (nameExpression.getChildren().length > 1) {
34150
+ const fullName = nameExpression.concatTokens().replace(/\(.+$/, "").replace(/\[\]$/, "");
34151
+ nameToken = new tokens_1.Identifier(nameToken.getStart(), fullName);
34152
+ }
34139
34153
  if (nameToken && nameToken.getStr().length > 8) {
34140
34154
  const message = "Parameter name too long, " + nameToken.getStr();
34141
34155
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
34142
34156
  return;
34143
34157
  }
34144
- else if (nameToken === undefined) {
34145
- return;
34146
- }
34147
34158
  if (node.findDirectTokenByText("RADIOBUTTON") && node.findDirectTokenByText("LENGTH")) {
34148
34159
  const message = "RADIOBUTTON and LENGTH not possible together";
34149
34160
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
@@ -34950,23 +34961,28 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modu
34950
34961
  const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
34951
34962
  class SelectOption {
34952
34963
  runSyntax(node, input) {
34953
- var _a;
34954
- const nameToken = (_a = node.findFirstExpression(Expressions.FieldSub)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
34964
+ const nameExpression = node.findFirstExpression(Expressions.FieldSub);
34965
+ if (nameExpression === undefined) {
34966
+ return;
34967
+ }
34968
+ let nameToken = nameExpression.getFirstToken();
34969
+ // FieldSub can include dashes and optional length, eg s-matnr or s_name(10).
34970
+ if (nameExpression.getChildren().length > 1) {
34971
+ const fullName = nameExpression.concatTokens().replace(/\(.+$/, "").replace(/\[\]$/, "");
34972
+ nameToken = new tokens_1.Identifier(nameToken.getStart(), fullName);
34973
+ }
34955
34974
  if (nameToken && nameToken.getStr().length > 8) {
34956
34975
  const message = "Select-option name too long, " + nameToken.getStr();
34957
34976
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameToken, message));
34958
34977
  return;
34959
34978
  }
34960
- else if (nameToken === undefined) {
34961
- return;
34962
- }
34963
34979
  for (const d of node.findDirectExpressions(Expressions.Dynamic)) {
34964
34980
  dynamic_1.Dynamic.runSyntax(d, input);
34965
34981
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, basic_1.VoidType.get("DYNAMIC_SELECT_OPTION")));
34966
34982
  return;
34967
34983
  }
34968
- const nameExpression = node.findFirstExpression(Expressions.FieldChain);
34969
- let found = new basic_types_1.BasicTypes(input).resolveLikeName(nameExpression);
34984
+ const nameChain = node.findFirstExpression(Expressions.FieldChain);
34985
+ let found = new basic_types_1.BasicTypes(input).resolveLikeName(nameChain);
34970
34986
  if (found) {
34971
34987
  if (found instanceof basic_1.StructureType) {
34972
34988
  let length = 0;
@@ -56223,7 +56239,7 @@ class Registry {
56223
56239
  }
56224
56240
  static abaplintVersion() {
56225
56241
  // magic, see build script "version.sh"
56226
- return "2.119.8";
56242
+ return "2.119.10";
56227
56243
  }
56228
56244
  getDDICReferences() {
56229
56245
  return this.ddicReferences;
@@ -73726,6 +73742,19 @@ This rule makes sure the spaces are consistently required across the language.`,
73726
73742
  return issues;
73727
73743
  }
73728
73744
  missingSpace(statement) {
73745
+ {
73746
+ const tokens = statement.getTokens();
73747
+ for (let i = 1; i < tokens.length; i++) {
73748
+ const prev = tokens[i - 1];
73749
+ const current = tokens[i];
73750
+ if (prev.getStr() === ")"
73751
+ && current.getStr() === "="
73752
+ && prev.getRow() === current.getRow()
73753
+ && prev.getEnd().getCol() === current.getStart().getCol()) {
73754
+ return current.getStart();
73755
+ }
73756
+ }
73757
+ }
73729
73758
  const found = statement.findAllExpressionsMulti([
73730
73759
  Expressions.CondSub, Expressions.SQLCond, Expressions.ValueBodyLine,
73731
73760
  Expressions.NewObject, Expressions.Cond, Expressions.ComponentCond,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.119.8",
3
+ "version": "2.119.10",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.119.8",
41
+ "@abaplint/core": "^2.119.10",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",