@abaplint/cli 2.113.234 → 2.113.236

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 +64 -13
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -5045,7 +5045,7 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
5045
5045
  const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
5046
5046
  class DefinitionName extends combi_1.Expression {
5047
5047
  getRunnable() {
5048
- const r = (0, combi_1.regex)(/^&|&?((\w*\/\w+\/)|(\w*\/\w+\/)?[\w\*$%\?]+)$/);
5048
+ const r = (0, combi_1.regex)(/^&|&?((\w*\/\w+\/)|(\w*\/\w+\/)?[\w\*$%\?#]+)$/);
5049
5049
  return (0, combi_1.seq)(r, (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.optPrio)(r))), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.DashW)));
5050
5050
  }
5051
5051
  }
@@ -8564,9 +8564,19 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
8564
8564
  const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
8565
8565
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
8566
8566
  class SQLFrom extends combi_1.Expression {
8567
+ // todo: rewrite/refactor this method
8567
8568
  getRunnable() {
8568
- const from = (0, combi_1.seq)("FROM", (0, combi_1.starPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), _1.SQLFromSource);
8569
- const source = (0, combi_1.seq)(from, (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), _1.SQLJoin, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)))));
8569
+ const joins = (0, combi_1.starPrio)((0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)), _1.SQLJoin));
8570
+ // No opening parens
8571
+ const from0 = (0, combi_1.seq)("FROM", _1.SQLFromSource, joins);
8572
+ // 1 to 6 opening parens, with up to that many closing parens at the end
8573
+ 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)));
8574
+ 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)));
8575
+ 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)));
8576
+ 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)));
8577
+ 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)));
8578
+ 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)));
8579
+ const source = (0, combi_1.altPrio)(from6, from5, from4, from3, from2, from1, from0);
8570
8580
  return source;
8571
8581
  }
8572
8582
  }
@@ -8787,9 +8797,9 @@ class SQLIn extends combi_1.Expression {
8787
8797
  const listOld = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeft), (0, combi_1.alt)((0, combi_1.ver)(version_1.Version.v740sp05, short, version_1.Version.OpenABAP), val), (0, combi_1.starPrio)((0, combi_1.seq)(",", val)), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.ParenRight), (0, combi_1.tok)(tokens_1.ParenRightW), (0, combi_1.tok)(tokens_1.WParenRightW)));
8788
8798
  const listNew = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), val, (0, combi_1.starPrio)((0, combi_1.seq)(",", (0, combi_1.altPrio)(short, val))), (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRight), (0, combi_1.tok)(tokens_1.WParenRightW)));
8789
8799
  // version is a guess, https://github.com/abaplint/abaplint/issues/2530
8790
- const list = (0, combi_1.alt)(listOld, (0, combi_1.ver)(version_1.Version.v740sp02, listNew, version_1.Version.OpenABAP));
8800
+ const listNeww = (0, combi_1.ver)(version_1.Version.v740sp02, listNew, version_1.Version.OpenABAP);
8791
8801
  const subSelect = (0, combi_1.seq)("(", _1.Select, ")");
8792
- const inn = (0, combi_1.seq)("IN", (0, combi_1.altPrio)(_1.SQLSource, list, subSelect));
8802
+ const inn = (0, combi_1.seq)("IN", (0, combi_1.altPrio)(subSelect, listOld, listNeww, _1.SQLSource));
8793
8803
  return inn;
8794
8804
  }
8795
8805
  }
@@ -13352,12 +13362,12 @@ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@a
13352
13362
  const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
13353
13363
  class Field {
13354
13364
  getMatcher() {
13355
- const module = (0, combi_1.seq)("MODULE", expressions_1.FormName, (0, combi_1.opt)((0, combi_1.alt)("ON INPUT", "ON REQUEST", "ON CHAIN-REQUEST")));
13365
+ const module = (0, combi_1.seq)("MODULE", expressions_1.FormName, (0, combi_1.opt)((0, combi_1.alt)("ON INPUT", "ON REQUEST", "ON CHAIN-REQUEST", "AT CURSOR-SELECTION")));
13356
13366
  const values = (0, combi_1.seq)("VALUES", (0, combi_1.tok)(tokens_1.WParenLeft), "BETWEEN", expressions_1.Constant, "AND", expressions_1.Constant, (0, combi_1.tok)(tokens_1.ParenRightW));
13357
13367
  const wit = (0, combi_1.seq)("WITH", expressions_1.FieldChain);
13358
13368
  const cond = (0, combi_1.seq)(expressions_1.FieldChain, "=", expressions_1.FieldChain);
13359
13369
  const where = (0, combi_1.seq)(cond, (0, combi_1.starPrio)((0, combi_1.seq)("AND", cond)));
13360
- const select = (0, combi_1.seq)("SELECT * FROM", expressions_1.FieldChain, "WHERE", where, "INTO RESULT WHENEVER NOT FOUND SEND ERRORMESSAGE");
13370
+ const select = (0, combi_1.seq)("SELECT * FROM", expressions_1.FieldChain, "WHERE", where, (0, combi_1.opt)("INTO RESULT WHENEVER NOT FOUND SEND ERRORMESSAGE"));
13361
13371
  const ret = (0, combi_1.seq)("FIELD", expressions_1.FieldChain, (0, combi_1.opt)((0, combi_1.altPrio)(module, values, wit, select)));
13362
13372
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
13363
13373
  }
@@ -15773,7 +15783,9 @@ class Perform {
15773
15783
  const program = (0, combi_1.seq)("IN PROGRAM", (0, combi_1.opt)((0, combi_1.alt)(Expressions.Dynamic, Expressions.IncludeName)));
15774
15784
  const found = (0, combi_1.str)("IF FOUND");
15775
15785
  const full = (0, combi_1.seq)((0, combi_1.alt)(Expressions.FormName, Expressions.Dynamic), (0, combi_1.opt)((0, combi_1.verNot)(version_1.Version.Cloud, program)));
15776
- const ret = (0, combi_1.seq)("PERFORM", (0, combi_1.alt)(short, full), (0, combi_1.opt)(found), (0, combi_1.opt)(expressions_1.PerformTables), (0, combi_1.opt)(expressions_1.PerformUsing), (0, combi_1.opt)(expressions_1.PerformChanging), (0, combi_1.opt)(found), (0, combi_1.opt)(commit));
15786
+ const normal = (0, combi_1.seq)((0, combi_1.opt)(found), (0, combi_1.opt)(expressions_1.PerformTables), (0, combi_1.opt)(expressions_1.PerformUsing), (0, combi_1.opt)(expressions_1.PerformChanging), (0, combi_1.opt)(found), (0, combi_1.opt)(commit));
15787
+ const of = (0, combi_1.seq)("OF", (0, combi_1.plus)(Expressions.FormName));
15788
+ const ret = (0, combi_1.seq)("PERFORM", (0, combi_1.alt)(short, full), (0, combi_1.altPrio)(of, normal));
15777
15789
  return ret;
15778
15790
  }
15779
15791
  }
@@ -24085,6 +24097,7 @@ exports.AssertError = AssertError;
24085
24097
  Object.defineProperty(exports, "__esModule", ({ value: true }));
24086
24098
  exports.BasicTypes = void 0;
24087
24099
  const _typed_identifier_1 = __webpack_require__(/*! ../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
24100
+ const nodes_1 = __webpack_require__(/*! ../nodes */ "./node_modules/@abaplint/core/build/src/abap/nodes/index.js");
24088
24101
  const Expressions = __webpack_require__(/*! ../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
24089
24102
  const Statements = __webpack_require__(/*! ../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
24090
24103
  const Types = __webpack_require__(/*! ../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
@@ -24241,6 +24254,30 @@ class BasicTypes {
24241
24254
  type = new basic_1.TableType(type.getRowType(), { withHeader: false, keyType: Types.TableKeyType.default });
24242
24255
  }
24243
24256
  }
24257
+ else if (child instanceof nodes_1.ExpressionNode && child.get() instanceof Expressions.FieldLength) {
24258
+ const len = parseInt(child.concatTokens().replace("(", "").replace(")", ""), 10);
24259
+ if (isNaN(len)) {
24260
+ type = new Types.UnknownType("Type error, invalid field length");
24261
+ }
24262
+ else {
24263
+ if (type instanceof Types.DateType) {
24264
+ if (len > 8) {
24265
+ type = new Types.UnknownType("Type error, offset too long");
24266
+ }
24267
+ else {
24268
+ type = new Types.CharacterType(len);
24269
+ }
24270
+ }
24271
+ else if (type instanceof Types.CharacterType) {
24272
+ if (len <= type.getLength()) {
24273
+ type = new Types.CharacterType(len);
24274
+ }
24275
+ else {
24276
+ type = new Types.UnknownType("Type error, offset too long");
24277
+ }
24278
+ }
24279
+ }
24280
+ }
24244
24281
  else { // field name
24245
24282
  if (type instanceof Types.TableType) {
24246
24283
  type = type.getRowType();
@@ -32001,18 +32038,25 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
32001
32038
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
32002
32039
  const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js");
32003
32040
  const unknown_type_1 = __webpack_require__(/*! ../../types/basic/unknown_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/unknown_type.js");
32041
+ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
32004
32042
  class FieldSymbol {
32005
32043
  runSyntax(node, input) {
32006
32044
  var _a;
32007
32045
  const fsname = (_a = node.findFirstExpression(Expressions.FieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
32046
+ if (fsname === undefined) {
32047
+ return;
32048
+ }
32049
+ if (node.getChildren().length === 5) {
32050
+ // no type specified
32051
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, input.filename, basic_1.VoidType.get("FS-SIMPLE")));
32052
+ return;
32053
+ }
32008
32054
  const bfound = new basic_types_1.BasicTypes(input).parseType(node);
32009
- if (bfound && fsname) {
32055
+ if (bfound) {
32010
32056
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, input.filename, bfound));
32011
32057
  return;
32012
32058
  }
32013
- if (fsname) {
32014
- input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, input.filename, new unknown_type_1.UnknownType("Fieldsymbol, fallback")));
32015
- }
32059
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, input.filename, new unknown_type_1.UnknownType("Fieldsymbol, fallback")));
32016
32060
  }
32017
32061
  }
32018
32062
  exports.FieldSymbol = FieldSymbol;
@@ -54778,13 +54822,20 @@ class Registry {
54778
54822
  this.objectsByType = {};
54779
54823
  this.dependencies = {};
54780
54824
  this.setConfig(conf ? conf : config_1.Config.getDefault());
54825
+ this.clear();
54826
+ }
54827
+ /** clears all objects, keeping the configuration */
54828
+ clear() {
54829
+ this.objects = {};
54830
+ this.objectsByType = {};
54831
+ this.dependencies = {};
54781
54832
  this.ddicReferences = new ddic_references_1.DDICReferences();
54782
54833
  this.msagReferences = new msag_references_1.MSAGReferences();
54783
54834
  this.macroReferences = new macro_references_1.MacroReferences();
54784
54835
  }
54785
54836
  static abaplintVersion() {
54786
54837
  // magic, see build script "version.sh"
54787
- return "2.113.234";
54838
+ return "2.113.236";
54788
54839
  }
54789
54840
  getDDICReferences() {
54790
54841
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.234",
3
+ "version": "2.113.236",
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.113.234",
41
+ "@abaplint/core": "^2.113.236",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",