@abaplint/core 2.84.3 → 2.84.7

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.
@@ -3187,13 +3187,15 @@ declare interface IRenameParams {
3187
3187
  }
3188
3188
 
3189
3189
  export declare interface IRenameSettings {
3190
- /** output folder */
3191
- output: string;
3190
+ /** output folder, if value is empty or undefined the changes are written inline in the input folders */
3191
+ output?: string;
3192
3192
  /** list of regex, matches filenames to be skipped, case insensitive
3193
3193
  * @uniqueItems true
3194
3194
  */
3195
3195
  skip?: string[];
3196
- /** List of rename patterns */
3196
+ /** List of rename patterns
3197
+ * @uniqueItems true
3198
+ */
3197
3199
  patterns: {
3198
3200
  /** Object type, example "CLAS", regex, case insensitive */
3199
3201
  type: string;
@@ -5433,7 +5435,7 @@ export { Structures }
5433
5435
  declare class StructureType extends AbstractType {
5434
5436
  private readonly indexed;
5435
5437
  private readonly components;
5436
- constructor(components: IStructureComponent[], name?: string);
5438
+ constructor(components: IStructureComponent[], qualifiedName?: string);
5437
5439
  getComponents(): IStructureComponent[];
5438
5440
  getComponentByName(name: string): AbstractType | undefined;
5439
5441
  toText(level: number): string;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CallTransformationParameters = void 0;
4
+ const _1 = require(".");
4
5
  const combi_1 = require("../combi");
5
6
  const dynamic_1 = require("./dynamic");
6
7
  const field_1 = require("./field");
7
8
  const integer_1 = require("./integer");
8
- const source_1 = require("./source");
9
9
  class CallTransformationParameters extends combi_1.Expression {
10
10
  getRunnable() {
11
- const field = (0, combi_1.seq)((0, combi_1.alt)(field_1.Field, integer_1.Integer), "=", source_1.Source);
11
+ const field = (0, combi_1.seq)((0, combi_1.alt)(field_1.Field, integer_1.Integer), "=", _1.SimpleSource3);
12
12
  return (0, combi_1.alt)((0, combi_1.plus)(field), dynamic_1.Dynamic);
13
13
  }
14
14
  }
@@ -8,7 +8,7 @@ class CallTransformation {
8
8
  const options = (0, combi_1.seq)("OPTIONS", expressions_1.CallTransformationOptions);
9
9
  const parameters = (0, combi_1.seq)("PARAMETERS", expressions_1.CallTransformationParameters);
10
10
  const objects = (0, combi_1.seq)("OBJECTS", expressions_1.CallTransformationParameters);
11
- const source2 = (0, combi_1.seq)("XML", expressions_1.Source);
11
+ const source2 = (0, combi_1.seq)("XML", expressions_1.SimpleSource3);
12
12
  const source = (0, combi_1.seq)("SOURCE", (0, combi_1.alt)(expressions_1.CallTransformationParameters, source2));
13
13
  const result2 = (0, combi_1.seq)("XML", expressions_1.Target);
14
14
  const result = (0, combi_1.seq)("RESULT", (0, combi_1.alt)(expressions_1.CallTransformationParameters, result2));
@@ -9,7 +9,7 @@ const inline_data_1 = require("../expressions/inline_data");
9
9
  const dynamic_1 = require("../expressions/dynamic");
10
10
  class CallTransformation {
11
11
  runSyntax(node, scope, filename) {
12
- for (const s of node.findAllExpressions(Expressions.Source)) {
12
+ for (const s of node.findAllExpressions(Expressions.SimpleSource3)) {
13
13
  new source_1.Source().runSyntax(s, scope, filename);
14
14
  }
15
15
  for (const d of node.findAllExpressions(Expressions.Dynamic)) {
@@ -8,9 +8,10 @@ const nodes_1 = require("../../nodes");
8
8
  const _typed_identifier_1 = require("../../types/_typed_identifier");
9
9
  const Basic = require("../../types/basic");
10
10
  const data_1 = require("../statements/data");
11
+ const _reference_1 = require("../_reference");
11
12
  class Data {
12
13
  runSyntax(node, scope, filename) {
13
- var _a, _b;
14
+ var _a;
14
15
  const name = node.findFirstExpression(Expressions.DefinitionName).getFirstToken();
15
16
  let table = false;
16
17
  const components = [];
@@ -35,8 +36,10 @@ class Data {
35
36
  }
36
37
  else if (c instanceof nodes_1.StatementNode && ctyp instanceof Statements.IncludeType) {
37
38
  // INCLUDES
38
- const typeName = (_a = c.findFirstExpression(Expressions.TypeName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStr();
39
- let found = (_b = scope.findType(typeName)) === null || _b === void 0 ? void 0 : _b.getType();
39
+ const typeToken = (_a = c.findFirstExpression(Expressions.TypeName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
40
+ const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();
41
+ const foundId = scope.findType(typeName);
42
+ let found = foundId === null || foundId === void 0 ? void 0 : foundId.getType();
40
43
  if (found === undefined) {
41
44
  const f = scope.getDDIC().lookupTableOrView(typeName).type;
42
45
  if (f instanceof _typed_identifier_1.TypedIdentifier) {
@@ -46,6 +49,9 @@ class Data {
46
49
  found = f;
47
50
  }
48
51
  }
52
+ else {
53
+ scope.addReference(typeToken, foundId, _reference_1.ReferenceType.TypeReference, filename);
54
+ }
49
55
  if (found instanceof Basic.VoidType) {
50
56
  if (table === true) {
51
57
  return new _typed_identifier_1.TypedIdentifier(name, filename, new Basic.TableType(found, { withHeader: true }));
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StructureType = void 0;
4
4
  const _abstract_type_1 = require("./_abstract_type");
5
5
  class StructureType extends _abstract_type_1.AbstractType {
6
- constructor(components, name) {
7
- super(name);
6
+ constructor(components, qualifiedName) {
7
+ super(qualifiedName);
8
8
  if (components.length === 0) {
9
9
  throw new Error("Structure does not contain any components");
10
10
  }
@@ -12,7 +12,7 @@ class StructureType extends _abstract_type_1.AbstractType {
12
12
  for (const c of components) {
13
13
  const upper = c.name.toUpperCase();
14
14
  if (this.indexed[upper] !== undefined) {
15
- throw new Error("Structure, duplicate field name \"" + upper + "\", " + name);
15
+ throw new Error("Structure, duplicate field name \"" + upper + "\", " + qualifiedName);
16
16
  }
17
17
  this.indexed[upper] = c.type;
18
18
  }
@@ -68,7 +68,7 @@ class Registry {
68
68
  }
69
69
  static abaplintVersion() {
70
70
  // magic, see build script "version.sh"
71
- return "2.84.3";
71
+ return "2.84.7";
72
72
  }
73
73
  getDDICReferences() {
74
74
  return this.references;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.84.3",
3
+ "version": "2.84.7",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -47,15 +47,15 @@
47
47
  "devDependencies": {
48
48
  "@microsoft/api-extractor": "^7.19.4",
49
49
  "@types/chai": "^4.3.0",
50
- "@types/mocha": "^9.0.0",
51
- "@types/node": "^17.0.10",
52
- "chai": "^4.3.4",
50
+ "@types/mocha": "^9.1.0",
51
+ "@types/node": "^17.0.12",
52
+ "chai": "^4.3.5",
53
53
  "eslint": "^8.7.0",
54
- "mocha": "^9.1.4",
54
+ "mocha": "^9.2.0",
55
55
  "c8": "^7.11.0",
56
56
  "source-map-support": "^0.5.21",
57
57
  "ts-json-schema-generator": "^0.97.0",
58
- "typescript": "^4.5.4"
58
+ "typescript": "^4.5.5"
59
59
  },
60
60
  "dependencies": {
61
61
  "fast-xml-parser": "^4.0.1",