@abaplint/cli 2.113.213 → 2.113.215

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 +34 -28
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -24552,7 +24552,7 @@ class BasicTypes {
24552
24552
  throw new Error("parseType, componentName expected");
24553
24553
  }
24554
24554
  if (found instanceof Types.StructureType) {
24555
- const newComponents = found.getComponents();
24555
+ const newComponents = [...found.getComponents()];
24556
24556
  newComponents.push({ name: componentName, type: Types.VoidType.get("INDICATORStodo") });
24557
24557
  found = new Types.StructureType(newComponents, qualifiedName);
24558
24558
  }
@@ -26017,13 +26017,13 @@ class FieldChain {
26017
26017
  }
26018
26018
  else if (current instanceof nodes_1.ExpressionNode
26019
26019
  && current.get() instanceof Expressions.TableExpression) {
26020
- if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType)) {
26020
+ if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType) && !(context instanceof basic_1.UnknownType)) {
26021
26021
  const message = "Table expression, expected table";
26022
26022
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, current.getFirstToken(), message));
26023
26023
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
26024
26024
  }
26025
26025
  table_expression_1.TableExpression.runSyntax(current, input, context);
26026
- if (!(context instanceof basic_1.VoidType)) {
26026
+ if (!(context instanceof basic_1.VoidType) && !(context instanceof basic_1.UnknownType)) {
26027
26027
  context = context.getRowType();
26028
26028
  }
26029
26029
  }
@@ -27859,9 +27859,13 @@ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modu
27859
27859
  const isSimple = /^\w+$/;
27860
27860
  class Select {
27861
27861
  static runSyntax(node, input, skipImplicitInto = false) {
27862
- var _a;
27862
+ var _a, _b;
27863
27863
  const token = node.getFirstToken();
27864
- const from = node.findDirectExpression(Expressions.SQLFrom);
27864
+ let from = node.findDirectExpression(Expressions.SQLFrom);
27865
+ if (from === undefined) {
27866
+ // huh, sometimes the select expression is wrapped
27867
+ from = node.findFirstExpression(Expressions.SQLFrom);
27868
+ }
27865
27869
  const dbSources = from ? sql_from_1.SQLFrom.runSyntax(from, input) : [];
27866
27870
  if (from === undefined) {
27867
27871
  const message = `Missing FROM`;
@@ -27876,7 +27880,7 @@ class Select {
27876
27880
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
27877
27881
  return;
27878
27882
  }
27879
- const isSingle = node.getChildren()[1].concatTokens().toUpperCase() === "SINGLE"
27883
+ const isSingle = ((_a = node.getChildren()[1]) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase()) === "SINGLE"
27880
27884
  || node.get() instanceof Expressions.SelectLoop;
27881
27885
  this.checkFields(fields, dbSources, input, node);
27882
27886
  this.handleInto(node, input, fields, dbSources, isSingle);
@@ -27893,7 +27897,7 @@ class Select {
27893
27897
  && node.findDirectExpression(Expressions.SQLIntoTable) === undefined
27894
27898
  && node.findDirectExpression(Expressions.SQLIntoList) === undefined
27895
27899
  && node.findDirectExpression(Expressions.SQLIntoStructure) === undefined) {
27896
- const fields = (_a = node.findFirstExpression(Expressions.SQLAggregation)) === null || _a === void 0 ? void 0 : _a.concatTokens();
27900
+ const fields = (_b = node.findFirstExpression(Expressions.SQLAggregation)) === null || _b === void 0 ? void 0 : _b.concatTokens();
27897
27901
  const c = new RegExp(/^count\(\s*\*\s*\)$/, "i");
27898
27902
  if (fields === undefined || c.test(fields) === false) {
27899
27903
  const nameToken = from === null || from === void 0 ? void 0 : from.findDirectExpression(Expressions.SQLFromSource);
@@ -29155,13 +29159,13 @@ class Target {
29155
29159
  }
29156
29160
  else if (current instanceof nodes_1.ExpressionNode
29157
29161
  && current.get() instanceof Expressions.TableExpression) {
29158
- if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType)) {
29162
+ if (!(context instanceof basic_1.TableType) && !(context instanceof basic_1.VoidType) && !(context instanceof unknown_type_1.UnknownType)) {
29159
29163
  const message = "Table expression, expected table";
29160
29164
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
29161
29165
  return basic_1.VoidType.get(_syntax_input_1.CheckSyntaxKey);
29162
29166
  }
29163
29167
  table_expression_1.TableExpression.runSyntax(current, input, context);
29164
- if (!(context instanceof basic_1.VoidType)) {
29168
+ if (!(context instanceof basic_1.VoidType) && !(context instanceof unknown_type_1.UnknownType)) {
29165
29169
  context = context.getRowType();
29166
29170
  }
29167
29171
  }
@@ -29985,7 +29989,7 @@ class Append {
29985
29989
  }
29986
29990
  const fsTarget = node.findExpressionAfterToken("ASSIGNING");
29987
29991
  if (fsTarget && fsTarget.get() instanceof Expressions.FSTarget) {
29988
- if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType)) {
29992
+ if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType) && !(targetType instanceof basic_1.UnknownType)) {
29989
29993
  const message = "APPEND to non table type, " + (targetType === null || targetType === void 0 ? void 0 : targetType.constructor.name);
29990
29994
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
29991
29995
  return;
@@ -29995,7 +29999,7 @@ class Append {
29995
29999
  }
29996
30000
  const dataTarget = node.findExpressionAfterToken("INTO");
29997
30001
  if (dataTarget && node.concatTokens().toUpperCase().includes(" REFERENCE INTO DATA(")) {
29998
- if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType)) {
30002
+ if (!(targetType instanceof basic_1.TableType) && !(targetType instanceof basic_1.VoidType) && !(targetType instanceof basic_1.UnknownType)) {
29999
30003
  const message = "APPEND to non table type, " + (targetType === null || targetType === void 0 ? void 0 : targetType.constructor.name);
30000
30004
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
30001
30005
  return;
@@ -40672,7 +40676,7 @@ class CDSDetermineTypes {
40672
40676
  }
40673
40677
  components.push({
40674
40678
  name: f.name,
40675
- type: new basic_1.UnknownType("CDS parser error, unknown source, " + ddlsName),
40679
+ type: new basic_1.UnknownType("CDS parser error, unknown source, " + f.name + ", " + ddlsName),
40676
40680
  });
40677
40681
  continue;
40678
40682
  }
@@ -41234,7 +41238,7 @@ const _1 = __webpack_require__(/*! . */ "./node_modules/@abaplint/core/build/src
41234
41238
  const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js");
41235
41239
  class CDSCast extends combi_1.Expression {
41236
41240
  getRunnable() {
41237
- const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", _1.CDSName)));
41241
+ const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.starPrio)((0, combi_1.seq)(".", _1.CDSName)));
41238
41242
  return (0, combi_1.seq)("CAST", "(", (0, combi_1.altPrio)(_1.CDSFunction, _1.CDSCase, _1.CDSAggregate, _1.CDSArithmetics, CDSCast, _1.CDSString, name), "AS", _1.CDSType, (0, combi_1.optPrio)((0, combi_1.seq)("PRESERVING", "TYPE")), ")");
41239
41243
  }
41240
41244
  }
@@ -41281,7 +41285,7 @@ const combi_1 = __webpack_require__(/*! ../../abap/2_statements/combi */ "./node
41281
41285
  const cds_integer_1 = __webpack_require__(/*! ./cds_integer */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_integer.js");
41282
41286
  class CDSCondition extends combi_1.Expression {
41283
41287
  getRunnable() {
41284
- const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.optPrio)((0, combi_1.seq)(".", (0, combi_1.altPrio)(_1.CDSString, _1.CDSName))));
41288
+ const name = (0, combi_1.seq)(_1.CDSName, (0, combi_1.starPrio)((0, combi_1.seq)(".", (0, combi_1.altPrio)(_1.CDSString, _1.CDSName))));
41285
41289
  const left = (0, combi_1.altPrio)(_1.CDSString, _1.CDSFunction, _1.CDSAggregate, name);
41286
41290
  const operators = (0, combi_1.altPrio)("=", (0, combi_1.seq)("!", "="), (0, combi_1.seq)("<", ">"), (0, combi_1.seq)(">", "="), (0, combi_1.seq)("<", "="), "<", ">", "LIKE", "NOT LIKE");
41287
41291
  const compare = (0, combi_1.seq)(operators, (0, combi_1.altPrio)(left, cds_integer_1.CDSInteger));
@@ -41437,8 +41441,8 @@ const cds_cast_1 = __webpack_require__(/*! ./cds_cast */ "./node_modules/@abapli
41437
41441
  class CDSElement extends combi_1.Expression {
41438
41442
  getRunnable() {
41439
41443
  const redirected = (0, combi_1.seq)(": REDIRECTED TO", (0, combi_1.opt)((0, combi_1.alt)("PARENT", "COMPOSITION CHILD")), _1.CDSName);
41440
- const colonThing = (0, combi_1.seq)(":", (0, combi_1.alt)(_1.CDSName, _1.CDSType));
41441
- return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.altPrio)("KEY", "VIRTUAL")), (0, combi_1.altPrio)(_1.CDSAggregate, _1.CDSString, _1.CDSArithmetics, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.opt)((0, combi_1.alt)(redirected, colonThing))), _1.CDSInteger), (0, combi_1.opt)(cds_as_1.CDSAs));
41444
+ const colonThing = (0, combi_1.seq)(":", (0, combi_1.alt)(_1.CDSName, _1.CDSType, "LOCALIZED"));
41445
+ return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)((0, combi_1.altPrio)("KEY", "VIRTUAL")), (0, combi_1.altPrio)(_1.CDSAggregate, _1.CDSString, _1.CDSArithmetics, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)("(", _1.CDSCase, ")"), (0, combi_1.seq)(_1.CDSPrefixedName, (0, combi_1.opt)(cds_as_1.CDSAs), (0, combi_1.opt)((0, combi_1.alt)(redirected, colonThing))), _1.CDSInteger), (0, combi_1.opt)(cds_as_1.CDSAs));
41442
41446
  }
41443
41447
  }
41444
41448
  exports.CDSElement = CDSElement;
@@ -41643,7 +41647,7 @@ class CDSJoin extends combi_1.Expression {
41643
41647
  getRunnable() {
41644
41648
  const cond = (0, combi_1.seq)(_1.CDSSource, "ON", cds_condition_1.CDSCondition);
41645
41649
  const foo = (0, combi_1.altPrio)((0, combi_1.seq)("(", cond, ")"), cond);
41646
- return (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("LEFT OUTER TO ONE", "LEFT OUTER", "INNER")), "JOIN", foo);
41650
+ return (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)("LEFT OUTER TO ONE", "LEFT OUTER", "INNER", "CROSS")), "JOIN", foo);
41647
41651
  }
41648
41652
  }
41649
41653
  exports.CDSJoin = CDSJoin;
@@ -48049,7 +48053,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
48049
48053
  return undefined;
48050
48054
  }
48051
48055
  findFieldNames(tree) {
48052
- var _a, _b;
48056
+ var _a, _b, _c;
48053
48057
  let expr = tree.findFirstExpression(expressions_1.CDSSelect);
48054
48058
  if (expr === undefined) {
48055
48059
  expr = tree.findFirstExpression(expressions_1.CDSAnnotate);
@@ -48061,14 +48065,16 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
48061
48065
  let prefix = "";
48062
48066
  let found = (_a = e.findDirectExpression(expressions_1.CDSAs)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.CDSName);
48063
48067
  if (found === undefined) {
48064
- const list = e.findAllExpressions(expressions_1.CDSName);
48065
- if (e.concatTokens().toUpperCase().includes(" REDIRECTED TO ")) {
48066
- found = list[0];
48067
- }
48068
- else {
48069
- found = list[list.length - 1];
48070
- if (list.length > 1) {
48071
- prefix = list[0].concatTokens();
48068
+ const list = (_b = e.findDirectExpression(expressions_1.CDSPrefixedName)) === null || _b === void 0 ? void 0 : _b.findAllExpressions(expressions_1.CDSName);
48069
+ if (list) {
48070
+ if (e.concatTokens().toUpperCase().includes(" REDIRECTED TO ")) {
48071
+ found = list[0];
48072
+ }
48073
+ else {
48074
+ found = list[list.length - 1];
48075
+ if (list.length > 1) {
48076
+ prefix = list[0].concatTokens();
48077
+ }
48072
48078
  }
48073
48079
  }
48074
48080
  }
@@ -48076,7 +48082,7 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
48076
48082
  continue;
48077
48083
  }
48078
48084
  const name = found === null || found === void 0 ? void 0 : found.concatTokens();
48079
- if ((_b = this.parsedData) === null || _b === void 0 ? void 0 : _b.associations.some(a => { var _a; return a.name.toUpperCase() === name.toUpperCase() || ((_a = a.as) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === name.toUpperCase(); })) {
48085
+ if ((_c = this.parsedData) === null || _c === void 0 ? void 0 : _c.associations.some(a => { var _a; return a.name.toUpperCase() === name.toUpperCase() || ((_a = a.as) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === name.toUpperCase(); })) {
48080
48086
  continue;
48081
48087
  }
48082
48088
  const annotations = [];
@@ -54512,7 +54518,7 @@ class Registry {
54512
54518
  }
54513
54519
  static abaplintVersion() {
54514
54520
  // magic, see build script "version.sh"
54515
- return "2.113.213";
54521
+ return "2.113.215";
54516
54522
  }
54517
54523
  getDDICReferences() {
54518
54524
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.213",
3
+ "version": "2.113.215",
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.213",
41
+ "@abaplint/core": "^2.113.215",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",