@abaplint/cli 2.120.5 → 2.120.6

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 +102 -4
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -31419,6 +31419,10 @@ class InlineData {
31419
31419
  static runSyntax(node, input, type) {
31420
31420
  var _a;
31421
31421
  const token = (_a = node.findFirstExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
31422
+ if (token && token.getStr().length > 30) {
31423
+ const message = "DATA name too long, " + token.getStr();
31424
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, message));
31425
+ }
31422
31426
  if (token && type) {
31423
31427
  if (type instanceof basic_1.CSequenceType || type instanceof basic_1.CLikeType) {
31424
31428
  type = basic_1.StringType.get();
@@ -31590,10 +31594,16 @@ const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expr
31590
31594
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "../core/build/src/abap/types/_typed_identifier.js");
31591
31595
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/abap/types/basic/index.js");
31592
31596
  const _reference_1 = __webpack_require__(/*! ../_reference */ "../core/build/src/abap/5_syntax/_reference.js");
31597
+ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
31593
31598
  class InlineFS {
31594
31599
  static runSyntax(node, input, type) {
31595
31600
  var _a;
31596
31601
  const token = (_a = node.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
31602
+ const fs = node.findFirstExpression(Expressions.FieldSymbol);
31603
+ if (fs && fs.concatTokens().length > 30) {
31604
+ const message = "FIELD-SYMBOLS name too long, " + fs.concatTokens();
31605
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, fs.getFirstToken(), message));
31606
+ }
31597
31607
  if (token && type) {
31598
31608
  const identifier = new _typed_identifier_1.TypedIdentifier(token, input.filename, type, ["inline" /* IdentifierMeta.InlineDefinition */]);
31599
31609
  input.scope.addIdentifier(identifier);
@@ -36728,6 +36738,75 @@ exports.Assign = Assign;
36728
36738
 
36729
36739
  /***/ },
36730
36740
 
36741
+ /***/ "../core/build/src/abap/5_syntax/statements/at_selection_screen.js"
36742
+ /*!*************************************************************************!*\
36743
+ !*** ../core/build/src/abap/5_syntax/statements/at_selection_screen.js ***!
36744
+ \*************************************************************************/
36745
+ (__unused_webpack_module, exports, __webpack_require__) {
36746
+
36747
+ "use strict";
36748
+
36749
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
36750
+ if (k2 === undefined) k2 = k;
36751
+ var desc = Object.getOwnPropertyDescriptor(m, k);
36752
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
36753
+ desc = { enumerable: true, get: function() { return m[k]; } };
36754
+ }
36755
+ Object.defineProperty(o, k2, desc);
36756
+ }) : (function(o, m, k, k2) {
36757
+ if (k2 === undefined) k2 = k;
36758
+ o[k2] = m[k];
36759
+ }));
36760
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
36761
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
36762
+ }) : function(o, v) {
36763
+ o["default"] = v;
36764
+ });
36765
+ var __importStar = (this && this.__importStar) || (function () {
36766
+ var ownKeys = function(o) {
36767
+ ownKeys = Object.getOwnPropertyNames || function (o) {
36768
+ var ar = [];
36769
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
36770
+ return ar;
36771
+ };
36772
+ return ownKeys(o);
36773
+ };
36774
+ return function (mod) {
36775
+ if (mod && mod.__esModule) return mod;
36776
+ var result = {};
36777
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
36778
+ __setModuleDefault(result, mod);
36779
+ return result;
36780
+ };
36781
+ })();
36782
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
36783
+ exports.AtSelectionScreen = void 0;
36784
+ const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expressions */ "../core/build/src/abap/2_statements/expressions/index.js"));
36785
+ const _reference_1 = __webpack_require__(/*! ../_reference */ "../core/build/src/abap/5_syntax/_reference.js");
36786
+ const source_field_1 = __webpack_require__(/*! ../expressions/source_field */ "../core/build/src/abap/5_syntax/expressions/source_field.js");
36787
+ class AtSelectionScreen {
36788
+ runSyntax(node, input) {
36789
+ // "AT SELECTION-SCREEN ON <field>", "ON VALUE-REQUEST FOR <field>",
36790
+ // "ON HELP-REQUEST FOR <field>" and "ON END OF <field>" all reference
36791
+ // a parameter or select-option, register these as read references so
36792
+ // they are not reported as unused.
36793
+ const fields = [
36794
+ ...node.findDirectExpressions(Expressions.FieldSub),
36795
+ ...node.findDirectExpressions(Expressions.Field),
36796
+ ];
36797
+ for (const field of fields) {
36798
+ const token = field.getFirstToken();
36799
+ if (input.scope.findVariable(token.getStr()) !== undefined) {
36800
+ source_field_1.SourceField.runSyntax(field, input, _reference_1.ReferenceType.DataReadReference, false);
36801
+ }
36802
+ }
36803
+ }
36804
+ }
36805
+ exports.AtSelectionScreen = AtSelectionScreen;
36806
+ //# sourceMappingURL=at_selection_screen.js.map
36807
+
36808
+ /***/ },
36809
+
36731
36810
  /***/ "../core/build/src/abap/5_syntax/statements/authority_check.js"
36732
36811
  /*!*********************************************************************!*\
36733
36812
  !*** ../core/build/src/abap/5_syntax/statements/authority_check.js ***!
@@ -39915,14 +39994,19 @@ const Expressions = __importStar(__webpack_require__(/*! ../../2_statements/expr
39915
39994
  const _typed_identifier_1 = __webpack_require__(/*! ../../types/_typed_identifier */ "../core/build/src/abap/types/_typed_identifier.js");
39916
39995
  const basic_types_1 = __webpack_require__(/*! ../basic_types */ "../core/build/src/abap/5_syntax/basic_types.js");
39917
39996
  const unknown_type_1 = __webpack_require__(/*! ../../types/basic/unknown_type */ "../core/build/src/abap/types/basic/unknown_type.js");
39997
+ const _syntax_input_1 = __webpack_require__(/*! ../_syntax_input */ "../core/build/src/abap/5_syntax/_syntax_input.js");
39918
39998
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "../core/build/src/abap/types/basic/index.js");
39919
39999
  class FieldSymbol {
39920
40000
  runSyntax(node, input) {
39921
- var _a;
39922
- const fsname = (_a = node.findFirstExpression(Expressions.FieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
39923
- if (fsname === undefined) {
40001
+ const fs = node.findFirstExpression(Expressions.FieldSymbol);
40002
+ const fsname = fs === null || fs === void 0 ? void 0 : fs.getFirstToken();
40003
+ if (fs === undefined || fsname === undefined) {
39924
40004
  return;
39925
40005
  }
40006
+ if (fs.concatTokens().length > 30) {
40007
+ const message = "FIELD-SYMBOLS name too long, " + fs.concatTokens();
40008
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, fsname, message));
40009
+ }
39926
40010
  if (node.getChildren().length === 5) {
39927
40011
  // no type specified
39928
40012
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, input.filename, basic_1.VoidType.get("FS-SIMPLE")));
@@ -47325,6 +47409,7 @@ const if_1 = __webpack_require__(/*! ./statements/if */ "../core/build/src/abap/
47325
47409
  const else_if_1 = __webpack_require__(/*! ./statements/else_if */ "../core/build/src/abap/5_syntax/statements/else_if.js");
47326
47410
  const append_1 = __webpack_require__(/*! ./statements/append */ "../core/build/src/abap/5_syntax/statements/append.js");
47327
47411
  const selection_screen_1 = __webpack_require__(/*! ./statements/selection_screen */ "../core/build/src/abap/5_syntax/statements/selection_screen.js");
47412
+ const at_selection_screen_1 = __webpack_require__(/*! ./statements/at_selection_screen */ "../core/build/src/abap/5_syntax/statements/at_selection_screen.js");
47328
47413
  const ranges_1 = __webpack_require__(/*! ./statements/ranges */ "../core/build/src/abap/5_syntax/statements/ranges.js");
47329
47414
  const write_1 = __webpack_require__(/*! ./statements/write */ "../core/build/src/abap/5_syntax/statements/write.js");
47330
47415
  const case_1 = __webpack_require__(/*! ./statements/case */ "../core/build/src/abap/5_syntax/statements/case.js");
@@ -47532,6 +47617,7 @@ if (Object.keys(map).length === 0) {
47532
47617
  addToMap(new authority_check_1.AuthorityCheck());
47533
47618
  addToMap(new insert_report_1.InsertReport());
47534
47619
  addToMap(new selection_screen_1.SelectionScreen());
47620
+ addToMap(new at_selection_screen_1.AtSelectionScreen());
47535
47621
  addToMap(new ranges_1.Ranges());
47536
47622
  addToMap(new add_1.Add());
47537
47623
  addToMap(new raise_event_1.RaiseEvent());
@@ -51231,6 +51317,7 @@ class ClassDefinition extends _identifier_1.Identifier {
51231
51317
  this.createVisibilityValue = visibility_1.Visibility.Public;
51232
51318
  }
51233
51319
  // perform checks after everything has been initialized
51320
+ this.checkInterfaceVisibility(input, node);
51234
51321
  this.checkMethodsFromSuperClasses(input);
51235
51322
  this.checkMethodNameLength(input);
51236
51323
  this.checkClassConstructorStatic(input);
@@ -51304,6 +51391,17 @@ class ClassDefinition extends _identifier_1.Identifier {
51304
51391
  }
51305
51392
  }
51306
51393
  }
51394
+ checkInterfaceVisibility(input, node) {
51395
+ const sections = [
51396
+ node.findDirectStructure(Structures.ProtectedSection),
51397
+ node.findDirectStructure(Structures.PrivateSection),
51398
+ ];
51399
+ for (const section of sections) {
51400
+ for (const statement of (section === null || section === void 0 ? void 0 : section.findAllStatements(Statements.InterfaceDef)) || []) {
51401
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, statement.getFirstToken(), "INTERFACES can only be declared in public sections"));
51402
+ }
51403
+ }
51404
+ }
51307
51405
  checkMethodsFromSuperClasses(input) {
51308
51406
  var _a;
51309
51407
  const scope = input.scope;
@@ -69066,7 +69164,7 @@ class Registry {
69066
69164
  }
69067
69165
  static abaplintVersion() {
69068
69166
  // magic, see build script "version.js"
69069
- return "2.120.5";
69167
+ return "2.120.6";
69070
69168
  }
69071
69169
  getDDICReferences() {
69072
69170
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.120.5",
3
+ "version": "2.120.6",
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.5",
42
+ "@abaplint/core": "^2.120.6",
43
43
  "@types/chai": "^4.3.20",
44
44
  "@types/minimist": "^1.2.5",
45
45
  "@types/mocha": "^10.0.10",