@abaplint/cli 2.113.50 → 2.113.52

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 +50 -29
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -16218,7 +16218,7 @@ class SelectionScreen {
16218
16218
  const posIntegers = (0, combi_1.regex)(/^(0?[1-9]|[1234567][0-9]|8[0-3])$/);
16219
16219
  const pos = (0, combi_1.seq)("POSITION", (0, combi_1.altPrio)(posIntegers, posSymbols));
16220
16220
  const incl = (0, combi_1.seq)("INCLUDE BLOCKS", expressions_1.BlockName);
16221
- const tabbed = (0, combi_1.seq)("BEGIN OF TABBED BLOCK", expressions_1.InlineField, "FOR", expressions_1.Integer, "LINES", (0, combi_1.optPrio)("NO INTERVALS"));
16221
+ const tabbed = (0, combi_1.seq)("BEGIN OF TABBED BLOCK", expressions_1.BlockName, "FOR", expressions_1.Integer, "LINES", (0, combi_1.optPrio)("NO INTERVALS"));
16222
16222
  const uline = (0, combi_1.seq)("ULINE", (0, combi_1.opt)(position));
16223
16223
  const param = (0, combi_1.seq)("INCLUDE PARAMETERS", expressions_1.Field);
16224
16224
  const iso = (0, combi_1.seq)("INCLUDE SELECT-OPTIONS", expressions_1.Field);
@@ -21957,7 +21957,7 @@ class ObjectOriented {
21957
21957
  return ret;
21958
21958
  }
21959
21959
  addAliasedAttributes(classDefinition) {
21960
- for (const alias of classDefinition.getAliases()) {
21960
+ for (const alias of classDefinition.getAliases() || []) {
21961
21961
  const comp = alias.getComponent();
21962
21962
  const idef = this.scope.findInterfaceDefinition(comp.split("~")[0]);
21963
21963
  if (idef) {
@@ -21989,7 +21989,7 @@ class ObjectOriented {
21989
21989
  return undefined;
21990
21990
  }
21991
21991
  findMethodViaAlias(methodName, def) {
21992
- for (const a of def.getAliases()) {
21992
+ for (const a of def.getAliases() || []) {
21993
21993
  if (a.getName().toUpperCase() === methodName.toUpperCase()) {
21994
21994
  const comp = a.getComponent();
21995
21995
  const res = this.findMethodInInterface(comp.split("~")[0], comp.split("~")[1]);
@@ -22072,9 +22072,12 @@ class ObjectOriented {
22072
22072
  return undefined;
22073
22073
  }
22074
22074
  const upper = name.toUpperCase();
22075
- for (const a of def.getAttributes().getAll()) {
22076
- if (a.getName().toUpperCase() === upper) {
22077
- return a;
22075
+ const attr = def.getAttributes();
22076
+ if (attr) {
22077
+ for (const a of attr.getAll()) {
22078
+ if (a.getName().toUpperCase() === upper) {
22079
+ return a;
22080
+ }
22078
22081
  }
22079
22082
  }
22080
22083
  for (const a of def.getAliases() || []) {
@@ -22188,7 +22191,11 @@ class ObjectOriented {
22188
22191
  return { method: undefined, def: undefined };
22189
22192
  }
22190
22193
  findMethod(def, methodName) {
22191
- for (const method of def.getMethodDefinitions().getAll()) {
22194
+ const defs = def.getMethodDefinitions();
22195
+ if (defs === undefined) {
22196
+ return undefined;
22197
+ }
22198
+ for (const method of defs.getAll()) {
22192
22199
  if (method.getName().toUpperCase() === methodName.toUpperCase()) {
22193
22200
  if (method.isRedefinition()) {
22194
22201
  return this.findMethodInSuper(def, methodName);
@@ -26953,7 +26960,7 @@ class Select {
26953
26960
  const fields = this.findFields(node, input);
26954
26961
  if (fields.length === 0
26955
26962
  && node.findDirectExpression(Expressions.SQLFieldListLoop) === undefined) {
26956
- const message = `fields missing`;
26963
+ const message = `SELECT: fields missing`;
26957
26964
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
26958
26965
  return;
26959
26966
  }
@@ -27132,7 +27139,7 @@ class Select {
27132
27139
  const ret = [];
27133
27140
  expr = node.findFirstExpression(Expressions.SQLFieldList);
27134
27141
  if (expr === undefined) {
27135
- expr = node.findDirectExpression(Expressions.SQLFieldListLoop);
27142
+ expr = node.findFirstExpression(Expressions.SQLFieldListLoop);
27136
27143
  }
27137
27144
  if (((_a = expr === null || expr === void 0 ? void 0 : expr.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Dynamic) {
27138
27145
  new dynamic_1.Dynamic().runSyntax(expr.getFirstChild(), input);
@@ -27299,7 +27306,7 @@ class Source {
27299
27306
  const foundType = this.determineType(node, input, targetType);
27300
27307
  const bodyType = new conv_body_1.ConvBody().runSyntax(node.findDirectExpression(Expressions.ConvBody), input);
27301
27308
  if (new _type_utils_1.TypeUtils(input.scope).isAssignable(foundType, bodyType) === false) {
27302
- const message = "CONV: Types not compatible";
27309
+ const message = `CONV: Types not compatible, ${foundType === null || foundType === void 0 ? void 0 : foundType.constructor.name}, ${bodyType === null || bodyType === void 0 ? void 0 : bodyType.constructor.name}`;
27303
27310
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
27304
27311
  return new basic_1.VoidType(_syntax_input_1.CheckSyntaxKey);
27305
27312
  }
@@ -29584,8 +29591,11 @@ class ClassImplementation {
29584
29591
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
29585
29592
  return;
29586
29593
  }
29587
- for (const t of classDefinition.getTypeDefinitions().getAll()) {
29588
- input.scope.addType(t.type);
29594
+ const types = classDefinition.getTypeDefinitions();
29595
+ if (types !== undefined) {
29596
+ for (const t of types.getAll()) {
29597
+ input.scope.addType(t.type);
29598
+ }
29589
29599
  }
29590
29600
  const sup = input.scope.findClassDefinition(classDefinition.getSuperClass());
29591
29601
  if (sup) {
@@ -29598,10 +29608,12 @@ class ClassImplementation {
29598
29608
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(new tokens_1.Identifier(new position_1.Position(1, 1), "me"), _builtin_1.BuiltIn.filename, new basic_1.ObjectReferenceType(classDefinition)));
29599
29609
  helper.addAliasedAttributes(classDefinition); // todo, this is not correct, take care of instance vs static
29600
29610
  const classAttributes = classDefinition.getAttributes();
29601
- input.scope.addList(classAttributes.getConstants());
29602
- input.scope.addList(classAttributes.getStatic());
29603
- for (const i of classAttributes.getInstance()) {
29604
- input.scope.addExtraLikeType(i);
29611
+ if (classAttributes !== undefined) {
29612
+ input.scope.addList(classAttributes.getConstants());
29613
+ input.scope.addList(classAttributes.getStatic());
29614
+ for (const i of classAttributes.getInstance()) {
29615
+ input.scope.addExtraLikeType(i);
29616
+ }
29605
29617
  }
29606
29618
  helper.fromSuperClassesAndInterfaces(classDefinition);
29607
29619
  }
@@ -32857,30 +32869,35 @@ const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@ab
32857
32869
  const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_syntax_input.js");
32858
32870
  class SelectionScreen {
32859
32871
  runSyntax(node, input) {
32860
- const field = node.findFirstExpression(Expressions.InlineField);
32861
- if (field === undefined) {
32872
+ const blockNode = node.findFirstExpression(Expressions.BlockName);
32873
+ const blockToken = blockNode === null || blockNode === void 0 ? void 0 : blockNode.getFirstToken();
32874
+ const blockName = blockNode === null || blockNode === void 0 ? void 0 : blockNode.concatTokens();
32875
+ if (blockName !== undefined && blockName.length > 16) {
32876
+ const message = "SELECTION-SCREEN block name too long, " + blockName;
32877
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
32862
32878
  return;
32863
32879
  }
32864
- if (field.getFirstToken().getStr().length > 8) {
32880
+ const field = node.findFirstExpression(Expressions.InlineField);
32881
+ if (field !== undefined && field.getFirstToken().getStr().length > 8) {
32865
32882
  const message = "SELECTION-SCREEN name too long, " + field.getFirstToken().getStr();
32866
32883
  input.issues.push((0, _syntax_input_1.syntaxIssue)(input, field.getFirstToken(), message));
32867
32884
  return;
32868
32885
  }
32869
- const name = field.getFirstToken();
32886
+ const fieldName = field === null || field === void 0 ? void 0 : field.getFirstToken();
32870
32887
  const concat = node.concatTokens().toUpperCase();
32871
- if (concat.includes("BEGIN OF TABBED BLOCK")) {
32888
+ if (concat.includes("BEGIN OF TABBED BLOCK") && blockToken) {
32872
32889
  const type = new basic_1.StructureType([
32873
32890
  { name: "PROG", type: new basic_1.CharacterType(40) },
32874
32891
  { name: "DYNNR", type: new basic_1.CharacterType(4) },
32875
32892
  { name: "ACTIVETAB", type: new basic_1.CharacterType(132) },
32876
32893
  ]);
32877
- input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(name, input.filename, type, ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
32894
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(blockToken, input.filename, type, ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
32878
32895
  }
32879
- else if (concat.startsWith("SELECTION-SCREEN TAB")) {
32880
- input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(name, input.filename, new basic_1.CharacterType(83), ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
32896
+ else if (concat.startsWith("SELECTION-SCREEN TAB") && fieldName) {
32897
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fieldName, input.filename, new basic_1.CharacterType(83), ["selection_screen_tab" /* IdentifierMeta.SelectionScreenTab */]));
32881
32898
  }
32882
- else {
32883
- input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(name, input.filename, new basic_1.CharacterType(83)));
32899
+ else if (fieldName) {
32900
+ input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fieldName, input.filename, new basic_1.CharacterType(83)));
32884
32901
  }
32885
32902
  }
32886
32903
  }
@@ -40561,7 +40578,7 @@ const cds_as_1 = __webpack_require__(/*! ./cds_as */ "./node_modules/@abaplint/c
40561
40578
  const cds_cast_1 = __webpack_require__(/*! ./cds_cast */ "./node_modules/@abaplint/core/build/src/cds/expressions/cds_cast.js");
40562
40579
  class CDSElement extends combi_1.Expression {
40563
40580
  getRunnable() {
40564
- return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), (0, combi_1.altPrio)(_1.CDSAggregate, _1.CDSString, _1.CDSFunction, _1.CDSArithmetics, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)(_1.CDSName, ": REDIRECTED TO", (0, combi_1.opt)((0, combi_1.alt)("PARENT", "COMPOSITION CHILD")), _1.CDSName), _1.CDSPrefixedName, (0, combi_1.regex)(/^\d+$/)), (0, combi_1.opt)(cds_as_1.CDSAs));
40581
+ return (0, combi_1.seq)((0, combi_1.starPrio)(_1.CDSAnnotation), (0, combi_1.optPrio)("KEY"), (0, combi_1.altPrio)(_1.CDSAggregate, _1.CDSString, _1.CDSArithmetics, _1.CDSFunction, cds_cast_1.CDSCast, _1.CDSCase, (0, combi_1.seq)(_1.CDSName, ": REDIRECTED TO", (0, combi_1.opt)((0, combi_1.alt)("PARENT", "COMPOSITION CHILD")), _1.CDSName), _1.CDSPrefixedName, (0, combi_1.regex)(/^\d+$/)), (0, combi_1.opt)(cds_as_1.CDSAs));
40565
40582
  }
40566
40583
  }
40567
40584
  exports.CDSElement = CDSElement;
@@ -53109,7 +53126,7 @@ class Registry {
53109
53126
  }
53110
53127
  static abaplintVersion() {
53111
53128
  // magic, see build script "version.sh"
53112
- return "2.113.50";
53129
+ return "2.113.52";
53113
53130
  }
53114
53131
  getDDICReferences() {
53115
53132
  return this.ddicReferences;
@@ -71466,7 +71483,11 @@ class SelectionScreenNaming extends _abap_rule_1.ABAPRule {
71466
71483
  return statNode.findFirstExpression(expressions_1.FieldSub);
71467
71484
  }
71468
71485
  else if (statNode.get() instanceof statements_1.SelectionScreen) {
71469
- return statNode.findFirstExpression(expressions_1.InlineField);
71486
+ let ret = statNode.findFirstExpression(expressions_1.InlineField);
71487
+ if (ret === undefined && statNode.concatTokens().toUpperCase().includes(" BEGIN OF TABBED BLOCK")) {
71488
+ ret = statNode.findFirstExpression(expressions_1.BlockName);
71489
+ }
71490
+ return ret;
71470
71491
  }
71471
71492
  else {
71472
71493
  return undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.50",
3
+ "version": "2.113.52",
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.50",
41
+ "@abaplint/core": "^2.113.52",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",