@abaplint/cli 2.119.9 → 2.119.11

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 +52 -20
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -7692,8 +7692,9 @@ class SelectLoop extends combi_1.Expression {
7692
7692
  const into = (0, combi_1.altPrio)(sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList);
7693
7693
  const perm = (0, combi_1.per)(_1.SQLFrom, where, sql_up_to_1.SQLUpTo, sql_order_by_1.SQLOrderBy, sql_having_1.SQLHaving, _1.SQLClient, bypass, _1.SQLGroupBy, _1.SQLForAllEntries, _1.DatabaseConnection, (0, combi_1.alt)(tab, sql_into_structure_1.SQLIntoStructure, _1.SQLIntoList, packTab));
7694
7694
  const strict = (0, combi_1.seq)(_1.SQLFrom, (0, combi_1.ver)(version_1.Version.v750, sql_fields_loop_1.SQLFieldsLoop), (0, combi_1.optPrio)(_1.SQLForAllEntries), (0, combi_1.optPrio)((0, combi_1.seq)(where, (0, combi_1.optPrio)(sql_order_by_1.SQLOrderBy), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo))));
7695
- const aggr = (0, combi_1.seq)((0, combi_1.plusPrio)(_1.SQLAggregation), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), _1.SQLFrom, (0, combi_1.optPrio)(_1.SQLClient), (0, combi_1.optPrio)(where), _1.SQLGroupBy);
7696
- const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), sql_field_list_loop_1.SQLFieldListLoop, perm), strict, aggr), (0, combi_1.optPrio)(sql_hints_1.SQLHints));
7695
+ const aggrIntoBeforeFrom = (0, combi_1.seq)((0, combi_1.plusPrio)(_1.SQLAggregation), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), _1.SQLFrom, (0, combi_1.optPrio)(_1.SQLClient), (0, combi_1.optPrio)(where), _1.SQLGroupBy);
7696
+ const aggrIntoAfterFrom = (0, combi_1.seq)((0, combi_1.plusPrio)(_1.SQLAggregation), _1.SQLFrom, (0, combi_1.optPrio)(_1.SQLClient), into, (0, combi_1.optPrio)(sql_up_to_1.SQLUpTo), (0, combi_1.optPrio)(where), _1.SQLGroupBy);
7697
+ const ret = (0, combi_1.seq)("SELECT", (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)("DISTINCT"), sql_field_list_loop_1.SQLFieldListLoop, perm), strict, aggrIntoBeforeFrom, aggrIntoAfterFrom), (0, combi_1.optPrio)(sql_hints_1.SQLHints));
7697
7698
  return ret;
7698
7699
  }
7699
7700
  }
@@ -8180,7 +8181,7 @@ class SQLCase extends combi_1.Expression {
8180
8181
  const val = (0, combi_1.altPrio)(sql_cond_1.SQLCond, constant_1.Constant, abap);
8181
8182
  const when = (0, combi_1.seq)("WHEN", val, "THEN", sourc, (0, combi_1.starPrio)(sub));
8182
8183
  const els = (0, combi_1.seq)("ELSE", sourc);
8183
- return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)((0, combi_1.altPrio)(sql_field_name_1.SQLFieldName, abap)), (0, combi_1.plusPrio)(when), (0, combi_1.optPrio)(els), "END"));
8184
+ return (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)("CASE", (0, combi_1.opt)((0, combi_1.altPrio)(sql_field_name_1.SQLFieldName, abap)), (0, combi_1.plusPrio)(when), (0, combi_1.optPrio)(els), "END"), version_1.Version.OpenABAP);
8184
8185
  }
8185
8186
  }
8186
8187
  exports.SQLCase = SQLCase;
@@ -8398,9 +8399,12 @@ exports.SQLFieldList = void 0;
8398
8399
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
8399
8400
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
8400
8401
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
8402
+ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
8401
8403
  class SQLFieldList extends combi_1.Expression {
8402
8404
  getRunnable() {
8403
- const nev = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.SQLField)), version_1.Version.OpenABAP);
8405
+ const as = (0, combi_1.seq)("AS", _1.SQLAsName);
8406
+ const commaParenField = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), _1.SQLFieldName, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.WParenRight)), (0, combi_1.optPrio)(as));
8407
+ const nev = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.starPrio)((0, combi_1.seq)(",", (0, combi_1.altPrio)(_1.SQLField, commaParenField))), version_1.Version.OpenABAP);
8404
8408
  const old = (0, combi_1.starPrio)(_1.SQLField);
8405
8409
  return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)));
8406
8410
  }
@@ -8549,14 +8553,15 @@ class SQLFrom extends combi_1.Expression {
8549
8553
  const joins = (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), _1.SQLJoin));
8550
8554
  // No opening parens
8551
8555
  const from0 = (0, combi_1.seq)("FROM", _1.SQLFromSource, joins);
8552
- // 1 to 6 opening parens, with up to that many closing parens at the end
8556
+ // 1 to 7 opening parens, with up to that many closing parens at the end
8553
8557
  const from1 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
8554
8558
  const from2 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
8555
8559
  const from3 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
8556
8560
  const from4 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
8557
8561
  const from5 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
8558
8562
  const from6 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
8559
- const source = (0, combi_1.altPrio)(from6, from5, from4, from3, from2, from1, from0);
8563
+ const from7 = (0, combi_1.seq)("FROM", (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), (0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFromSource, joins, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
8564
+ const source = (0, combi_1.altPrio)(from7, from6, from5, from4, from3, from2, from1, from0);
8560
8565
  return source;
8561
8566
  }
8562
8567
  }
@@ -28614,6 +28619,9 @@ class Select {
28614
28619
  const ret = [];
28615
28620
  if (node.get() instanceof Expressions.SelectLoop) {
28616
28621
  expr = node.findFirstExpression(Expressions.SQLFieldListLoop);
28622
+ if (expr === undefined) {
28623
+ expr = node;
28624
+ }
28617
28625
  }
28618
28626
  else {
28619
28627
  expr = node.findFirstExpression(Expressions.SQLFieldList);
@@ -28621,7 +28629,8 @@ class Select {
28621
28629
  if (((_a = expr === null || expr === void 0 ? void 0 : expr.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Dynamic) {
28622
28630
  dynamic_1.Dynamic.runSyntax(expr.getFirstChild(), input);
28623
28631
  }
28624
- for (const field of (expr === null || expr === void 0 ? void 0 : expr.findDirectExpressionsMulti([Expressions.SQLField, Expressions.SQLFieldName])) || []) {
28632
+ // eslint-disable-next-line max-len
28633
+ for (const field of (expr === null || expr === void 0 ? void 0 : expr.findDirectExpressionsMulti([Expressions.SQLField, Expressions.SQLFieldName, Expressions.SQLAggregation])) || []) {
28625
28634
  let code = field.concatTokens().toUpperCase();
28626
28635
  const as = ((_b = field.findDirectExpression(Expressions.SQLAsName)) === null || _b === void 0 ? void 0 : _b.concatTokens()) || "";
28627
28636
  if (as !== "") {
@@ -34136,16 +34145,21 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modu
34136
34145
  const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
34137
34146
  class Parameter {
34138
34147
  runSyntax(node, input) {
34139
- var _a;
34140
- const nameToken = (_a = node.findFirstExpression(Expressions.FieldSub)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
34148
+ const nameExpression = node.findFirstExpression(Expressions.FieldSub);
34149
+ if (nameExpression === undefined) {
34150
+ return;
34151
+ }
34152
+ let nameToken = nameExpression.getFirstToken();
34153
+ // FieldSub can include dashes and optional length, eg p-tcode or p_table(4).
34154
+ if (nameExpression.getChildren().length > 1) {
34155
+ const fullName = nameExpression.concatTokens().replace(/\(.+$/, "").replace(/\[\]$/, "");
34156
+ nameToken = new tokens_1.Identifier(nameToken.getStart(), fullName);
34157
+ }
34141
34158
  if (nameToken && nameToken.getStr().length > 8) {
34142
34159
  const message = "Parameter name too long, " + nameToken.getStr();
34143
34160
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
34144
34161
  return;
34145
34162
  }
34146
- else if (nameToken === undefined) {
34147
- return;
34148
- }
34149
34163
  if (node.findDirectTokenByText("RADIOBUTTON") && node.findDirectTokenByText("LENGTH")) {
34150
34164
  const message = "RADIOBUTTON and LENGTH not possible together";
34151
34165
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
@@ -34952,23 +34966,28 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modu
34952
34966
  const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
34953
34967
  class SelectOption {
34954
34968
  runSyntax(node, input) {
34955
- var _a;
34956
- const nameToken = (_a = node.findFirstExpression(Expressions.FieldSub)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
34969
+ const nameExpression = node.findFirstExpression(Expressions.FieldSub);
34970
+ if (nameExpression === undefined) {
34971
+ return;
34972
+ }
34973
+ let nameToken = nameExpression.getFirstToken();
34974
+ // FieldSub can include dashes and optional length, eg s-matnr or s_name(10).
34975
+ if (nameExpression.getChildren().length > 1) {
34976
+ const fullName = nameExpression.concatTokens().replace(/\(.+$/, "").replace(/\[\]$/, "");
34977
+ nameToken = new tokens_1.Identifier(nameToken.getStart(), fullName);
34978
+ }
34957
34979
  if (nameToken && nameToken.getStr().length > 8) {
34958
34980
  const message = "Select-option name too long, " + nameToken.getStr();
34959
34981
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameToken, message));
34960
34982
  return;
34961
34983
  }
34962
- else if (nameToken === undefined) {
34963
- return;
34964
- }
34965
34984
  for (const d of node.findDirectExpressions(Expressions.Dynamic)) {
34966
34985
  dynamic_1.Dynamic.runSyntax(d, input);
34967
34986
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, basic_1.VoidType.get("DYNAMIC_SELECT_OPTION")));
34968
34987
  return;
34969
34988
  }
34970
- const nameExpression = node.findFirstExpression(Expressions.FieldChain);
34971
- let found = new basic_types_1.BasicTypes(input).resolveLikeName(nameExpression);
34989
+ const nameChain = node.findFirstExpression(Expressions.FieldChain);
34990
+ let found = new basic_types_1.BasicTypes(input).resolveLikeName(nameChain);
34972
34991
  if (found) {
34973
34992
  if (found instanceof basic_1.StructureType) {
34974
34993
  let length = 0;
@@ -56225,7 +56244,7 @@ class Registry {
56225
56244
  }
56226
56245
  static abaplintVersion() {
56227
56246
  // magic, see build script "version.sh"
56228
- return "2.119.9";
56247
+ return "2.119.11";
56229
56248
  }
56230
56249
  getDDICReferences() {
56231
56250
  return this.ddicReferences;
@@ -73728,6 +73747,19 @@ This rule makes sure the spaces are consistently required across the language.`,
73728
73747
  return issues;
73729
73748
  }
73730
73749
  missingSpace(statement) {
73750
+ {
73751
+ const tokens = statement.getTokens();
73752
+ for (let i = 1; i < tokens.length; i++) {
73753
+ const prev = tokens[i - 1];
73754
+ const current = tokens[i];
73755
+ if (prev.getStr() === ")"
73756
+ && current.getStr() === "="
73757
+ && prev.getRow() === current.getRow()
73758
+ && prev.getEnd().getCol() === current.getStart().getCol()) {
73759
+ return current.getStart();
73760
+ }
73761
+ }
73762
+ }
73731
73763
  const found = statement.findAllExpressionsMulti([
73732
73764
  Expressions.CondSub, Expressions.SQLCond, Expressions.ValueBodyLine,
73733
73765
  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.9",
3
+ "version": "2.119.11",
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.9",
41
+ "@abaplint/core": "^2.119.11",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",