@abaplint/core 2.119.62 → 2.119.64

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.
@@ -2081,6 +2081,7 @@ declare class Dynamic extends Expression {
2081
2081
  declare type DynproField = {
2082
2082
  name: string;
2083
2083
  type: string;
2084
+ contType: string;
2084
2085
  length: number;
2085
2086
  vislength: number;
2086
2087
  line: number;
@@ -9,7 +9,7 @@ class TypeMesh {
9
9
  const on = (0, combi_1.seq)("ON", expressions_1.NamespaceSimpleName, "=", expressions_1.NamespaceSimpleName, (0, combi_1.star)((0, combi_1.seq)("AND", expressions_1.NamespaceSimpleName, "=", expressions_1.NamespaceSimpleName)));
10
10
  const using = (0, combi_1.seq)("USING KEY", expressions_1.NamespaceSimpleName);
11
11
  const association = (0, combi_1.seq)("ASSOCIATION", expressions_1.NamespaceSimpleName, "TO", expressions_1.NamespaceSimpleName, (0, combi_1.plus)(on));
12
- const ret = (0, combi_1.ver)(version_1.Release.v751, (0, combi_1.seq)("TYPES", expressions_1.NamespaceSimpleName, "TYPE", (0, combi_1.opt)("REF TO"), expressions_1.TypeName, (0, combi_1.plus)(association), (0, combi_1.opt)(using)));
12
+ const ret = (0, combi_1.ver)(version_1.Release.v740sp05, (0, combi_1.seq)("TYPES", expressions_1.NamespaceSimpleName, "TYPE", (0, combi_1.opt)("REF TO"), expressions_1.TypeName, (0, combi_1.plus)(association), (0, combi_1.opt)(using)));
13
13
  return ret;
14
14
  }
15
15
  }
@@ -336,6 +336,9 @@ class Source {
336
336
  if (context instanceof basic_1.FloatType && found instanceof basic_1.IntegerType) {
337
337
  return context;
338
338
  }
339
+ else if (context instanceof basic_1.IntegerType && found instanceof basic_1.HexType) {
340
+ return context;
341
+ }
339
342
  else if ((context instanceof basic_1.IntegerType || context instanceof basic_1.FloatType) && (found === null || found === void 0 ? void 0 : found.isGeneric())) {
340
343
  return context;
341
344
  }
@@ -19,6 +19,7 @@ function parseDynpros(parsed) {
19
19
  fields.push({
20
20
  name: f.NAME,
21
21
  type: f.TYPE,
22
+ contType: f.CONT_TYPE,
22
23
  length: parseNumber(f.LENGTH),
23
24
  vislength: parseNumber(f.VISLENGTH),
24
25
  line: parseNumber(f.LINE),
@@ -155,9 +155,8 @@ class DataDefinition extends _abstract_object_1.AbstractObject {
155
155
  }
156
156
  if (found === undefined) {
157
157
  // typed virtual element: VIRTUAL <name> : <type>
158
- const names = e.findAllExpressions(expressions_1.CDSName);
159
- if (e.findDirectTokenByText("VIRTUAL") !== undefined && names.length > 0) {
160
- found = names[0];
158
+ if (e.findDirectTokenByText("VIRTUAL") !== undefined) {
159
+ found = e.findFirstExpression(expressions_1.CDSName);
161
160
  }
162
161
  }
163
162
  if (found === undefined) {
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.119.62";
78
+ return "2.119.64";
79
79
  }
80
80
  getDDICReferences() {
81
81
  return this.ddicReferences;
@@ -92,17 +92,22 @@ class BeginEndNames extends _abap_rule_1.ABAPRule {
92
92
  test(stru, type, b, e, file) {
93
93
  const output = [];
94
94
  for (const sub of stru.findAllStructuresRecursive(type)) {
95
- let begin = sub.findDirectStatements(b)[0].findFirstExpression(Expressions.NamespaceSimpleName);
95
+ const beginStatement = sub.findDirectStatement(b);
96
+ const endStatement = sub.findDirectStatement(e);
97
+ if (beginStatement === undefined || endStatement === undefined) {
98
+ continue;
99
+ }
100
+ let begin = beginStatement.findFirstExpression(Expressions.NamespaceSimpleName);
96
101
  if (begin === undefined) {
97
- begin = sub.findDirectStatements(b)[0].findFirstExpression(Expressions.DefinitionName);
102
+ begin = beginStatement.findFirstExpression(Expressions.DefinitionName);
98
103
  }
99
104
  if (begin === undefined) {
100
105
  continue;
101
106
  }
102
107
  const first = begin.getFirstToken();
103
- let end = sub.findDirectStatements(e)[0].findFirstExpression(Expressions.NamespaceSimpleName);
108
+ let end = endStatement.findFirstExpression(Expressions.NamespaceSimpleName);
104
109
  if (end === undefined) {
105
- end = sub.findDirectStatements(e)[0].findFirstExpression(Expressions.DefinitionName);
110
+ end = endStatement.findFirstExpression(Expressions.DefinitionName);
106
111
  }
107
112
  if (end === undefined) {
108
113
  continue;
@@ -2984,7 +2984,7 @@ ${indentation} output = ${uniqueName}.\n`;
2984
2984
  }
2985
2985
  }
2986
2986
  }
2987
- if (fix === undefined && high.findAllExpressions(Expressions.NewObject)) {
2987
+ if (fix === undefined) {
2988
2988
  const found = high.findFirstExpression(Expressions.NewObject);
2989
2989
  if (found === undefined) {
2990
2990
  return undefined;
@@ -55,12 +55,13 @@ class DynproChecks {
55
55
  const ret = [];
56
56
  for (let index = 0; index < dynpro.fields.length; index++) {
57
57
  const current = dynpro.fields[index];
58
- if (current.name === undefined || current.type === "FRAME") {
58
+ if (current.name === undefined || current.type === "FRAME" || this.hasContainerRelativeCoordinates(current)) {
59
59
  continue;
60
60
  }
61
61
  for (let compare = index + 1; compare < dynpro.fields.length; compare++) {
62
62
  const other = dynpro.fields[compare];
63
- if (other.name === undefined || other.type === "FRAME" || this.overlaps(current, other) === false) {
63
+ if (other.name === undefined || other.type === "FRAME" || this.hasContainerRelativeCoordinates(other)
64
+ || this.overlaps(current, other) === false) {
64
65
  continue;
65
66
  }
66
67
  const message = `Screen ${dynpro.number}, ${current.type} ${current.name} and ${other.type} ${other.name} are overlapping`;
@@ -69,6 +70,9 @@ class DynproChecks {
69
70
  }
70
71
  return ret;
71
72
  }
73
+ hasContainerRelativeCoordinates(field) {
74
+ return field.contType === "TABLE_CTRL" || field.contType === "LOOP" || field.contType === "STRIP_CTRL";
75
+ }
72
76
  overlaps(first, second) {
73
77
  if (first.line === 0 || second.line === 0 || first.column === 0 || second.column === 0) {
74
78
  return false;
@@ -394,11 +394,11 @@ ENDIF.`,
394
394
  }
395
395
  }
396
396
  else {
397
- const classNameExpression = staNode.findAllExpressions(Expressions.ClassName);
398
- const methodNameExpression = staNode.findAllExpressions(Expressions.MethodName);
399
- if (classNameExpression.length !== 0 && methodNameExpression.length !== 0) {
400
- const className = classNameExpression[0].concatTokens();
401
- const methodName = methodNameExpression[0].concatTokens();
397
+ const classNameExpression = staNode.findFirstExpression(Expressions.ClassName);
398
+ const methodNameExpression = staNode.findFirstExpression(Expressions.MethodName);
399
+ if (classNameExpression && methodNameExpression) {
400
+ const className = classNameExpression.concatTokens();
401
+ const methodName = methodNameExpression.concatTokens();
402
402
  if (className === "cl_abap_regex") {
403
403
  if (methodName === "create_posix") {
404
404
  const issue = issue_1.Issue.atStatement(file, staNode, "create_posix obsolete, use create_pcre", this.getMetadata().key, this.conf.severity);
@@ -87,12 +87,12 @@ class ShortCase extends _abap_rule_1.ABAPRule {
87
87
  return [];
88
88
  }
89
89
  for (const c of struc.findAllStructures(Structures.Case)) {
90
- const clist = c.findDirectStatements(Statements.Case);
91
- if (clist.length > 0 && this.conf.allow && this.conf.allow.find((e) => { return e === clist[0].getTokens()[1].getStr(); })) {
90
+ const caseStatement = c.findDirectStatement(Statements.Case);
91
+ if (caseStatement && this.conf.allow && this.conf.allow.find((e) => { return e === caseStatement.getTokens()[1].getStr(); })) {
92
92
  continue;
93
93
  }
94
94
  if (c.findDirectStructures(Structures.When).length <= this.conf.length) {
95
- if (c.findAllExpressions(Expressions.Or).length > 0) {
95
+ if (c.findFirstExpression(Expressions.Or)) {
96
96
  continue;
97
97
  }
98
98
  const issue = issue_1.Issue.atToken(file, c.getFirstToken(), this.getMessage(), this.getMetadata().key, this.conf.severity);
@@ -40,9 +40,9 @@ class TryWithoutCatch extends _abap_rule_1.ABAPRule {
40
40
  }
41
41
  const tries = stru.findAllStructures(structures_1.Try);
42
42
  for (const t of tries) {
43
- const clean = t.findDirectStructures(structures_1.Cleanup);
44
- const c = t.findDirectStructures(structures_1.Catch);
45
- if (c.length === 0 && clean.length === 0) {
43
+ const clean = t.findDirectStructure(structures_1.Cleanup);
44
+ const c = t.findDirectStructure(structures_1.Catch);
45
+ if (c === undefined && clean === undefined) {
46
46
  const issue = issue_1.Issue.atToken(file, t.getFirstToken(), this.getMessage(), this.getMetadata().key, this.conf.severity);
47
47
  issues.push(issue);
48
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.119.62",
3
+ "version": "2.119.64",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",