@abaplint/cli 2.113.33 → 2.113.35

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 +77 -14
  2. package/package.json +6 -6
package/build/cli.js CHANGED
@@ -4949,7 +4949,7 @@ const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/co
4949
4949
  const tokens_1 = __webpack_require__(/*! ../../1_lexer/tokens */ "./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js");
4950
4950
  class DefinitionName extends combi_1.Expression {
4951
4951
  getRunnable() {
4952
- const r = (0, combi_1.regex)(/^((\w*\/\w+\/)|(\w*\/\w+\/)?[\w\*$%]+)$/);
4952
+ const r = (0, combi_1.regex)(/^&|&?((\w*\/\w+\/)|(\w*\/\w+\/)?[\w\*$%]+)$/);
4953
4953
  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)));
4954
4954
  }
4955
4955
  }
@@ -8078,7 +8078,7 @@ class SQLCompare extends combi_1.Expression {
8078
8078
  const arith = (0, combi_1.ver)(version_1.Version.v750, (0, combi_1.plusPrio)((0, combi_1.seq)((0, combi_1.altPrio)("+", "-", "*", "/"), _1.SQLFieldName)));
8079
8079
  const paren = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.ParenLeftW), _1.Source, (0, combi_1.tok)(tokens_1.WParenRightW));
8080
8080
  const at = (0, combi_1.ver)(version_1.Version.v740sp05, (0, combi_1.seq)((0, combi_1.tok)(tokens_1.WAt), (0, combi_1.altPrio)(_1.SimpleSource3, paren)));
8081
- const rett = (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLFunction, (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLPath, _1.SQLFieldName), (0, combi_1.optPrio)(arith)), at), (0, combi_1.altPrio)((0, combi_1.seq)(_1.SQLCompareOperator, (0, combi_1.altPrio)(sub, source)), (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)(_1.SQLIn, like, between)), nul));
8081
+ const rett = (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLFunction, _1.ConstantString, (0, combi_1.seq)((0, combi_1.altPrio)(_1.SQLPath, _1.SQLFieldName), (0, combi_1.optPrio)(arith)), at), (0, combi_1.altPrio)((0, combi_1.seq)(_1.SQLCompareOperator, (0, combi_1.altPrio)(sub, source)), (0, combi_1.seq)((0, combi_1.optPrio)("NOT"), (0, combi_1.altPrio)(_1.SQLIn, like, between)), nul));
8082
8082
  const exists = (0, combi_1.seq)("EXISTS", subSelect);
8083
8083
  return (0, combi_1.altPrio)(exists, _1.Dynamic, rett);
8084
8084
  }
@@ -8458,9 +8458,13 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
8458
8458
  exports.SQLHaving = void 0;
8459
8459
  const combi_1 = __webpack_require__(/*! ../combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
8460
8460
  const dynamic_1 = __webpack_require__(/*! ./dynamic */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/dynamic.js");
8461
+ const sql_aggregation_1 = __webpack_require__(/*! ./sql_aggregation */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_aggregation.js");
8462
+ const sql_compare_operator_1 = __webpack_require__(/*! ./sql_compare_operator */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_compare_operator.js");
8463
+ const sql_source_1 = __webpack_require__(/*! ./sql_source */ "./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_source.js");
8461
8464
  class SQLHaving extends combi_1.Expression {
8462
8465
  getRunnable() {
8463
- const having = (0, combi_1.seq)("HAVING", dynamic_1.Dynamic);
8466
+ const cond = (0, combi_1.seq)(sql_aggregation_1.SQLAggregation, sql_compare_operator_1.SQLCompareOperator, sql_source_1.SQLSource);
8467
+ const having = (0, combi_1.seq)("HAVING", (0, combi_1.altPrio)(dynamic_1.Dynamic, cond));
8464
8468
  return having;
8465
8469
  }
8466
8470
  }
@@ -10487,7 +10491,8 @@ class CallFunction {
10487
10491
  const separate = (0, combi_1.str)("AS SEPARATE UNIT");
10488
10492
  const keeping = (0, combi_1.str)("KEEPING LOGICAL UNIT OF WORK");
10489
10493
  const options = (0, combi_1.per)(starting, update, background, expressions_1.Destination, calling, performing, separate, keeping);
10490
- const dynamic = (0, combi_1.seq)("PARAMETER-TABLE", expressions_1.Source, (0, combi_1.opt)((0, combi_1.seq)("EXCEPTION-TABLE", expressions_1.Source)));
10494
+ const ex = (0, combi_1.seq)("EXCEPTION-TABLE", expressions_1.Source);
10495
+ const dynamic = (0, combi_1.alt)((0, combi_1.seq)("PARAMETER-TABLE", expressions_1.Source, (0, combi_1.opt)(ex)), ex);
10491
10496
  const call = (0, combi_1.seq)("CALL", (0, combi_1.altPrio)("FUNCTION", (0, combi_1.verNot)(version_1.Version.Cloud, "CUSTOMER-FUNCTION")), expressions_1.FunctionName, (0, combi_1.opt)(options), (0, combi_1.alt)(expressions_1.FunctionParameters, dynamic));
10492
10497
  return call;
10493
10498
  }
@@ -14963,10 +14968,12 @@ class NewPage {
14963
14968
  const keep = (0, combi_1.seq)("KEEP IN SPOOL", expressions_1.Source);
14964
14969
  const layout = (0, combi_1.seq)("LAYOUT", expressions_1.Source);
14965
14970
  const listAuth = (0, combi_1.seq)("LIST AUTHORITY", expressions_1.Source);
14971
+ const department = (0, combi_1.seq)("DEPARTMENT", expressions_1.Source);
14972
+ const receiver = (0, combi_1.seq)("RECEIVER", expressions_1.Source);
14966
14973
  const dataset = (0, combi_1.seq)("LIST DATASET", expressions_1.Source);
14967
14974
  const name = (0, combi_1.seq)("LIST NAME", expressions_1.Source);
14968
14975
  const newList = (0, combi_1.seq)("NEW LIST IDENTIFICATION", expressions_1.Source);
14969
- const ret = (0, combi_1.seq)("NEW-PAGE", (0, combi_1.opt)((0, combi_1.per)(print, (0, combi_1.alt)("NO-TITLE", "WITH-TITLE"), (0, combi_1.alt)("NO-HEADING", "WITH-HEADING"), "NO DIALOG", parameters, listAuth, immediately, dataset, coverPage, newList, keep, name, layout, destination, coverText, archive, "NEW-SECTION", lineCount, line)));
14976
+ const ret = (0, combi_1.seq)("NEW-PAGE", (0, combi_1.opt)((0, combi_1.per)(print, (0, combi_1.alt)("NO-TITLE", "WITH-TITLE"), (0, combi_1.alt)("NO-HEADING", "WITH-HEADING"), "NO DIALOG", parameters, listAuth, immediately, dataset, coverPage, newList, keep, department, name, layout, destination, receiver, coverText, archive, "NEW-SECTION", lineCount, line)));
14970
14977
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
14971
14978
  }
14972
14979
  }
@@ -16026,7 +16033,7 @@ class ScrollList {
16026
16033
  const line = (0, combi_1.seq)("LINE", expressions_1.Source);
16027
16034
  const column = (0, combi_1.seq)("TO COLUMN", expressions_1.Source);
16028
16035
  const to = (0, combi_1.seq)("TO", (0, combi_1.alt)("FIRST PAGE", "LAST PAGE", (0, combi_1.seq)("PAGE", expressions_1.Source)));
16029
- const ret = (0, combi_1.seq)("SCROLL LIST", (0, combi_1.per)(index, (0, combi_1.alt)(to, "BACKWARD", "FORWARD"), column, line));
16036
+ const ret = (0, combi_1.seq)("SCROLL LIST", (0, combi_1.per)(index, (0, combi_1.alt)(to, "BACKWARD", "FORWARD"), (0, combi_1.alt)("LEFT", "RIGHT"), column, line));
16030
16037
  return (0, combi_1.verNot)(version_1.Version.Cloud, ret);
16031
16038
  }
16032
16039
  }
@@ -39722,20 +39729,71 @@ exports.ArtifactsRules = ArtifactsRules;
39722
39729
  Object.defineProperty(exports, "__esModule", ({ value: true }));
39723
39730
  exports.CDSDetermineTypes = void 0;
39724
39731
  const basic_1 = __webpack_require__(/*! ../abap/types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
39732
+ const ddic_1 = __webpack_require__(/*! ../ddic */ "./node_modules/@abaplint/core/build/src/ddic.js");
39725
39733
  class CDSDetermineTypes {
39726
- parseType(_reg, parsedData) {
39734
+ parseType(reg, parsedData) {
39735
+ const ddic = new ddic_1.DDIC(reg);
39727
39736
  if ((parsedData === null || parsedData === void 0 ? void 0 : parsedData.fields.length) === 0) {
39728
39737
  return new basic_1.VoidType("DDLS:todo");
39729
39738
  }
39730
39739
  else {
39731
39740
  const components = [];
39732
39741
  for (const f of (parsedData === null || parsedData === void 0 ? void 0 : parsedData.fields) || []) {
39733
- components.push({
39734
- name: f.name,
39735
- type: new basic_1.VoidType("DDLS:fieldname"),
39736
- });
39742
+ if (f.prefix !== "") {
39743
+ const source = parsedData.sources.find((s) => { var _a; return ((_a = s.as) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === f.prefix.toUpperCase(); });
39744
+ if ((source === null || source === void 0 ? void 0 : source.name) === undefined) {
39745
+ components.push({
39746
+ name: f.name,
39747
+ type: new basic_1.UnknownType("CDS parser error, unknown source"),
39748
+ });
39749
+ continue;
39750
+ }
39751
+ const lookup = ddic.lookupTableOrView(source.name);
39752
+ if (lookup.type) {
39753
+ if (lookup.type instanceof basic_1.StructureType) {
39754
+ const type = lookup.type.getComponentByName(f.name);
39755
+ if (type) {
39756
+ components.push({
39757
+ name: f.name,
39758
+ type: type,
39759
+ });
39760
+ }
39761
+ else {
39762
+ components.push({
39763
+ name: f.name,
39764
+ type: new basic_1.UnknownType(f.name + " not found in " + source.name + ", CDSDetermineTypes"),
39765
+ });
39766
+ }
39767
+ }
39768
+ else {
39769
+ // its void or unknown
39770
+ components.push({
39771
+ name: f.name,
39772
+ type: lookup.type,
39773
+ });
39774
+ }
39775
+ }
39776
+ else if (reg.inErrorNamespace(source.name)) {
39777
+ components.push({
39778
+ name: f.name,
39779
+ type: new basic_1.UnknownType(source.name + " not found, CDSDetermineTypes"),
39780
+ });
39781
+ }
39782
+ else {
39783
+ components.push({
39784
+ name: f.name,
39785
+ type: new basic_1.VoidType(source.name),
39786
+ });
39787
+ }
39788
+ }
39789
+ else {
39790
+ components.push({
39791
+ name: f.name,
39792
+ type: new basic_1.VoidType("DDLS:fieldname"),
39793
+ });
39794
+ }
39737
39795
  }
39738
- return new basic_1.StructureType(components);
39796
+ return new basic_1.StructureType(components, parsedData.definitionName, parsedData.definitionName, parsedData.description);
39739
39797
  }
39740
39798
  }
39741
39799
  }
@@ -46696,6 +46754,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
46696
46754
  expr = tree.findFirstExpression(expressions_1.CDSDefineProjection);
46697
46755
  }
46698
46756
  for (const e of (expr === null || expr === void 0 ? void 0 : expr.findDirectExpressions(expressions_1.CDSElement)) || []) {
46757
+ let prefix = "";
46699
46758
  let found = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName);
46700
46759
  if (found === undefined) {
46701
46760
  const list = e.findAllExpressions(expressions_1.CDSName);
@@ -46704,6 +46763,9 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
46704
46763
  }
46705
46764
  else {
46706
46765
  found = list[list.length - 1];
46766
+ if (list.length > 1) {
46767
+ prefix = list[0].concatTokens();
46768
+ }
46707
46769
  }
46708
46770
  }
46709
46771
  if (found === undefined) {
@@ -46720,6 +46782,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
46720
46782
  this.parsedData.fields.push({
46721
46783
  name: name,
46722
46784
  annotations: annotations,
46785
+ prefix: prefix,
46723
46786
  key: e.findDirectTokenByText("KEY") !== undefined,
46724
46787
  });
46725
46788
  }
@@ -52894,7 +52957,7 @@ class Registry {
52894
52957
  }
52895
52958
  static abaplintVersion() {
52896
52959
  // magic, see build script "version.sh"
52897
- return "2.113.33";
52960
+ return "2.113.35";
52898
52961
  }
52899
52962
  getDDICReferences() {
52900
52963
  return this.ddicReferences;
@@ -89692,7 +89755,7 @@ var lib = JSON5;
89692
89755
  /******/
89693
89756
  /************************************************************************/
89694
89757
  var __webpack_exports__ = {};
89695
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
89758
+ // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
89696
89759
  (() => {
89697
89760
  "use strict";
89698
89761
  var exports = __webpack_exports__;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.33",
3
+ "version": "2.113.35",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,24 +38,24 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.113.33",
41
+ "@abaplint/core": "^2.113.35",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.9",
46
- "@types/node": "^22.8.2",
46
+ "@types/node": "^22.8.7",
47
47
  "@types/progress": "^2.0.7",
48
48
  "chai": "^4.5.0",
49
49
  "chalk": "^5.3.0",
50
- "eslint": "^9.13.0",
50
+ "eslint": "^9.14.0",
51
51
  "glob": "^7.2.3",
52
52
  "json5": "^2.2.3",
53
53
  "memfs": "^4.14.0",
54
54
  "minimist": "^1.2.8",
55
- "mocha": "^10.7.3",
55
+ "mocha": "^10.8.2",
56
56
  "progress": "^2.0.3",
57
57
  "typescript": "^5.6.3",
58
- "webpack": "^5.95.0",
58
+ "webpack": "^5.96.1",
59
59
  "webpack-cli": "^5.1.4",
60
60
  "xml-js": "^1.6.11"
61
61
  },