@abaplint/cli 2.113.224 → 2.113.226

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 +99 -58
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -6032,6 +6032,7 @@ __exportStar(__webpack_require__(/*! ./sql_arithmetic_operator */ "./node_module
6032
6032
  __exportStar(__webpack_require__(/*! ./sql_arithmetics */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_arithmetics.js"), exports);
6033
6033
  __exportStar(__webpack_require__(/*! ./sql_as_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_as_name.js"), exports);
6034
6034
  __exportStar(__webpack_require__(/*! ./sql_case */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_case.js"), exports);
6035
+ __exportStar(__webpack_require__(/*! ./sql_cast */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cast.js"), exports);
6035
6036
  __exportStar(__webpack_require__(/*! ./sql_cds_parameters */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cds_parameters.js"), exports);
6036
6037
  __exportStar(__webpack_require__(/*! ./sql_client */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_client.js"), exports);
6037
6038
  __exportStar(__webpack_require__(/*! ./sql_compare_operator */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_compare_operator.js"), exports);
@@ -8169,7 +8170,7 @@ class SQLCase extends combi_1.Expression {
8169
8170
  const abap = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2);
8170
8171
  const field = (0, combi_1.altPrio)(_1.SQLAggregation, SQLCase, _1.SQLFunction, _1.SQLPath, sql_field_name_1.SQLFieldName, constant_1.Constant);
8171
8172
  const sub = (0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), field, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW)));
8172
- const sourc = (0, combi_1.altPrio)(SQLCase, _1.SQLAggregation, _1.SQLFunction, sql_source_1.SQLSource, constant_1.Constant);
8173
+ const sourc = (0, combi_1.altPrio)(SQLCase, _1.SQLAggregation, _1.SQLFunction, sql_field_name_1.SQLFieldName, sql_source_1.SQLSource, constant_1.Constant);
8173
8174
  const val = (0, combi_1.altPrio)(sql_cond_1.SQLCond, constant_1.Constant, abap);
8174
8175
  const when = (0, combi_1.seq)("WHEN", val, "THEN", sourc, (0, combi_1.starPrio)(sub));
8175
8176
  const els = (0, combi_1.seq)("ELSE", sourc);
@@ -8181,6 +8182,33 @@ exports.SQLCase = SQLCase;
8181
8182
 
8182
8183
  /***/ }),
8183
8184
 
8185
+ /***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cast.js":
8186
+ /*!*****************************************************************************************!*\
8187
+ !*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cast.js ***!
8188
+ \*****************************************************************************************/
8189
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8190
+
8191
+ "use strict";
8192
+
8193
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
8194
+ exports.SQLCast = void 0;
8195
+ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
8196
+ const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
8197
+ const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
8198
+ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
8199
+ const sql_field_name_1 = __webpack_require__(/*! ./sql_field_name */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_field_name.js");
8200
+ class SQLCast extends combi_1.Expression {
8201
+ getRunnable() {
8202
+ const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2), version_1.Version.OpenABAP);
8203
+ // todo: from version something
8204
+ return (0, combi_1.seq)("CAST", "(", (0, combi_1.opt)((0, combi_1.altPrio)(sql_field_name_1.SQLFieldName, abap)), "AS", sql_field_name_1.SQLFieldName, ")");
8205
+ }
8206
+ }
8207
+ exports.SQLCast = SQLCast;
8208
+ //# sourceMappingURL=sql_cast.js.map
8209
+
8210
+ /***/ }),
8211
+
8184
8212
  /***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cds_parameters.js":
8185
8213
  /*!***************************************************************************************************!*\
8186
8214
  !*** ./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_cds_parameters.js ***!
@@ -8335,7 +8363,8 @@ class SQLField extends combi_1.Expression {
8335
8363
  getRunnable() {
8336
8364
  const abap = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), _1.SimpleFieldChain2), version_1.Version.OpenABAP);
8337
8365
  const as = (0, combi_1.seq)("AS", _1.SQLAsName);
8338
- const field = (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLCase, sql_function_1.SQLFunction, sql_path_1.SQLPath, _1.SQLFieldName, abap, _1.Constant);
8366
+ const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFieldName, (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.WParenRightW), (0, combi_1.tok)(tokens_1.WParenRight)));
8367
+ const field = (0, combi_1.altPrio)(_1.SQLAggregation, _1.SQLCase, _1.SQLCast, sql_function_1.SQLFunction, sql_path_1.SQLPath, _1.SQLFieldName, abap, _1.Constant, paren);
8339
8368
  const sub = (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/", "&&"), (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenLeftW)), field, (0, combi_1.optPrio)((0, combi_1.tok)(tokens_1.WParenRightW))));
8340
8369
  const arith = (0, combi_1.ver)(version_1.Version.v740sp05, sub);
8341
8370
  return (0, combi_1.seq)(field, (0, combi_1.optPrio)(arith), (0, combi_1.optPrio)(as));
@@ -8386,13 +8415,11 @@ exports.SQLFieldList = void 0;
8386
8415
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
8387
8416
  const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
8388
8417
  const version_1 = __webpack_require__(/*! ../../../version */ "./node_modules/@abaplint/core/build/src/version.js");
8389
- const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
8390
8418
  class SQLFieldList extends combi_1.Expression {
8391
8419
  getRunnable() {
8392
- const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WParenLeftW), _1.SQLFieldName, (0, combi_1.tok)(tokens_1.WParenRightW));
8393
8420
  const nev = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.starPrio)((0, combi_1.seq)(",", _1.SQLField)), version_1.Version.OpenABAP);
8394
8421
  const old = (0, combi_1.starPrio)(_1.SQLField);
8395
- return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)), paren);
8422
+ return (0, combi_1.altPrio)("*", _1.Dynamic, (0, combi_1.seq)(_1.SQLField, (0, combi_1.alt)(nev, old)));
8396
8423
  }
8397
8424
  }
8398
8425
  exports.SQLFieldList = SQLFieldList;
@@ -13325,7 +13352,10 @@ class Field {
13325
13352
  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")));
13326
13353
  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));
13327
13354
  const wit = (0, combi_1.seq)("WITH", expressions_1.FieldChain);
13328
- const ret = (0, combi_1.seq)("FIELD", expressions_1.FieldChain, (0, combi_1.opt)((0, combi_1.altPrio)(module, values, wit)));
13355
+ const cond = (0, combi_1.seq)(expressions_1.FieldChain, "=", expressions_1.FieldChain);
13356
+ const where = (0, combi_1.seq)(cond, (0, combi_1.starPrio)((0, combi_1.seq)("AND", cond)));
13357
+ const select = (0, combi_1.seq)("SELECT * FROM", expressions_1.FieldChain, "WHERE", where, "INTO RESULT WHENEVER NOT FOUND SEND ERRORMESSAGE");
13358
+ const ret = (0, combi_1.seq)("FIELD", expressions_1.FieldChain, (0, combi_1.opt)((0, combi_1.altPrio)(module, values, wit, select)));
13329
13359
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
13330
13360
  }
13331
13361
  }
@@ -24486,10 +24516,10 @@ class BasicTypes {
24486
24516
  sub = node.findFirstExpression(Expressions.TypeParam);
24487
24517
  }
24488
24518
  if (sub === undefined) {
24489
- sub = node.findFirstExpression(Expressions.FieldChain);
24519
+ sub = node.findFirstExpression(Expressions.TypeName);
24490
24520
  }
24491
24521
  if (sub === undefined) {
24492
- sub = node.findFirstExpression(Expressions.TypeName);
24522
+ sub = node.findFirstExpression(Expressions.FieldChain);
24493
24523
  }
24494
24524
  found = this.resolveLikeName(sub);
24495
24525
  if (found && this.isOccurs(node)) {
@@ -29381,14 +29411,17 @@ class ValueBody {
29381
29411
  const fields = new Set();
29382
29412
  for (const s of node.findDirectExpressions(Expressions.FieldAssignment)) {
29383
29413
  field_assignment_1.FieldAssignment.runSyntax(s, input, targetType);
29384
- const fieldname = (_a = s.findDirectExpression(Expressions.FieldSub)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
29385
- if (fieldname) {
29386
- if (fields.has(fieldname)) {
29387
- const message = "Duplicate field assignment";
29388
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
29389
- return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
29414
+ if (node.findDirectExpression(Expressions.ValueBodyLine) === undefined) {
29415
+ // todo: refine, still needs to be checked when there are table lines
29416
+ const fieldname = (_a = s.findDirectExpression(Expressions.FieldSub)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();
29417
+ if (fieldname) {
29418
+ if (fields.has(fieldname)) {
29419
+ const message = "Duplicate field assignment";
29420
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, s.getFirstToken(), message));
29421
+ return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
29422
+ }
29423
+ fields.add(fieldname);
29390
29424
  }
29391
- fields.add(fieldname);
29392
29425
  }
29393
29426
  }
29394
29427
  let type = undefined; // todo, this is only correct if there is a single source in the body
@@ -31820,6 +31853,38 @@ exports.FetchNextCursor = FetchNextCursor;
31820
31853
 
31821
31854
  /***/ }),
31822
31855
 
31856
+ /***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/field_group.js":
31857
+ /*!***************************************************************************************!*\
31858
+ !*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/field_group.js ***!
31859
+ \***************************************************************************************/
31860
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
31861
+
31862
+ "use strict";
31863
+
31864
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
31865
+ exports.FieldGroup = void 0;
31866
+ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js");
31867
+ const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js");
31868
+ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
31869
+ class FieldGroup {
31870
+ runSyntax(node, input) {
31871
+ const nameExpression = node.findFirstExpression(Expressions.Field);
31872
+ if (nameExpression === undefined) {
31873
+ return;
31874
+ }
31875
+ const name = nameExpression === null || nameExpression === void 0 ? void 0 : nameExpression.concatTokens();
31876
+ if (name === undefined) {
31877
+ return;
31878
+ }
31879
+ const id = new _typed_identifier_1.TypedIdentifier(nameExpression === null || nameExpression === void 0 ? void 0 : nameExpression.getFirstToken(), input.filename, basic_1.VoidType.get("FIELD-GROUP"));
31880
+ input.scope.addIdentifier(id);
31881
+ }
31882
+ }
31883
+ exports.FieldGroup = FieldGroup;
31884
+ //# sourceMappingURL=field_group.js.map
31885
+
31886
+ /***/ }),
31887
+
31823
31888
  /***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/fieldsymbol.js":
31824
31889
  /*!***************************************************************************************!*\
31825
31890
  !*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/fieldsymbol.js ***!
@@ -32401,7 +32466,7 @@ class IncludeType {
32401
32466
  else if (ityp instanceof basic_1.TableType && isStructure) {
32402
32467
  ityp = ityp.getRowType();
32403
32468
  }
32404
- else if (ityp instanceof basic_1.VoidType) {
32469
+ if (ityp instanceof basic_1.VoidType) {
32405
32470
  return ityp;
32406
32471
  }
32407
32472
  if (!(ityp instanceof basic_1.StructureType)) {
@@ -33448,7 +33513,7 @@ class Parameter {
33448
33513
  }
33449
33514
  const magicName = "%_" + nameToken.getStr() + "_%_app_%";
33450
33515
  const magicToken = new tokens_1.Identifier(nameToken.getStart(), magicName);
33451
- input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, basic_1.VoidType.get("PARAMETER magic")));
33516
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(magicToken, input.filename, basic_1.VoidType.get("PARAMETER-MAGIC")));
33452
33517
  }
33453
33518
  }
33454
33519
  exports.Parameter = Parameter;
@@ -35408,6 +35473,8 @@ const Expressions = __webpack_require__(/*! ../../2_statements/expressions */ ".
35408
35473
  const Statements = __webpack_require__(/*! ../../2_statements/statements */ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js");
35409
35474
  const Structures = __webpack_require__(/*! ../../3_structures/structures */ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js");
35410
35475
  const include_type_1 = __webpack_require__(/*! ../statements/include_type */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/include_type.js");
35476
+ const constant_1 = __webpack_require__(/*! ../statements/constant */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/constant.js");
35477
+ const constants_1 = __webpack_require__(/*! ./constants */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/constants.js");
35411
35478
  class Data {
35412
35479
  static runSyntax(node, input) {
35413
35480
  var _a;
@@ -35445,46 +35512,6 @@ class Data {
35445
35512
  }
35446
35513
  else if (c instanceof nodes_1.StatementNode && ctyp instanceof Statements.IncludeType) {
35447
35514
  // INCLUDES
35448
- /*
35449
- const typeToken = c.findFirstExpression(Expressions.TypeName)?.getFirstToken();
35450
- const typeName = typeToken?.getStr();
35451
-
35452
- let foundId = input.scope.findType(typeName);
35453
- if (foundId === undefined) {
35454
- foundId = input.scope.findVariable(typeName);
35455
- }
35456
-
35457
- let found = foundId?.getType();
35458
- if (found === undefined) {
35459
- const f = input.scope.getDDIC().lookupTableOrView(typeName).type;
35460
- if (f instanceof TypedIdentifier) {
35461
- found = f.getType();
35462
- } else {
35463
- found = f;
35464
- }
35465
- } else {
35466
- input.scope.addReference(typeToken, foundId, ReferenceType.TypeReference, input.filename);
35467
- }
35468
- if (found instanceof Basic.VoidType) {
35469
- if (table === true) {
35470
- const ttyp = new Basic.TableType(found, {withHeader: true, keyType: Basic.TableKeyType.default});
35471
- return new TypedIdentifier(name, input.filename, ttyp);
35472
- } else {
35473
- return new TypedIdentifier(name, input.filename, found);
35474
- }
35475
- }
35476
- if (found instanceof Basic.UnknownType) {
35477
- return new TypedIdentifier(name, input.filename, new Basic.UnknownType("unknown type, " + typeName));
35478
- }
35479
- if (found instanceof Basic.TableType && found.isWithHeader()) {
35480
- found = found.getRowType();
35481
- }
35482
- if (!(found instanceof Basic.StructureType)) {
35483
- const message = "not structured, " + typeName;
35484
- input.issues.push(syntaxIssue(input, typeToken!, message));
35485
- return new TypedIdentifier(name, input.filename, Basic.VoidType.get(CheckSyntaxKey));
35486
- }
35487
- */
35488
35515
  const found = new include_type_1.IncludeType().runSyntax(c, input);
35489
35516
  if (found instanceof Basic.VoidType) {
35490
35517
  if (table === true) {
@@ -35535,6 +35562,18 @@ class Data {
35535
35562
  input.scope.addType(found);
35536
35563
  }
35537
35564
  }
35565
+ else if (c instanceof nodes_1.StatementNode && ctyp instanceof Statements.Constant) {
35566
+ const found = new constant_1.Constant().runSyntax(c, input);
35567
+ if (found) {
35568
+ input.scope.addIdentifier(found);
35569
+ }
35570
+ }
35571
+ else if (c instanceof nodes_1.StructureNode && ctyp instanceof Structures.Constants) {
35572
+ const { type: found, values: _ } = new constants_1.Constants().runSyntax(c, input);
35573
+ if (found) {
35574
+ input.scope.addIdentifier(found);
35575
+ }
35576
+ }
35538
35577
  }
35539
35578
  }
35540
35579
  }
@@ -35956,6 +35995,7 @@ const modify_entities_1 = __webpack_require__(/*! ./statements/modify_entities *
35956
35995
  const commit_entities_1 = __webpack_require__(/*! ./statements/commit_entities */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/commit_entities.js");
35957
35996
  const _syntax_input_1 = __webpack_require__(/*! ./_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
35958
35997
  const assert_error_1 = __webpack_require__(/*! ./assert_error */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/assert_error.js");
35998
+ const field_group_1 = __webpack_require__(/*! ./statements/field_group */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/field_group.js");
35959
35999
  // -----------------------------------
35960
36000
  const map = {};
35961
36001
  function addToMap(handler) {
@@ -36086,6 +36126,7 @@ if (Object.keys(map).length === 0) {
36086
36126
  addToMap(new translate_1.Translate());
36087
36127
  addToMap(new modify_internal_1.ModifyInternal());
36088
36128
  addToMap(new read_textpool_1.ReadTextpool());
36129
+ addToMap(new field_group_1.FieldGroup());
36089
36130
  addToMap(new editor_call_1.EditorCall());
36090
36131
  addToMap(new delete_memory_1.DeleteMemory());
36091
36132
  }
@@ -54559,7 +54600,7 @@ class Registry {
54559
54600
  }
54560
54601
  static abaplintVersion() {
54561
54602
  // magic, see build script "version.sh"
54562
- return "2.113.224";
54603
+ return "2.113.226";
54563
54604
  }
54564
54605
  getDDICReferences() {
54565
54606
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.224",
3
+ "version": "2.113.226",
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.224",
41
+ "@abaplint/core": "^2.113.226",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",