@abaplint/core 2.120.9 → 2.120.10

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.
@@ -534,6 +534,7 @@ declare namespace BasicTypes {
534
534
  NumericType,
535
535
  ObjectReferenceType,
536
536
  PackedType,
537
+ PGenericType,
537
538
  SimpleType,
538
539
  StringType,
539
540
  IStructureComponent,
@@ -5676,6 +5677,17 @@ declare class PersonalizationObject extends AbstractObject {
5676
5677
  getDescription(): string | undefined;
5677
5678
  }
5678
5679
 
5680
+ declare class PGenericType extends AbstractType {
5681
+ private static readonly singleton;
5682
+ static get(): PGenericType;
5683
+ private constructor();
5684
+ toText(): string;
5685
+ isGeneric(): boolean;
5686
+ toABAP(): string;
5687
+ containsVoid(): boolean;
5688
+ toCDS(): string;
5689
+ }
5690
+
5679
5691
  declare class Plus extends Token {
5680
5692
  static railroad(): string;
5681
5693
  }
@@ -6,7 +6,7 @@ const version_1 = require("../../../version");
6
6
  class RollbackEntities {
7
7
  getMatcher() {
8
8
  const s = "ROLLBACK ENTITIES";
9
- return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.ver)(version_1.Release.v754, s));
9
+ return (0, combi_1.verNotLang)(version_1.LanguageVersion.KeyUser, (0, combi_1.ver)(version_1.Release.v754, s, { also: combi_1.AlsoIn.OpenABAP }));
10
10
  }
11
11
  }
12
12
  exports.RollbackEntities = RollbackEntities;
@@ -234,7 +234,8 @@ class ABAPFileInformationParser {
234
234
  return ret;
235
235
  }
236
236
  parseConstants(node, visibility) {
237
- var _a, _b;
237
+ var _a;
238
+ var _b;
238
239
  if (node === undefined) {
239
240
  return [];
240
241
  }
@@ -115,6 +115,7 @@ class TypeUtils {
115
115
  || type instanceof basic_1.DataType
116
116
  || type instanceof basic_1.CLikeType
117
117
  || type instanceof basic_1.PackedType
118
+ || type instanceof basic_1.PGenericType
118
119
  || type instanceof basic_1.TimeType
119
120
  || type instanceof enum_type_1.EnumType) {
120
121
  return true;
@@ -330,6 +331,14 @@ class TypeUtils {
330
331
  if (calculated) {
331
332
  return this.isAssignable(source, target);
332
333
  }
334
+ if (target instanceof basic_1.PGenericType) {
335
+ return source instanceof basic_1.PackedType
336
+ || source instanceof basic_1.PGenericType
337
+ || source instanceof basic_1.VoidType
338
+ || source instanceof basic_1.AnyType
339
+ || source instanceof basic_1.DataType
340
+ || source instanceof basic_1.UnknownType;
341
+ }
333
342
  if (source instanceof basic_1.CharacterType) {
334
343
  if (target instanceof basic_1.CharacterType) {
335
344
  if (((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {
@@ -444,6 +453,10 @@ class TypeUtils {
444
453
  return false;
445
454
  }
446
455
  }
456
+ else if (source instanceof basic_1.PackedType && target instanceof basic_1.PackedType) {
457
+ return source.getLength() === target.getLength()
458
+ && source.getDecimals() === target.getDecimals();
459
+ }
447
460
  else if (source instanceof basic_1.FloatType) {
448
461
  if (target instanceof basic_1.IntegerType) {
449
462
  return false;
@@ -67,6 +67,9 @@ class MethodParam {
67
67
  else if (concat === "TYPE X" || concat.startsWith("TYPE X ")) {
68
68
  return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), input.filename, basic_1.XGenericType.get(), meta);
69
69
  }
70
+ else if (concat === "TYPE P" || concat.startsWith("TYPE P ")) {
71
+ return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), input.filename, basic_1.PGenericType.get(), meta);
72
+ }
70
73
  const found = new basic_types_1.BasicTypes(input).parseType(type);
71
74
  if (found) {
72
75
  return new _typed_identifier_1.TypedIdentifier(name.getFirstToken(), input.filename, found, meta);
@@ -41,6 +41,7 @@ const inline_data_1 = require("../expressions/inline_data");
41
41
  const _type_utils_1 = require("../_type_utils");
42
42
  const _syntax_input_1 = require("../_syntax_input");
43
43
  const dereference_1 = require("../expressions/dereference");
44
+ const basic_1 = require("../../types/basic");
44
45
  class Move {
45
46
  runSyntax(node, input) {
46
47
  const targets = node.findDirectExpressions(Expressions.Target);
@@ -76,6 +77,9 @@ class Move {
76
77
  sourceType = dereference_1.Dereference.runSyntax(node, sourceType, input);
77
78
  }
78
79
  if (inline) {
80
+ if (sourceType instanceof basic_1.PackedType && (source === null || source === void 0 ? void 0 : source.findDirectExpression(Expressions.ArithOperator))) {
81
+ sourceType = new basic_1.PackedType(8, 0);
82
+ }
79
83
  inline_data_1.InlineData.runSyntax(inline, input, sourceType);
80
84
  targetType = sourceType;
81
85
  }
@@ -36,6 +36,7 @@ __exportStar(require("./numeric_generic_type"), exports);
36
36
  __exportStar(require("./numeric_type"), exports);
37
37
  __exportStar(require("./object_reference_type"), exports);
38
38
  __exportStar(require("./packed_type"), exports);
39
+ __exportStar(require("./pgeneric_type"), exports);
39
40
  __exportStar(require("./simple_type"), exports);
40
41
  __exportStar(require("./string_type"), exports);
41
42
  __exportStar(require("./structure_type"), exports);
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PGenericType = void 0;
4
+ const _abstract_type_1 = require("./_abstract_type");
5
+ class PGenericType extends _abstract_type_1.AbstractType {
6
+ static get() {
7
+ return this.singleton;
8
+ }
9
+ constructor() {
10
+ super();
11
+ }
12
+ toText() {
13
+ return "```p```";
14
+ }
15
+ isGeneric() {
16
+ return true;
17
+ }
18
+ toABAP() {
19
+ throw new Error("p, generic");
20
+ }
21
+ containsVoid() {
22
+ return false;
23
+ }
24
+ toCDS() {
25
+ return "abap.TODO_PGENERIC";
26
+ }
27
+ }
28
+ exports.PGenericType = PGenericType;
29
+ PGenericType.singleton = new PGenericType();
30
+ //# sourceMappingURL=pgeneric_type.js.map
@@ -98,7 +98,8 @@ class ABAPObject extends _abstract_object_1.AbstractObject {
98
98
  return this.textsTranslations;
99
99
  }
100
100
  findTexts(parsed) {
101
- var _a, _b, _c, _d, _e, _f, _g;
101
+ var _a, _b, _c, _d, _e, _f;
102
+ var _g;
102
103
  this.texts = {};
103
104
  if (((_d = (_c = (_b = (_a = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.TPOOL) === null || _d === void 0 ? void 0 : _d.item) === undefined) {
104
105
  return;
@@ -111,7 +112,7 @@ class ABAPObject extends _abstract_object_1.AbstractObject {
111
112
  if (id !== "R" && t.KEY === undefined) {
112
113
  continue;
113
114
  }
114
- const key = (_g = ((_f = t.KEY) !== null && _f !== void 0 ? _f : t.ID)) === null || _g === void 0 ? void 0 : _g.toUpperCase();
115
+ const key = (_f = ((_g = t.KEY) !== null && _g !== void 0 ? _g : t.ID)) === null || _f === void 0 ? void 0 : _f.toUpperCase();
115
116
  if (key === undefined) {
116
117
  continue;
117
118
  }
@@ -122,7 +123,8 @@ class ABAPObject extends _abstract_object_1.AbstractObject {
122
123
  }
123
124
  }
124
125
  findTextsTranslations(parsed) {
125
- var _a, _b, _c, _d, _e, _f, _g;
126
+ var _a, _b, _c, _d, _e, _f;
127
+ var _g;
126
128
  this.textsTranslations = [];
127
129
  const values = (_d = (_c = (_b = (_a = parsed === null || parsed === void 0 ? void 0 : parsed.abapGit) === null || _a === void 0 ? void 0 : _a["asx:abap"]) === null || _b === void 0 ? void 0 : _b["asx:values"]) === null || _c === void 0 ? void 0 : _c.I18N_TPOOL) === null || _d === void 0 ? void 0 : _d.item;
128
130
  if (values === undefined) {
@@ -131,7 +133,7 @@ class ABAPObject extends _abstract_object_1.AbstractObject {
131
133
  for (const langItem of (0, xml_utils_1.xmlToArray)(values)) {
132
134
  const textElements = {};
133
135
  for (const item of (0, xml_utils_1.xmlToArray)((_e = langItem.TEXTPOOL) === null || _e === void 0 ? void 0 : _e.item)) {
134
- const key = (_g = ((_f = item.KEY) !== null && _f !== void 0 ? _f : item.ID)) === null || _g === void 0 ? void 0 : _g.toUpperCase();
136
+ const key = (_f = ((_g = item.KEY) !== null && _g !== void 0 ? _g : item.ID)) === null || _f === void 0 ? void 0 : _f.toUpperCase();
135
137
  if (key !== undefined) {
136
138
  textElements[key] = { entry: (0, xml_utils_1.unescape)(item.ENTRY), maxLength: parseInt(item.LENGTH, 10) };
137
139
  }
@@ -126,11 +126,13 @@ class Domain extends _abstract_object_1.AbstractObject {
126
126
  return { updated: true, runtime: end - start };
127
127
  }
128
128
  getFixedValues() {
129
- var _a, _b;
129
+ var _a;
130
+ var _b;
130
131
  return (_b = (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.values) !== null && _b !== void 0 ? _b : [];
131
132
  }
132
133
  getFixedValuesTranslations() {
133
- var _a, _b;
134
+ var _a;
135
+ var _b;
134
136
  return (_b = (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.valuesTranslations) !== null && _b !== void 0 ? _b : [];
135
137
  }
136
138
  }
@@ -8,7 +8,8 @@ class RenameICFService {
8
8
  this.reg = reg;
9
9
  }
10
10
  buildEdits(obj, oldName, newName) {
11
- var _a, _b, _c, _d;
11
+ var _a, _b;
12
+ var _c, _d;
12
13
  if (!(obj instanceof __1.ICFService)) {
13
14
  throw new Error("RenameICFService, not a ICF Service");
14
15
  }
@@ -33,8 +34,8 @@ class RenameICFService {
33
34
  }
34
35
  return newName;
35
36
  })();
36
- const cleanOldName = (_b = (_a = oldName.match(/^[^ ]+/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : oldName;
37
- const cleanNewName = (_d = (_c = newName.match(/^[^ ]+/)) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : newName;
37
+ const cleanOldName = (_c = (_a = oldName.match(/^[^ ]+/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _c !== void 0 ? _c : oldName;
38
+ const cleanNewName = (_d = (_b = newName.match(/^[^ ]+/)) === null || _b === void 0 ? void 0 : _b[0]) !== null && _d !== void 0 ? _d : newName;
38
39
  let changes = [];
39
40
  const helper = new renamer_helper_1.RenamerHelper(this.reg);
40
41
  changes = changes.concat(helper.buildURLFileEdits(obj, cleanOldName, cleanNewName));
@@ -25,7 +25,8 @@ class WebMIME extends _abstract_object_1.AbstractObject {
25
25
  return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.params[name.toLowerCase()];
26
26
  }
27
27
  getParameters() {
28
- var _a, _b;
28
+ var _a;
29
+ var _b;
29
30
  this.parse();
30
31
  return (_b = (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.params) !== null && _b !== void 0 ? _b : {};
31
32
  }
@@ -75,7 +75,7 @@ class Registry {
75
75
  }
76
76
  static abaplintVersion() {
77
77
  // magic, see build script "version.js"
78
- return "2.120.9";
78
+ return "2.120.10";
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.9",
3
+ "version": "2.120.10",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -52,20 +52,20 @@
52
52
  },
53
53
  "homepage": "https://abaplint.org",
54
54
  "devDependencies": {
55
- "@microsoft/api-extractor": "^7.58.9",
55
+ "@microsoft/api-extractor": "^7.58.12",
56
56
  "@types/chai": "^4.3.20",
57
57
  "@types/mocha": "^10.0.10",
58
- "@types/node": "^24.13.2",
58
+ "@types/node": "^24.13.3",
59
59
  "c8": "^11.0.0",
60
60
  "chai": "^4.5.0",
61
- "eslint": "^9.39.4",
61
+ "eslint": "^9.39.5",
62
62
  "mocha": "^11.7.6",
63
63
  "source-map-support": "^0.5.21",
64
64
  "ts-json-schema-generator": "^2.9.0",
65
- "typescript": "^6.0.3"
65
+ "typescript": "^7.0.2"
66
66
  },
67
67
  "dependencies": {
68
- "fast-xml-parser": "^5.9.3",
68
+ "fast-xml-parser": "^5.10.1",
69
69
  "json5": "^2.2.3",
70
70
  "vscode-languageserver-types": "^3.18.0"
71
71
  }