@abaplint/core 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.
@@ -1259,6 +1259,7 @@ declare class ClassDefinition_3 extends Identifier implements IClassDefinition {
1259
1259
  private findSuper;
1260
1260
  private checkMethodNameLength;
1261
1261
  private checkClassConstructorStatic;
1262
+ private checkInterfaceVisibility;
1262
1263
  private checkMethodsFromSuperClasses;
1263
1264
  private findFriends;
1264
1265
  private addReference;
@@ -43,6 +43,10 @@ class InlineData {
43
43
  static runSyntax(node, input, type) {
44
44
  var _a;
45
45
  const token = (_a = node.findFirstExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
46
+ if (token && token.getStr().length > 30) {
47
+ const message = "DATA name too long, " + token.getStr();
48
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, token, message));
49
+ }
46
50
  if (token && type) {
47
51
  if (type instanceof basic_1.CSequenceType || type instanceof basic_1.CLikeType) {
48
52
  type = basic_1.StringType.get();
@@ -38,10 +38,16 @@ const Expressions = __importStar(require("../../2_statements/expressions"));
38
38
  const _typed_identifier_1 = require("../../types/_typed_identifier");
39
39
  const basic_1 = require("../../types/basic");
40
40
  const _reference_1 = require("../_reference");
41
+ const _syntax_input_1 = require("../_syntax_input");
41
42
  class InlineFS {
42
43
  static runSyntax(node, input, type) {
43
44
  var _a;
44
45
  const token = (_a = node.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
46
+ const fs = node.findFirstExpression(Expressions.FieldSymbol);
47
+ if (fs && fs.concatTokens().length > 30) {
48
+ const message = "FIELD-SYMBOLS name too long, " + fs.concatTokens();
49
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, fs.getFirstToken(), message));
50
+ }
45
51
  if (token && type) {
46
52
  const identifier = new _typed_identifier_1.TypedIdentifier(token, input.filename, type, ["inline" /* IdentifierMeta.InlineDefinition */]);
47
53
  input.scope.addIdentifier(identifier);
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AtSelectionScreen = void 0;
37
+ const Expressions = __importStar(require("../../2_statements/expressions"));
38
+ const _reference_1 = require("../_reference");
39
+ const source_field_1 = require("../expressions/source_field");
40
+ class AtSelectionScreen {
41
+ runSyntax(node, input) {
42
+ // "AT SELECTION-SCREEN ON <field>", "ON VALUE-REQUEST FOR <field>",
43
+ // "ON HELP-REQUEST FOR <field>" and "ON END OF <field>" all reference
44
+ // a parameter or select-option, register these as read references so
45
+ // they are not reported as unused.
46
+ const fields = [
47
+ ...node.findDirectExpressions(Expressions.FieldSub),
48
+ ...node.findDirectExpressions(Expressions.Field),
49
+ ];
50
+ for (const field of fields) {
51
+ const token = field.getFirstToken();
52
+ if (input.scope.findVariable(token.getStr()) !== undefined) {
53
+ source_field_1.SourceField.runSyntax(field, input, _reference_1.ReferenceType.DataReadReference, false);
54
+ }
55
+ }
56
+ }
57
+ }
58
+ exports.AtSelectionScreen = AtSelectionScreen;
59
+ //# sourceMappingURL=at_selection_screen.js.map
@@ -38,14 +38,19 @@ const Expressions = __importStar(require("../../2_statements/expressions"));
38
38
  const _typed_identifier_1 = require("../../types/_typed_identifier");
39
39
  const basic_types_1 = require("../basic_types");
40
40
  const unknown_type_1 = require("../../types/basic/unknown_type");
41
+ const _syntax_input_1 = require("../_syntax_input");
41
42
  const basic_1 = require("../../types/basic");
42
43
  class FieldSymbol {
43
44
  runSyntax(node, input) {
44
- var _a;
45
- const fsname = (_a = node.findFirstExpression(Expressions.FieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
46
- if (fsname === undefined) {
45
+ const fs = node.findFirstExpression(Expressions.FieldSymbol);
46
+ const fsname = fs === null || fs === void 0 ? void 0 : fs.getFirstToken();
47
+ if (fs === undefined || fsname === undefined) {
47
48
  return;
48
49
  }
50
+ if (fs.concatTokens().length > 30) {
51
+ const message = "FIELD-SYMBOLS name too long, " + fs.concatTokens();
52
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, fsname, message));
53
+ }
49
54
  if (node.getChildren().length === 5) {
50
55
  // no type specified
51
56
  input.scope.addIdentifier(new _typed_identifier_1.TypedIdentifier(fsname, input.filename, basic_1.VoidType.get("FS-SIMPLE")));
@@ -90,6 +90,7 @@ const if_1 = require("./statements/if");
90
90
  const else_if_1 = require("./statements/else_if");
91
91
  const append_1 = require("./statements/append");
92
92
  const selection_screen_1 = require("./statements/selection_screen");
93
+ const at_selection_screen_1 = require("./statements/at_selection_screen");
93
94
  const ranges_1 = require("./statements/ranges");
94
95
  const write_1 = require("./statements/write");
95
96
  const case_1 = require("./statements/case");
@@ -297,6 +298,7 @@ if (Object.keys(map).length === 0) {
297
298
  addToMap(new authority_check_1.AuthorityCheck());
298
299
  addToMap(new insert_report_1.InsertReport());
299
300
  addToMap(new selection_screen_1.SelectionScreen());
301
+ addToMap(new at_selection_screen_1.AtSelectionScreen());
300
302
  addToMap(new ranges_1.Ranges());
301
303
  addToMap(new add_1.Add());
302
304
  addToMap(new raise_event_1.RaiseEvent());
@@ -95,6 +95,7 @@ class ClassDefinition extends _identifier_1.Identifier {
95
95
  this.createVisibilityValue = visibility_1.Visibility.Public;
96
96
  }
97
97
  // perform checks after everything has been initialized
98
+ this.checkInterfaceVisibility(input, node);
98
99
  this.checkMethodsFromSuperClasses(input);
99
100
  this.checkMethodNameLength(input);
100
101
  this.checkClassConstructorStatic(input);
@@ -168,6 +169,17 @@ class ClassDefinition extends _identifier_1.Identifier {
168
169
  }
169
170
  }
170
171
  }
172
+ checkInterfaceVisibility(input, node) {
173
+ const sections = [
174
+ node.findDirectStructure(Structures.ProtectedSection),
175
+ node.findDirectStructure(Structures.PrivateSection),
176
+ ];
177
+ for (const section of sections) {
178
+ for (const statement of (section === null || section === void 0 ? void 0 : section.findAllStatements(Statements.InterfaceDef)) || []) {
179
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, statement.getFirstToken(), "INTERFACES can only be declared in public sections"));
180
+ }
181
+ }
182
+ }
171
183
  checkMethodsFromSuperClasses(input) {
172
184
  var _a;
173
185
  const scope = input.scope;
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.120.5";
78
+ return "2.120.6";
79
79
  }
80
80
  getDDICReferences() {
81
81
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.120.5",
3
+ "version": "2.120.6",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",