@abaplint/transpiler-cli 2.7.83 → 2.7.85

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/bundle.js +38 -10
  2. package/package.json +3 -3
package/build/bundle.js CHANGED
@@ -8667,7 +8667,7 @@ class CallFunction {
8667
8667
  const update = (0, combi_1.verNot)(version_1.Version.Cloud, (0, combi_1.str)("IN UPDATE TASK"));
8668
8668
  const unit = (0, combi_1.seq)("UNIT", expressions_1.Source);
8669
8669
  const background = (0, combi_1.verNot)(version_1.Version.Cloud, (0, combi_1.seq)("IN BACKGROUND", (0, combi_1.altPrio)("TASK", unit)));
8670
- const calling = (0, combi_1.seq)("CALLING", expressions_1.MethodName, "ON END OF TASK");
8670
+ const calling = (0, combi_1.seq)("CALLING", expressions_1.MethodSource, "ON END OF TASK");
8671
8671
  const performing = (0, combi_1.seq)("PERFORMING", expressions_1.FormName, "ON END OF TASK");
8672
8672
  const separate = (0, combi_1.str)("AS SEPARATE UNIT");
8673
8673
  const keeping = (0, combi_1.str)("KEEPING LOGICAL UNIT OF WORK");
@@ -19570,6 +19570,9 @@ class CurrentScope {
19570
19570
  if (this.current.getData().types[upper] !== undefined) {
19571
19571
  throw new Error(`Type name "${name}" already defined`);
19572
19572
  }
19573
+ else if (this.isOO() && this.current.getData().vars[upper] !== undefined) {
19574
+ throw new Error(`"${name}" already defined`);
19575
+ }
19573
19576
  this.current.getData().types[upper] = type;
19574
19577
  }
19575
19578
  addExtraLikeType(type) {
@@ -19619,6 +19622,9 @@ class CurrentScope {
19619
19622
  if (this.current.getData().vars[upper] !== undefined) {
19620
19623
  throw new Error(`Variable name "${name}" already defined`);
19621
19624
  }
19625
+ else if (this.isOO() && this.current.getData().types[upper] !== undefined) {
19626
+ throw new Error(`"${name}" already defined`);
19627
+ }
19622
19628
  this.current.getData().vars[upper] = identifier;
19623
19629
  }
19624
19630
  addIdentifier(identifier) {
@@ -19885,7 +19891,7 @@ class CurrentScope {
19885
19891
  while (curr !== undefined) {
19886
19892
  const stype = curr.getIdentifier().stype;
19887
19893
  if (stype === _scope_type_1.ScopeType.ClassDefinition
19888
- || stype === _scope_type_1.ScopeType.ClassImplementation
19894
+ // || stype === ScopeType.ClassImplementation
19889
19895
  || stype === _scope_type_1.ScopeType.Interface) {
19890
19896
  return true;
19891
19897
  }
@@ -20529,6 +20535,7 @@ exports.TypeUtils = void 0;
20529
20535
  const types_1 = __webpack_require__(/*! ../types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
20530
20536
  const basic_1 = __webpack_require__(/*! ../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
20531
20537
  const cgeneric_type_1 = __webpack_require__(/*! ../types/basic/cgeneric_type */ "./node_modules/@abaplint/core/build/src/abap/types/basic/cgeneric_type.js");
20538
+ // todo: refactor to static? for performance
20532
20539
  class TypeUtils {
20533
20540
  constructor(scope) {
20534
20541
  this.scope = scope;
@@ -20735,7 +20742,7 @@ class TypeUtils {
20735
20742
  return false;
20736
20743
  }
20737
20744
  isAssignableStrict(source, target, calculated = false) {
20738
- var _a, _b, _c, _d, _e, _f, _g;
20745
+ var _a, _b, _c, _d, _e, _f, _g, _h;
20739
20746
  /*
20740
20747
  console.dir(source);
20741
20748
  console.dir(target);
@@ -20823,6 +20830,17 @@ class TypeUtils {
20823
20830
  return false;
20824
20831
  }
20825
20832
  }
20833
+ else if (source instanceof basic_1.IntegerType) {
20834
+ if (target instanceof basic_1.StringType) {
20835
+ return false;
20836
+ }
20837
+ else if (target instanceof basic_1.Integer8Type) {
20838
+ if (((_h = source.getAbstractTypeData()) === null || _h === void 0 ? void 0 : _h.derivedFromConstant) === true) {
20839
+ return true;
20840
+ }
20841
+ return false;
20842
+ }
20843
+ }
20826
20844
  else if (source instanceof basic_1.FloatType) {
20827
20845
  if (target instanceof basic_1.IntegerType) {
20828
20846
  return false;
@@ -22478,7 +22496,7 @@ class Constant {
22478
22496
  runSyntax(node) {
22479
22497
  // todo: ConcatenatedConstant is not used?
22480
22498
  if (node.findDirectExpression(expressions_1.Integer)) {
22481
- return basic_1.IntegerType.get();
22499
+ return basic_1.IntegerType.get({ derivedFromConstant: true });
22482
22500
  }
22483
22501
  else if (node.getFirstToken().getStr().startsWith("'")) {
22484
22502
  let len = node.getFirstToken().getStr().length - 2;
@@ -28369,6 +28387,7 @@ const target_1 = __webpack_require__(/*! ../expressions/target */ "./node_module
28369
28387
  const fstarget_1 = __webpack_require__(/*! ../expressions/fstarget */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/fstarget.js");
28370
28388
  const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
28371
28389
  const inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js");
28390
+ const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
28372
28391
  class InsertInternal {
28373
28392
  runSyntax(node, scope, filename) {
28374
28393
  let targetType;
@@ -28376,7 +28395,8 @@ class InsertInternal {
28376
28395
  if (t) {
28377
28396
  targetType = new target_1.Target().runSyntax(t, scope, filename);
28378
28397
  }
28379
- if (targetType instanceof basic_1.TableType) {
28398
+ if (targetType instanceof basic_1.TableType
28399
+ && node.findDirectTokenByText("LINES") === undefined) {
28380
28400
  targetType = targetType.getRowType();
28381
28401
  }
28382
28402
  let source = node.findDirectExpression(Expressions.SimpleSource4);
@@ -28394,6 +28414,10 @@ class InsertInternal {
28394
28414
  new fstarget_1.FSTarget().runSyntax(afterAssigning, scope, filename, sourceType);
28395
28415
  }
28396
28416
  }
28417
+ if (afterAssigning === undefined
28418
+ && new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType) === false) {
28419
+ throw new Error("Types not compatible");
28420
+ }
28397
28421
  const afterInto = node.findExpressionAfterToken("INTO");
28398
28422
  if ((afterInto === null || afterInto === void 0 ? void 0 : afterInto.get()) instanceof Expressions.Target && sourceType) {
28399
28423
  const inline = afterInto.findDirectExpression(Expressions.InlineData);
@@ -47797,7 +47821,7 @@ class Registry {
47797
47821
  }
47798
47822
  static abaplintVersion() {
47799
47823
  // magic, see build script "version.sh"
47800
- return "2.102.29";
47824
+ return "2.102.33";
47801
47825
  }
47802
47826
  getDDICReferences() {
47803
47827
  return this.ddicReferences;
@@ -70644,7 +70668,14 @@ class ConstantTranspiler {
70644
70668
  const int = node.findFirstExpression(core_1.Expressions.Integer);
70645
70669
  if (int) {
70646
70670
  const concat = int.concatTokens().trim();
70647
- let code = `new abap.types.Integer().set(${concat})`;
70671
+ const parsed = Number.parseInt(concat, 10);
70672
+ let code = "";
70673
+ if (parsed > 2147483647 || parsed < -2147483648) {
70674
+ code = `new abap.types.Integer8().set(${concat})`;
70675
+ }
70676
+ else {
70677
+ code = `new abap.types.Integer().set(${concat})`;
70678
+ }
70648
70679
  if (this.addGet === true) {
70649
70680
  code += ".get()";
70650
70681
  }
@@ -77483,7 +77514,6 @@ class PerformTranspiler {
77483
77514
  const params = [];
77484
77515
  let index = 0;
77485
77516
  for (const t of ((_a = node.findDirectExpression(abaplint.Expressions.PerformTables)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(abaplint.Expressions.Source)) || []) {
77486
- console.dir(t);
77487
77517
  const name = def === null || def === void 0 ? void 0 : def.getTablesParameters()[index].getName().toLowerCase();
77488
77518
  if (name === undefined) {
77489
77519
  continue;
@@ -77493,7 +77523,6 @@ class PerformTranspiler {
77493
77523
  }
77494
77524
  index = 0;
77495
77525
  for (const u of ((_b = node.findDirectExpression(abaplint.Expressions.PerformUsing)) === null || _b === void 0 ? void 0 : _b.findDirectExpressions(abaplint.Expressions.Source)) || []) {
77496
- console.dir(u);
77497
77526
  const name = def === null || def === void 0 ? void 0 : def.getUsingParameters()[index].getName().toLowerCase();
77498
77527
  if (name === undefined) {
77499
77528
  continue;
@@ -77503,7 +77532,6 @@ class PerformTranspiler {
77503
77532
  }
77504
77533
  index = 0;
77505
77534
  for (const c of ((_c = node.findDirectExpression(abaplint.Expressions.PerformChanging)) === null || _c === void 0 ? void 0 : _c.findDirectExpressions(abaplint.Expressions.Source)) || []) {
77506
- console.dir(c);
77507
77535
  const name = def === null || def === void 0 ? void 0 : def.getChangingParameters()[index].getName().toLowerCase();
77508
77536
  if (name === undefined) {
77509
77537
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler-cli",
3
- "version": "2.7.83",
3
+ "version": "2.7.85",
4
4
  "description": "Transpiler - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -26,12 +26,12 @@
26
26
  "author": "abaplint",
27
27
  "license": "MIT",
28
28
  "devDependencies": {
29
- "@abaplint/transpiler": "^2.7.83",
29
+ "@abaplint/transpiler": "^2.7.85",
30
30
  "@types/glob": "^7.2.0",
31
31
  "glob": "=7.2.0",
32
32
  "@types/progress": "^2.0.5",
33
33
  "@types/node": "^20.5.7",
34
- "@abaplint/core": "^2.102.29",
34
+ "@abaplint/core": "^2.102.33",
35
35
  "progress": "^2.0.3",
36
36
  "webpack": "^5.88.2",
37
37
  "webpack-cli": "^5.1.4",