@abaplint/cli 2.112.0 → 2.112.2

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 +28 -20
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -23938,7 +23938,7 @@ class AttributeChain {
23938
23938
  }
23939
23939
  if (context === undefined) {
23940
23940
  const message = "Attribute or constant \"" + name + "\" not found in \"" + def.getName() + "\"";
23941
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
23941
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, nameToken, message));
23942
23942
  return new void_type_1.VoidType(_syntax_input_1.CheckSyntaxKey);
23943
23943
  }
23944
23944
  for (const t of type) {
@@ -24104,7 +24104,7 @@ class Cast {
24104
24104
  else if (tt === undefined) {
24105
24105
  // todo, this should be an UnknownType instead?
24106
24106
  const message = "Type \"" + typeName + "\" not found in scope, Cast";
24107
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
24107
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, typeExpression.getFirstToken(), message));
24108
24108
  return new basic_1.VoidType(_syntax_input_1.CheckSyntaxKey);
24109
24109
  }
24110
24110
  }
@@ -24191,21 +24191,21 @@ class ComponentChain {
24191
24191
  if (concat === "-") {
24192
24192
  if (!(context instanceof structure_type_1.StructureType)) {
24193
24193
  const message = "ComponentChain, not a structure";
24194
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
24194
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, child.getFirstToken(), message));
24195
24195
  return new void_type_1.VoidType(_syntax_input_1.CheckSyntaxKey);
24196
24196
  }
24197
24197
  }
24198
24198
  else if (concat === "=>") {
24199
24199
  if (!(context instanceof basic_1.ObjectReferenceType)) {
24200
24200
  const message = "ComponentChain, not a reference";
24201
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
24201
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, child.getFirstToken(), message));
24202
24202
  return new void_type_1.VoidType(_syntax_input_1.CheckSyntaxKey);
24203
24203
  }
24204
24204
  }
24205
24205
  else if (concat === "->") {
24206
24206
  if (!(context instanceof basic_1.ObjectReferenceType) && !(context instanceof basic_1.DataReference)) {
24207
24207
  const message = "ComponentChain, not a reference";
24208
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
24208
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, child.getFirstToken(), message));
24209
24209
  return new void_type_1.VoidType(_syntax_input_1.CheckSyntaxKey);
24210
24210
  }
24211
24211
  }
@@ -24222,7 +24222,7 @@ class ComponentChain {
24222
24222
  context = context.getComponentByName(name);
24223
24223
  if (context === undefined) {
24224
24224
  const message = "Component \"" + name + "\" not found in structure";
24225
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
24225
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, child.getFirstToken(), message));
24226
24226
  return new void_type_1.VoidType(_syntax_input_1.CheckSyntaxKey);
24227
24227
  }
24228
24228
  }
@@ -24231,7 +24231,7 @@ class ComponentChain {
24231
24231
  const def = input.scope.findObjectDefinition(id.getName());
24232
24232
  if (def === undefined) {
24233
24233
  const message = id.getName() + " not found in scope";
24234
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
24234
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, child.getFirstToken(), message));
24235
24235
  return new void_type_1.VoidType(_syntax_input_1.CheckSyntaxKey);
24236
24236
  }
24237
24237
  const helper = new _object_oriented_1.ObjectOriented(input.scope);
@@ -24239,7 +24239,7 @@ class ComponentChain {
24239
24239
  context = found === null || found === void 0 ? void 0 : found.getType();
24240
24240
  if (context === undefined) {
24241
24241
  const message = "Attribute \"" + name + "\" not found";
24242
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
24242
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, child.getFirstToken(), message));
24243
24243
  return new void_type_1.VoidType(_syntax_input_1.CheckSyntaxKey);
24244
24244
  }
24245
24245
  else {
@@ -24252,7 +24252,7 @@ class ComponentChain {
24252
24252
  }
24253
24253
  else {
24254
24254
  const message = "ComponentChain, not a structure, " + (context === null || context === void 0 ? void 0 : context.constructor.name);
24255
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
24255
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, child.getFirstToken(), message));
24256
24256
  return new void_type_1.VoidType(_syntax_input_1.CheckSyntaxKey);
24257
24257
  }
24258
24258
  }
@@ -25733,7 +25733,7 @@ class MethodCallChain {
25733
25733
  else {
25734
25734
  if (previous && previous.getFirstToken().getStr() === "=>" && (method === null || method === void 0 ? void 0 : method.isStatic()) === false) {
25735
25735
  const message = "Method \"" + methodName + "\" not static";
25736
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
25736
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, methodToken, message));
25737
25737
  return new basic_1.VoidType(_syntax_input_1.CheckSyntaxKey);
25738
25738
  }
25739
25739
  const extra = {
@@ -25754,7 +25754,7 @@ class MethodCallChain {
25754
25754
  }
25755
25755
  else if (method === undefined && !(context instanceof basic_1.VoidType)) {
25756
25756
  const message = "Method \"" + methodName + "\" not found, methodCallChain";
25757
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
25757
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, methodToken, message));
25758
25758
  return new basic_1.VoidType(_syntax_input_1.CheckSyntaxKey);
25759
25759
  }
25760
25760
  else if (method) {
@@ -34014,7 +34014,7 @@ class Data {
34014
34014
  }
34015
34015
  if (!(found instanceof Basic.StructureType)) {
34016
34016
  const message = "not structured, " + typeName;
34017
- input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message));
34017
+ input.issues.push((0, _syntax_input_1.syntaxIssue)(input, typeToken, message));
34018
34018
  return new _typed_identifier_1.TypedIdentifier(name, input.filename, new Basic.VoidType(_syntax_input_1.CheckSyntaxKey));
34019
34019
  }
34020
34020
  for (const c of found.getComponents()) {
@@ -38838,6 +38838,7 @@ class InterfaceDefinition extends _identifier_1.Identifier {
38838
38838
  this.typeDefinitions = this.attributes.getTypes();
38839
38839
  this.aliases = new aliases_1.Aliases(node, this.filename, input.scope);
38840
38840
  // todo, cleanup aliases, vs "object_oriented.ts" vs "class_implementation.ts"
38841
+ // this adds the aliased types to scope?
38841
38842
  for (const a of this.aliases.getAll()) {
38842
38843
  const [objName, fieldName] = a.getComponent().split("~");
38843
38844
  const idef = input.scope.findInterfaceDefinition(objName);
@@ -38857,10 +38858,6 @@ class InterfaceDefinition extends _identifier_1.Identifier {
38857
38858
  }
38858
38859
  }
38859
38860
  }
38860
- this.methodDefinitions = new method_definitions_1.MethodDefinitions(node, input);
38861
- if (this.methodDefinitions.getByName("CONSTRUCTOR") !== undefined) {
38862
- throw new Error("Interfaces cannot have constructor methods");
38863
- }
38864
38861
  const events = node.findAllStatements(Statements.Events);
38865
38862
  for (const e of events) {
38866
38863
  this.events.push(new event_definition_1.EventDefinition(e, visibility_1.Visibility.Public, input));
@@ -38882,6 +38879,10 @@ class InterfaceDefinition extends _identifier_1.Identifier {
38882
38879
  }
38883
38880
  }
38884
38881
  }
38882
+ this.methodDefinitions = new method_definitions_1.MethodDefinitions(node, input);
38883
+ if (this.methodDefinitions.getByName("CONSTRUCTOR") !== undefined) {
38884
+ throw new Error("Interfaces cannot have constructor methods");
38885
+ }
38885
38886
  }
38886
38887
  }
38887
38888
  exports.InterfaceDefinition = InterfaceDefinition;
@@ -40732,6 +40733,10 @@ class Config {
40732
40733
  if (this.config.syntax.globalConstants === undefined) {
40733
40734
  this.config.syntax.globalConstants = [];
40734
40735
  }
40736
+ else {
40737
+ // remove duplicates,
40738
+ this.config.syntax.globalConstants = [...new Set(this.config.syntax.globalConstants)];
40739
+ }
40735
40740
  if (this.config.global.skipIncludesWithoutMain === undefined) {
40736
40741
  this.config.global.skipIncludesWithoutMain = false;
40737
40742
  }
@@ -52399,7 +52404,7 @@ class Registry {
52399
52404
  }
52400
52405
  static abaplintVersion() {
52401
52406
  // magic, see build script "version.sh"
52402
- return "2.112.0";
52407
+ return "2.112.2";
52403
52408
  }
52404
52409
  getDDICReferences() {
52405
52410
  return this.ddicReferences;
@@ -57179,6 +57184,8 @@ class DoubleSpaceConf extends _basic_rule_config_1.BasicRuleConfig {
57179
57184
  super(...arguments);
57180
57185
  /** Check for double space after keywords */
57181
57186
  this.keywords = true;
57187
+ /** list of keywords to skip, case insensitive */
57188
+ this.skipKeywords = ["CHANGING", "EXPORTING", "OTHERS"];
57182
57189
  /** Check for double space after start parenthesis */
57183
57190
  this.startParen = true;
57184
57191
  /** Check for double space before end parenthesis */
@@ -57211,6 +57218,9 @@ class DoubleSpace extends _abap_rule_1.ABAPRule {
57211
57218
  }
57212
57219
  setConfig(conf) {
57213
57220
  this.conf = conf;
57221
+ if (this.conf.skipKeywords === undefined) {
57222
+ this.conf.skipKeywords = new DoubleSpaceConf().skipKeywords;
57223
+ }
57214
57224
  }
57215
57225
  runParsed(file) {
57216
57226
  let issues = [];
@@ -57322,9 +57332,7 @@ class DoubleSpace extends _abap_rule_1.ABAPRule {
57322
57332
  if (prev instanceof nodes_1.TokenNodeRegex
57323
57333
  || upper === "("
57324
57334
  || upper === ")"
57325
- || upper === "CHANGING"
57326
- || upper === "EXPORTING"
57327
- || upper === "OTHERS") {
57335
+ || this.getConfig().skipKeywords.some(e => e.toUpperCase() === upper)) {
57328
57336
  // not a keyword, continue
57329
57337
  prev = n;
57330
57338
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.112.0",
3
+ "version": "2.112.2",
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.112.0",
41
+ "@abaplint/core": "^2.112.2",
42
42
  "@types/chai": "^4.3.16",
43
43
  "@types/glob": "^8.1.0",
44
44
  "@types/minimist": "^1.2.5",