@abaplint/cli 2.120.36 → 2.120.38

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 +40 -5
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -10801,6 +10801,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
10801
10801
  exports.TypeParam = void 0;
10802
10802
  const combi_1 = __webpack_require__(/*! ../combi */ "../core/build/src/abap/2_statements/combi.js");
10803
10803
  const _1 = __webpack_require__(/*! . */ "../core/build/src/abap/2_statements/expressions/index.js");
10804
+ const version_1 = __webpack_require__(/*! ../../../version */ "../core/build/src/version.js");
10805
+ const _derived_types_1 = __webpack_require__(/*! ./_derived_types */ "../core/build/src/abap/2_statements/expressions/_derived_types.js");
10804
10806
  class TypeParam extends combi_1.Expression {
10805
10807
  getRunnable() {
10806
10808
  const table = (0, combi_1.seq)((0, combi_1.altPrio)("STANDARD", "HASHED", "INDEX", "SORTED", "ANY"), "TABLE");
@@ -10808,7 +10810,10 @@ class TypeParam extends combi_1.Expression {
10808
10810
  const typeLine = "LINE OF";
10809
10811
  const ret = (0, combi_1.seq)((0, combi_1.alt)(foo, typeLine), _1.TypeNameOrInfer, (0, combi_1.opt)(_1.Default));
10810
10812
  const like = (0, combi_1.seq)("LIKE", (0, combi_1.opt)("LINE OF"), _1.FieldChain, (0, combi_1.optPrio)(_1.Default));
10811
- return (0, combi_1.alt)((0, combi_1.seq)("TYPE", (0, combi_1.alt)(table, ret)), like);
10813
+ const entity = (0, combi_1.alt)(_1.TypeName, _1.EntityAssociation);
10814
+ const rapTable = (0, combi_1.ver)(version_1.Release.v770, (0, combi_1.seq)("TYPE", "TABLE FOR", (0, _derived_types_1.derivedTypesAlt)((0, combi_1.ver)(version_1.Release.v773, (0, combi_1.seq)("ACTION IMPORT", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.ver)(version_1.Release.v774, (0, combi_1.seq)("READ LINK", entity), { also: combi_1.AlsoIn.OpenABAP }), (0, combi_1.ver)(version_1.Release.v787, (0, combi_1.seq)("EVENT", entity), { also: combi_1.AlsoIn.OpenABAP })), (0, combi_1.optPrio)("VALUE IS INITIAL")), { also: combi_1.AlsoIn.OpenABAP });
10815
+ // Method parameters also allow the RAP table and response type forms.
10816
+ return (0, combi_1.altPrio)(rapTable, _1.TypeStructure, (0, combi_1.seq)("TYPE", (0, combi_1.alt)(table, ret)), like);
10812
10817
  }
10813
10818
  }
10814
10819
  exports.TypeParam = TypeParam;
@@ -27903,6 +27908,29 @@ class TypeUtils {
27903
27908
  }
27904
27909
  return this.isAssignable(source, target);
27905
27910
  }
27911
+ // Typing with the classic STRUCTURE addition, ie. "FORM foo USING bar STRUCTURE zkey",
27912
+ // is not a compatibility check: ABAP only checks the fragment view up to the end of the
27913
+ // formal structure, so the actual parameter is allowed to be longer. For TABLES parameters
27914
+ // the table key is not part of the check at all.
27915
+ isAssignableStructureTyping(source, target, node) {
27916
+ if (source instanceof basic_1.StructureType && target instanceof basic_1.StructureType) {
27917
+ const sourceComponents = source.getComponents();
27918
+ const targetComponents = target.getComponents();
27919
+ if (sourceComponents.length < targetComponents.length) {
27920
+ return false;
27921
+ }
27922
+ for (let i = 0; i < targetComponents.length; i++) {
27923
+ if (this.isAssignableStrict(sourceComponents[i].type, targetComponents[i].type) === false) {
27924
+ return false;
27925
+ }
27926
+ }
27927
+ return true;
27928
+ }
27929
+ else if (source instanceof basic_1.TableType && target instanceof basic_1.TableType) {
27930
+ return this.isAssignableStructureTyping(source.getRowType(), target.getRowType());
27931
+ }
27932
+ return this.isAssignableStrict(source, target, node);
27933
+ }
27906
27934
  isAssignable(source, target) {
27907
27935
  if (source === undefined || target === undefined) {
27908
27936
  return true;
@@ -31505,7 +31533,7 @@ class FormParam {
31505
31533
  else {
31506
31534
  type = new basic_1.UnknownType("todo, FORM STRUCTURES typing");
31507
31535
  }
31508
- return new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, type, ["form_parameter" /* IdentifierMeta.FormParameter */]);
31536
+ return new _typed_identifier_1.TypedIdentifier(nameToken, input.filename, type, ["form_parameter" /* IdentifierMeta.FormParameter */, "form_parameter_structure" /* IdentifierMeta.FormParameterStructure */]);
31509
31537
  }
31510
31538
  if (node.getChildren().length === 1 && nameToken) {
31511
31539
  // untyped FORM parameter
@@ -43725,7 +43753,11 @@ class Perform {
43725
43753
  continue;
43726
43754
  }
43727
43755
  const parameter = formal[i];
43728
- if (typeUtils.isAssignableStrict(type, parameter.getType(), source) === false) {
43756
+ const structureTyping = parameter.getMeta().includes("form_parameter_structure" /* IdentifierMeta.FormParameterStructure */);
43757
+ const assignable = structureTyping
43758
+ ? typeUtils.isAssignableStructureTyping(type, parameter.getType(), source)
43759
+ : typeUtils.isAssignableStrict(type, parameter.getType(), source);
43760
+ if (assignable === false) {
43729
43761
  const message = `PERFORM parameter type not compatible, ${parameter.getName()}`;
43730
43762
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, source.getFirstToken(), message));
43731
43763
  return false;
@@ -52608,7 +52640,8 @@ class FormDefinition extends _identifier_1.Identifier {
52608
52640
  else if (!(type instanceof basic_1.UnknownType) && !(type instanceof basic_1.VoidType)) {
52609
52641
  type = new basic_1.UnknownType("FORM TABLES type must be table type");
52610
52642
  }
52611
- ret.push(new _typed_identifier_1.TypedIdentifier(p.getToken(), input.filename, type, ["form_parameter" /* IdentifierMeta.FormParameter */]));
52643
+ // keep the meta from FormParam, so STRUCTURE typing can be recognized later
52644
+ ret.push(new _typed_identifier_1.TypedIdentifier(p.getToken(), input.filename, type, p.getMeta()));
52612
52645
  }
52613
52646
  }
52614
52647
  return ret;
@@ -70119,7 +70152,7 @@ class Registry {
70119
70152
  }
70120
70153
  static abaplintVersion() {
70121
70154
  // magic, see build script "version.js"
70122
- return "2.120.36";
70155
+ return "2.120.38";
70123
70156
  }
70124
70157
  getDDICReferences() {
70125
70158
  return this.ddicReferences;
@@ -73766,6 +73799,7 @@ https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/abenchained_stat
73766
73799
  || statement instanceof Statements.Ranges
73767
73800
  || statement instanceof Statements.TypePools
73768
73801
  || statement instanceof Statements.FieldSymbol
73802
+ || statement instanceof Statements.Nodes
73769
73803
  || statement instanceof Statements.Data
73770
73804
  || statement instanceof Statements.DataBegin
73771
73805
  || statement instanceof Statements.DataEnd)) {
@@ -100662,6 +100696,7 @@ exports.DECLARATION_STUFF = exports.SELECTION_EVENTS = void 0;
100662
100696
  const Statements = __importStar(__webpack_require__(/*! ./abap/2_statements/statements */ "../core/build/src/abap/2_statements/statements/index.js"));
100663
100697
  exports.SELECTION_EVENTS = [
100664
100698
  Statements.StartOfSelection,
100699
+ Statements.Get,
100665
100700
  Statements.AtSelectionScreen,
100666
100701
  Statements.AtLineSelection,
100667
100702
  Statements.AtPF,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.36",
3
+ "version": "2.120.38",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "homepage": "https://abaplint.org",
41
41
  "devDependencies": {
42
- "@abaplint/core": "^2.120.36",
42
+ "@abaplint/core": "^2.120.38",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",